Commit 4423a61
fix(mcp): redeploy in-place — create_deploy {redeploy:true} + tarball on redeploy tool (#34)
Closes the AGENT-UX trap (shared/AGENT-UX.md) where shipping v2 of an app via
the MCP left two live deployments + two URLs, and the standalone `redeploy`
tool was 100% broken (sent no tarball, api always 400'd missing_tarball, tool
description falsely claimed "the tarball from the original deploy is reused").
create_deploy: new optional `redeploy: boolean` (default false). When true,
the client appends `redeploy=true` to the multipart form on POST /deploy/new
— the api (PR feat/deploy-new-redeploy-in-place) then updates the existing
deployment in place (same app_id, same URL) instead of minting a fresh one.
Omitting the flag preserves legacy "always new" behaviour byte-for-byte on
the wire. Forward-compatible: on an api that hasn't yet shipped the field,
Fiber's MultipartForm parser silently ignores it, so callers see the legacy
path with no error.
redeploy (standalone tool): now requires `tarball_base64` (same shape as
create_deploy). client.redeploy(id, tarball) POSTs multipart to
/deploy/:id/redeploy with a tarball file part — matches deploy.go:1245
which already required it. Tool description rewritten to stop lying about
tarball reuse and to steer agents toward the create_deploy({name,
redeploy:true}) path when they have the name.
Breaking change for the standalone redeploy tool (added required tarball
param), but the tool was 100% broken before so no real callers depended
on it.
Coverage block (rule 17):
Symptom: AGENT-UX path B: redeploy({id}) → 400 missing_tarball
AGENT-UX path A: create_deploy(same name) → 2 URLs
Enumeration: rg -F 'redeploy' src/ test/ + rg -n 'createDeploy|create_deploy'
Sites found: src/index.ts (redeploy tool, create_deploy tool, file docstring),
src/client.ts (redeploy method, createDeploy method,
CreateDeployParams interface), 4 tests in tools-unit,
3 tests in client-unit, 3 tests in integration, mock-api
/deploy/:id/redeploy + /deploy/new handlers, README.md.
Sites touched: all listed sites (no skips).
Coverage test: redeploy-in-place tool handlers suite — iterates the
create_deploy {redeploy:true vs default} contract and
asserts the standalone redeploy tool sends a multipart
POST with a tarball part.
Live verified: awaiting api PR feat/deploy-new-redeploy-in-place in prod
(rule 14 build-SHA check) before MCP merge — see PR body.
Tests: 373/373 pass. Coverage: client.js 100% line / 95.33% branch,
index.js 99.79% line / 96.53% branch.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 96eb228 commit 4423a61
7 files changed
Lines changed: 559 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
189 | 218 | | |
190 | 219 | | |
191 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
317 | 332 | | |
318 | 333 | | |
319 | 334 | | |
| |||
956 | 971 | | |
957 | 972 | | |
958 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
959 | 983 | | |
960 | 984 | | |
961 | 985 | | |
| |||
1083 | 1107 | | |
1084 | 1108 | | |
1085 | 1109 | | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1092 | 1123 | | |
1093 | 1124 | | |
1094 | 1125 | | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1098 | 1149 | | |
1099 | | - | |
| 1150 | + | |
1100 | 1151 | | |
1101 | 1152 | | |
1102 | 1153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
940 | 945 | | |
941 | 946 | | |
942 | 947 | | |
943 | | - | |
| 948 | + | |
944 | 949 | | |
945 | 950 | | |
946 | 951 | | |
| |||
950 | 955 | | |
951 | 956 | | |
952 | 957 | | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
953 | 965 | | |
954 | 966 | | |
955 | 967 | | |
| |||
1066 | 1078 | | |
1067 | 1079 | | |
1068 | 1080 | | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1069 | 1095 | | |
1070 | 1096 | | |
1071 | 1097 | | |
| |||
1442 | 1468 | | |
1443 | 1469 | | |
1444 | 1470 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1449 | 1484 | | |
1450 | 1485 | | |
1451 | | - | |
| 1486 | + | |
1452 | 1487 | | |
1453 | 1488 | | |
1454 | 1489 | | |
1455 | 1490 | | |
1456 | 1491 | | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1457 | 1506 | | |
1458 | | - | |
| 1507 | + | |
1459 | 1508 | | |
1460 | 1509 | | |
1461 | 1510 | | |
1462 | 1511 | | |
1463 | 1512 | | |
1464 | 1513 | | |
1465 | 1514 | | |
1466 | | - | |
| 1515 | + | |
1467 | 1516 | | |
1468 | 1517 | | |
1469 | 1518 | | |
| |||
0 commit comments