Commit a5e4f43
fix(sandbox-bridge): faithful body-size limit + timeout/error status mapping (#218)
Two bridge faithfulness fixes so documented agent flows don't fail opaquely:
1. Body-size cap 256KB -> 1MB. Issue documents (plans/specs) allow a 512KB
body (upsertIssueDocumentSchema: z.string().max(524288)). A PUT wraps that
in a JSON envelope and a GET returns it with metadata, so the old 256KB cap
rejected real document reads/writes with an opaque 502. 1MB covers a max
document plus envelope; the queue protocol already base64-chunks large bodies.
2. Host-proxy error mapping. A fetch timeout or oversized response previously
threw into the worker's generic 502 with a vague message. Now:
- AbortSignal timeout -> 504 with a clear "did not respond within 30s; the
request may or may not have applied, re-read state before retrying" body.
A timeout on a mutating call is ambiguous, and an agent that can't tell a
timeout from a failure tends to confabulate an outcome.
- Oversized response body -> 413 (call succeeded server-side, payload too
large to relay) instead of implying the operation failed.
- Other unreachable errors -> 502 with the underlying message.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5c1d7fc commit a5e4f43
2 files changed
Lines changed: 59 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1182 | 1210 | | |
1183 | 1211 | | |
1184 | 1212 | | |
1185 | 1213 | | |
1186 | 1214 | | |
1187 | 1215 | | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1188 | 1233 | | |
1189 | 1234 | | |
1190 | 1235 | | |
1191 | | - | |
| 1236 | + | |
1192 | 1237 | | |
1193 | 1238 | | |
1194 | 1239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
| |||
0 commit comments