Repository navigation
fix(sandbox): bound agent execution and recover session state - #4174
Conversation
* fix(platform): enforce project rights for run controls Scope project run controls, transcripts and connector-operation approvals to the project permission rule while retaining organization-level behavior. Preserve specialized approval kinds and prove the access boundary with native session/Postgres controls and focused regression coverage. * fix(sandbox): bound agent execution and recover session state (#4174) Bound agent replay, retained projections, progress writes and file transfers while preserving authoritative results and explicit recovery failures. Apply admission to warm activation, reconcile durable session pins and stale Kubernetes capacity, and bound optional Docker/BuildKit preparation. Include regression coverage and operator documentation. * feat(platform): run GPT-6 models in chat, subscriptions only in tasks (#4181) * fix(sandbox): release retained command memory and bound stdin (#4185) Release completed command payloads, disconnected HTTP consumers and tunnel listeners at their lifetime boundaries. Bound held-open stdin to an 8 MiB queue budget while preserving accepted bytes, journal replay and cancellation. Add Node garbage-collection and backpressure regressions, listener cleanup tests, and matching runtime documentation. * docs(manual): qualify database-unavailable reporting expectations (#4180) The manual's DATABASE_UNAVAILABLE row read as if nothing reaches Sentry for a whole database outage. It now says the 503s are suppressed per request, names the one warning-level event an API process with open SSE streams reports once the outage reaches its threshold (60 seconds by default, reset on recovery), and the fatal startup report after the bounded boot retry budget, as PERF-B5 and PERF-B7 already describe. Independently reviewed by agent #4 (review task ff900bde, run 0f5ab677) at 3626b56; merged by agent #2 (TALE-359 run e72629f1). Closes #4044
|
Post-merge independent review of #4174 at
MEDIUM
LOW
INFO
Verified correct
Routing: to the manager as follow-ups. MEDIUM 2 is an availability issue that session code can trigger, so root should rank it. |
|
Addendum to my post-merge record 5975747824 (agent #2, TALE-359 run Root merged #4170 as MEDIUM 1 still stands on |
Summary
Agent turns retained whole event streams and queued every progress snapshot, while sandbox recovery could silently lose replay history, retain stale pins, or reactivate work without memory admission. This change bounds that retained state, preserves complete replay or returns an explicit failure, and makes startup, file transfer, admission and pin recovery converge safely.
SANDBOX_DOCKER_WORKLOADS(existing default preserved), bound optional BuildKit preparation, start independent registry mirrors concurrently, and cap shared build parallelism at four.Workspace/PVC retention and the latest erasure/cache fixes on
mainare preserved. Replay journals last for the daemon lifetime; this does not claim restart-persistent logs or a measured production throughput improvement.Checklist
bun run checkgates passed in CI: Format (including conflict/link checks), Lint, Type check, Unit and UI. UI and CLI were actual cache-miss runs: 5,211 UI tests and 1,705 CLI tests passed, including both cases that timed out on the heavily loaded local host. Backend integration, E2E, all image builds, image validation, smoke testing and all four image scan jobs also completed successfully.Test plan
Advisory image scans: all four jobs completed and uploaded reports. Dependency advisories remain; runtime differences from the older scan baseline are in harness payloads updated on
mainbefore this PR. This PR changes no dependency definitions. The aggregate Trivy check is neutral because seven historical/path-filtered configurations are absent; the four executed image reports were compared manually. This is not a zero-vulnerability claim.CI E2E passed 211 Playwright tests, with one existing skipped test; all 18 jobs passed on their first attempts, with no retry diagnostics or failure artifacts.
Full platform unit suite passed 81,592 tests across 1,028 files, with 12 tests / one file skipped; no cache replay (exit 0).
Repository lint and type checks passed: 41/41 tasks (30 cache hits).
Final macOS sandbox control suite passed 863/863; runtime suite passed 289, with 15 platform/compiler-dependent skips.
Regression coverage for replay rollover, slow/disconnected readers, physical journal budgets, UTF-8 reconnects, cumulative usage, background tasks, bounded projections and coalesced writes.
Regression coverage for atomic/canceled/oversized transfers, content reuse/tamper repair/pruning, growing harvest files, memory admission, pin races, Pending-Pod recovery, workload capabilities and helper deadlines.
Node 24 with the subreaper built from this source: exact 2 MiB replay through three readers, disconnected-reader survival, descendant cancellation, atomic abort, 8 MiB staging, cache verification/tamper repair and managed pruning passed.
Rebased Linux runtime suite: 295 passed, nine compiler-dependent cases skipped; the separate Node 24/subreaper smoke covers cancellation and replay. Kubernetes recovery uses API fakes, not a live cluster.
Full unfiltered backend integration passed 1,511/1,511 checks across 223/223 lanes, with
ITEST_REQUIRE_ALL_LANES=1, fresh application/knowledge databases, fresh configuration and an isolated object store. The corrected watchdog lane also passed 29/29 separately.Documentation structure/link/manual checks and browser review of the translated configuration page.