Repository navigation
Commit c5af938
fix(sandbox): fail closed when a read-only pin is not honored on resume (cycle-review critical)
Codex adversarial review of #33 flagged — and a real-codex smoke confirmed —
that Codex 0.144.6 keeps a loaded thread's sandbox and ignores thread/resume
overrides: `task --read-only --resume-last` on a write-capable thread ran
with workspace-write access, violating the --read-only contract.
Verified empirically (codex-cli 0.144.6): write-thread -> resume with
--read-only returned resolved.sandbox = workspaceWrite. The code never
compared the resolved sandbox to the explicit pin.
Fix: assertExplicitSandboxHonored() in runAppServerTurn compares an explicit
read-only pin to the app-server's resolved sandbox and throws on mismatch —
fail closed instead of running write-capable under a read-only flag. Only the
read-only pin is enforced (a write request on a read-only resolved sandbox is
a downgrade, not a safety leak). TDD: a resume-ignores-sandbox fake-codex
behavior reproduces the leak (RED), the assertion turns it green.
Also confirms the port's cubicj claim: a plain task with sandbox:null resolves
to read-only from config (smoke: resolved readOnly), so stock behavior is
unchanged.
Co-Authored-By: Claude <[email protected]>1 parent d444ef1 commit c5af938
3 files changed
Lines changed: 67 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
114 | 145 | | |
115 | 146 | | |
116 | 147 | | |
| |||
1229 | 1260 | | |
1230 | 1261 | | |
1231 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1232 | 1268 | | |
1233 | 1269 | | |
1234 | 1270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1428 | 1428 | | |
1429 | 1429 | | |
1430 | 1430 | | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1431 | 1455 | | |
1432 | 1456 | | |
1433 | 1457 | | |
| |||
0 commit comments