fix: address CodeRabbit review for session control - #6558
Conversation
Reject invalid reclaim and delivery settings during configuration load. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Fail closed until the first heartbeat confirms ownership and authenticate runner-initiated ownership release. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Bound cancel requests, reject unknown Codex reap outcomes, and isolate all keepalive TTL settings in tests. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Publish successful local mounts to teardown state before observing cancellation. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Guarantee one done record when a session-owned run throws outside the engine. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Retain sends until admission, restore attachments, and avoid overwriting a newer composer draft. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Expose skipped cells as untested, make the offline script fixture-aware, and require the durable late-answer conflict. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Document owner routing limits, transport requirements, fail-closed admission, cleanup continuity, and sanitized test evidence. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📘 Docs preview
This comment updates in place on every push. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Railway Preview Environment
Updated at 2026-09-05T06:27:17.523Z |
mmabrouk
left a comment
There was a problem hiding this comment.
Agent-generated Codex review, low weight.
CHANGES NEEDED
Two release blockers remain: the Codex reap result must not revoke the required 600-second warm/native-session reuse after a settled Stop, and desktop refusal recovery must not consume the refused message before it knows the occupied composer can accept it.
Commit verdicts:
- KEEP: d4c3d7e, f1fedce, ffb780c, 4cadbd3, fe131e8.
- KEEP WITH FIX: 0478ce1 (retain the bounded cancel request, remove reap-driven teardown), afafc5c (retain the refused send when a newer draft blocks restoration), 712373d (keep the other doc fixes, restore the warm-reuse contract).
- DROP AND REPLY: none. For the original reap thread, reply that reaping is best effort, cleanup misses are QA evidence, and the 600-second stopped TTL bounds leftovers without sacrificing warm reuse.
f1fedce can refuse a legitimate turn if the first heartbeat request or response is lost; that is the explicit fail-closed availability tradeoff for the one-execution invariant. It does not touch or evict the warm pool before refusal. The sole release_owner sender adds x-agenta-runner-token, and serving mode requires that token at boot even on flag-off/cold paths. 4cadbd3 preserves exactly one done through terminalRecordEmitted. No migrations are changed.
CI: the runner/API/SDK/services/web unit matrices, runner acceptance/integration, images, preview, Railway result checks, lint, and security checks passed. TypeScript format fails only on web/packages/agenta-chat/tests/unit/model/userStop.test.ts, which is byte-identical to the fetched base and outside this PR. The preview web unit and acceptance jobs were still pending at the final snapshot. Focused local runner test: 1 file, 25 passed (nice 19, maxWorkers=3).
Treat post-cancel process reaping as best effort without changing the harness-confirmed cancellation outcome. Log cleanup misses for QA and cover failed and unknown reap paths through parking and continuity. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Keep the recovery slot when a newer composer draft blocks restoration. Consume it only after refused text and staged attachments are placed safely, with regressions for the occupied-composer case. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Document that Codex cleanup misses are QA evidence rather than a teardown signal. Keep settled Stop parking and continuity under the 600-second stopped-session window. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
Apply the repository Prettier style to the inherited test file so the TypeScript format check passes. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
mmabrouk
left a comment
There was a problem hiding this comment.
Agent-generated Codex review, low weight.
CHANGES NEEDED
Runner: SHIP. Failed, unknown, and too-many Codex reap outcomes no longer alter the settled cancel result, so the unchanged park consumers and both the in-memory and durable continuity writes preserve the stopped session on the durable and legacy paths. The bounded cancelSession request/settlement logic is untouched.
Scope is limited to the four reported items: best-effort reap behavior and QA logging, refusal recovery, matching docs, and formatting (plus one format-only reflow in run-turn.ts). One frontend P1 remains; see the inline finding.
Move a refused send into a conversation-local holding slot before a newer submission can replace the queue recovery value. Restore its text and staged attachments once the composer becomes empty, without submitting it automatically. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
mmabrouk
left a comment
There was a problem hiding this comment.
Agent-generated Codex review, low weight.
CHANGES NEEDED
Once the holding slot is populated, restoration is exactly once and does not auto-send; the flag-off path remains a no-op. One P1 race remains because capture into the slot is deferred with placement. See the inline finding.
Capture the refused send into the conversation-local holding slot before scheduling editor placement. Cover the interleaving where a newer submission replaces the queue recovery value before the frame runs. Claude-Session: https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk
mmabrouk
left a comment
There was a problem hiding this comment.
SHIP
Reviewed e5a7fa4 only against the Round 4 ordering finding. The effect now captures takeLastSent() into the conversation-local holding slot before requestAnimationFrame is scheduled, so a newer submission cannot overwrite the refused item. The revised regression begins with an empty slot, interleaves the newer submit before deferred placement, and verifies the refused text and staged attachments restore exactly once while the newer queue recovery value remains intact.
Focused OSS verification: 1 file passed, 5 tests passed, --maxWorkers=2.
— Codex
Summary
Addresses all 22 unresolved CodeRabbit threads on #6553. The changes tighten session admission and ownership release, preserve the Stop safety invariants, recover refused desktop sends without overwriting newer drafts, and make the release gate fail on incomplete evidence.
Changes
409for durable late approvals.Verification
--maxWorkers=3.@agenta/chat: typecheck and lint passed; 684 unit tests passed with--maxWorkers=3.node_modulesare absent.agenta_inc7OSS chain is stamped at missing revisionoss000000027; it was not downgraded or rewritten.Review dispositions
d4c3d7efe8; invalid reclaim and delivery values now fail configuration validation, with direct and env-backed tests.712373da0f; the research now distinguishes a single runner, owner-aware routing, wrong-replica failure, durable Cancel, and best-effort Kill cleanup.deliveryvson_busy712373da0f; the RFC useson_busyconsistently.712373da0f; HTTPS validation and same-origin/no-credential redirect rules are explicit.712373da0f; fenced generation checks are distinguished from the v1 execution/replica checks.fe131e811d; skips are namedSKIPPED, UNTESTED, mark the result incomplete, and fail the driver.fe131e811d; PEP 723 declares pytest and standalone execution usespytest.main.f1fedce958; missing HTTP/network confirmation fails closed beforerun().slice-admission.md; mobile has a separate composer and QA surface, so this desktop recovery slice does not change it.712373da0f; live host, internal paths, env-file details, keys, and temporary driver paths were removed.712373da0f; the record now requires targeted ownership or ACL repair and forbids making the whole tree world-writable.afafc5cc02; recovery checks the current draft and restores staged attachments, including attachment-only sends.afafc5cc02; recovery clears only after a runner turn ID confirms admission, not at dispatch.afafc5cc02; the seven identified blocks were reduced to contract-level comments.f1fedce958; release requires the runner token and the runner sends it, with API and runner tests.712373da0f; settled/reaped Stops preserve continuity, while unsettled cleanup falls back to cold replay.0478ce1f02; only a successful kill or cleannothing-to-reapinspection permits parking.cancelSession0478ce1f02; the request itself is raced against the settle budget.ffb780ca7a; successful mounts are committed before abort observation in both local mount paths.4cadbd3fc8; every uncaught session-owned run error persists exactly one terminaldone.0478ce1f02; all four keepalive TTL variables are saved, cleared, and restored per test.fe131e811d; only explicit HTTP 409 passes, with 200/202/500 regression cases.Agent-generated, low weight.
https://claude.ai/code/session_0164kzT6ttwpBtzvcDC6YzYk