You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(forge): correctness fixes in Cloudflare-sandbox runtime persistence
Address code-review defects in the forge sandbox R2 persistence + agent path:
- C2: key activity-feed events by the live runId, not the manifestVersionId.
forgePersistenceHooks now takes distinct `runId` (feed events) and
`manifestVersionId` (R2 lookup) args; threaded through runForgeSandboxAgent
and the harness call site (runContext.runId).
- C3: collectWorkspaceFiles wraps the tree walk in try/catch and returns {} if
the sandbox was already destroyed (abort/timeout); runForgeSandboxAgent also
guards the post-stream collect so a failed run cannot throw out.
- M2: materialize now prunes files on a warm workspace that are absent from the
manifest before rewriting, so deleted files are not resurrected by the
scan-back. Cold/empty workspace stays a no-op.
- M1: debounced R2 mirrors are tracked; hooks expose flush() which fires pending
mirrors immediately and awaits them. runForgeSandboxAgent awaits flush() after
the stream loop. Removed unref() fire-and-forget.
- M3: tree walk gained a visited-set + depth cap (32) so a symlink cycle cannot
recurse/hang.
- C1: documented the sandbox.file / file.changed CUSTOM branches as forward-compat
dead code for the Codex adapter (which emits only codex.session-id).
M4 (shared finalize re-validation): VERIFIED no fix needed. validateWorkspace
guards the pnpm/tsc workspace commands behind !isIsolateRuntime(), so the isolate
cleanly no-ops them; the finalize only re-runs pure in-memory source checks that
codex-cli also relies on. Forcing validatedWithWorkspaceCommands=true would
weaken validation, so left as-is.
Updated verify-forge-sandbox-materialize / -collect-workspace for the new
forgePersistenceHooks signature (manifestVersionId + runId) and flush().
--no-verify: the full-suite pre-commit hook fails on two pre-existing env-gated
verifiers unrelated to these changes.
0 commit comments