Repository navigation
fix(sandbox): improve agent throughput and sandbox reliability - #4177
Conversation
5fd9d82 to
1c19bf8
Compare
|
Source-specific follow-up from the postmerge #4189 review, for this existing lifecycle lane. Read-only comparison uses current main Earlier P2: abandoned nonterminal containers. Docker's This is deliberately conservative: a created container may be another replica's slow successful create, and a paused container may be intentional. Please assess a bounded stale-owner recovery contract in this existing lane. Neither state nor age alone is sufficient destruction authority. Any automatic recovery needs a current immutable incarnation plus evidence that the create/owner cannot still complete, and must preserve slow concurrent winners, legitimate pauses, unknown inspection outcomes and all workspace data. Retain source diagnosis as unexecuted until controlled tests demonstrate an abandoned case and the protected controls. Earlier P3 is materially addressed here. Parent coordination keeps P2/P3 with this existing #4177 owner. The separate N1–N3 device-hub repair does not touch your lifecycle files. |
Summary
Keep agent work moving when one answer, sandbox, disk, or Docker operation stalls. Recovery rotates unreachable runs fairly, direct chat immediately reuses each available worker slot, and delayed progress cannot regress an active run's heartbeat. Sandbox creation and staging share cancellation budgets; failed creates preserve workspace data and remove only their own container incarnation.
Build on main's existing journal, replay protocol, projection, Docker capability, and ownership contracts:
Checklist
bun run checkpasses: 58/58 tasks, 34 cached, exit 0..env.exampleare updated. Root multilingual READMEs are N/A because installation entry points are unchanged.lint:manualpasses (5 trees, 1,447 boxes).Test plan
Final head:
824a7cde660d6d9da5377ab06aff046caf74c08a, integrated with maind29a3c8fe78cdba54d247fe82ea5195f702c0651. Full local checks, exact-head PostgreSQL integration and full SAST have passed. Hosted workflows pin merge candidate91387103b8e52d95f4202d800d60c1b91cf697b8; its file tree exactly equals this local head. All six hosted workflows completed successfully on their first attempt, including the actual container smoke, image-validation, runtime behavior and advisory scan steps. Earlier candidate results are historical only.0149_in_place_retry_state.sqland this PR’s unshipped0150_agent_recovery_fairness.sql. Exact-head real PostgreSQL/MinIO integration passed 1,541/1,541 checks across all 225 required lanes, including concurrent boot, recovery fairness and claim races. The live migration ledger confirms both files applied.Hosted validation
All executed jobs use merge candidate
91387103b8e52d95f4202d800d60c1b91cf697b8, whose tree exactly equals PR head824a7cde. Later main changes through43f29ec53713823dfb6a7358783e1128bd1c3ca7were reviewed and merge cleanly; they are outside this candidate's execution evidence.fixme; docs: 55 passed; web: 90 passed.91387103. Fresh execution passed 29/29 container smoke tests, 40/40 image checks and 83/83 runtime behavior checks. All four Trivy scans, SARIF uploads and CycloneDX inventories completed. Runtime image: 6,067 MB within its 6,600 MB budget; sandbox: 302 MB within 320 MB.Image dependency advisories
GitHub’s aggregate Trivy comparison is neutral: seven historical main scan configurations are absent from this PR (
trivy-controller,trivy-convex,trivy-db,trivy-proxy,trivy-sandbox-egress,trivy-sandbox-llm-gateway,trivy-fs). Its automatic PR alert comparison is therefore incomplete; the four changed-image scans required by the current workflow all executed successfully and were manually compared as described below.Successful advisory scan execution retains the following package findings. Counts are SARIF occurrences, including duplicate installed copies; no new suppressions were added.
Every platform, sandbox and BuildKit vulnerability/package/installed-version identity appears in retained main scan records. For runtime, 1,730 of 1,744 occurrences match the retained main runtime inventory by vulnerability/package/installed version; 14 additional occurrences comprise 13 unmatched identities plus another copy of an already known
http-cache-semanticsfinding. Those locations are in the Cursor, OpenClaw and Hermes installations upgraded by main commit d74fb3d7, before the integratedd29a3c8febase. This PR changes no Dockerfile, agent pin, package manifest, lockfile or scan suppression. The retained runtime inventory predates those main upgrades; a post-upgrade main inventory was unavailable, so exact current-main image equivalence is unproven.The unmatched records include Critical
CVE-2026-102992in Cursor'spiscina4.9.3 (scanner lists 4.9.4 as a fix), HighCVE-2026-102276/CVE-2026-102278in OpenClaw'sbrace-expansion5.0.9, and HighCVE-2026-19534in itsundici6.28.0 (fix 6.28.1). The extrahttp-cache-semanticsoccurrence is HighCVE-2026-93748, with no fix listed. These dependency advisories remain unresolved. Scan diagnostics also include a large platform source-map warning and runtime SPDX-license serialization warnings; scan, SARIF and inventory steps completed successfully.Kubernetes admission across simultaneous replicas remains best effort; ResourceQuota provides hard namespace limits. Deadline cancellation preserves workspaces for retry or explicit destruction. Performance coverage is exercised, but no matched baseline supports a percentage speedup claim.