Repository navigation
fix(acp): keep completed run-mode sessions resumable - #107366
henkterharmsel wants to merge 3 commits into
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (35 earlier review cycles; latest 8 shown)
|
b438552 to
40e6ec7
Compare
c1606f1 to
c47d91b
Compare
c47d91b to
6cba910
Compare
80c54eb to
26049aa
Compare
99a7014 to
31d7619
Compare
|
@clawsweeper re-review Addressed the actionable reset finding and refreshed the branch onto
Maintainer acceptance is still needed for retaining confirmed completed-child identity, the optional resume capability contract, and asynchronous completed-one-shot follow-up delivery. The body documents the legacy rejection and compatibility boundaries; this update does not claim those decisions have been approved. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Updated this existing PR to
The body supersedes the old-head proof and test summaries. Historical unrelated/unattributed CI failures are not claimed fixed, and new-head CI remains required. There were no unresolved inline review threads at inspection. Maintainer acceptance is still required for retention/deletion and upgrade/rollback expectations, the optional resume capability contract, and asynchronous completed-child follow-up delivery. Those decisions are not self-approved by this update. |
|
🦞👀 Re-review progress:
|
|
CI follow-up at
The PR body now carries the current head, fresh live proof, measured timings, prior rejected-review rationale, and remaining gaps. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Refreshed this PR onto the current completion owners, with the body separating current-head checks from preceding-head and historical provider evidence. Current head:
Current-head CI and maintainer acceptance of the lifecycle/capability contract are still required. No merge approval is presumed. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thanks @henkterharmsel for investigating this and proposing the fix. We reproduced the completed-run continuity problem on main and merged a focused replacement in #189273, preserving your coauthor credit. It retains recorded ACPX conversations and returns asynchronous follow-up results through the existing completion owner. The broader unsupported-harness and legacy-metadata cases remain tracked in #106696. |
Closes #106696.
What Problem This Solves
Fixes lost conversation context when a parent sends a follow-up to a completed ACP
mode="run"child.User Impact
Parents can continue a completed Claude or Codex one-shot using the same child key, confirmed conversation identity, and working directory. Unsupported, unconfirmed, legacy metadata-loss, and confirmed missing-target cases fail explicitly instead of silently starting a new conversation. Workers are still released after completion.
Ordinary parent-owned completed-child follow-ups return asynchronous
accepted, including with a positive send timeout, and use the current session-follow-up completion owner. Explicit caller-owned and scoped-grant completion retain their existing inline behavior. Persistent sessions retain agent-ID-first resume selection.Why This Change Was Made
Resume eligibility is recorded only when the backend advertises support and a completed turn confirms usable identity. Follow-ups stay on that backend. Current operation admission, requester authority, generation fencing, prompt restoration, and MCP ownership remain in place; ambiguous errors preserve retryable identity.
This refresh ports the fix to the current completion owners instead of restoring the retired task registry. Dispatch and completion now consume the same prepared requester/target facts in the existing follow-up module. A review regression also fixes a speculative bridge lookup rejecting valid listed sessions when that optional bridge is absent; genuine Gateway errors still propagate.
Maintainer decision still needed: completed one-shot identity retention/deletion, the optional backend capability contract, and asynchronous parent completion. This patch does not reconstruct previously deleted legacy state or promise that an older version preserves the new resume flags. No merge approval is presumed.
Evidence
Current head
7913b4932edd1839318513d6feba4a09a41ad893, based onbf8da001d61c25e8c4dcc1eeaa6ea88a62ef4f97, uses upstream ACPX 0.19.4 without a dependency override.Current-Head Fixture Corrections
CI at
2450afaidentified two test-only issues: the resume store fixture omitted requiredcfgandstorePathfields, and five closed mocks lacked the current isolation contract. This head supplies the fixture fields, removes the unnecessary command-list mock, and documents the four intentional host/config/delivery/custody boundaries. No production code, assertions, or baselines changed.The record-replacement suite passed 6/6 tests (38.10 seconds runner wall time), and the bridge suite passed 4/4 with real command discovery (12.52 seconds runner wall time). Formatting, syntax-only lint, and diff checks pass. The agent follow-up file changed only comments; its preceding 47-test grouped validation remains applicable to its unchanged executable content. The native TypeScript-based ratchet and typecheck are left to fresh CI, not claimed locally passing.
Cancellation Correction (2450afa)
CI at preceding head
fda8887b7c1c957dee0e36d1aad7e2c396f0aaefexposed a real regression in two unchanged owner/lifecycle-replacement tests: cancellation lost its durable terminal signal while awaiting identity reconciliation. The exact CI base's runner and test were compared; this was not classified as inherited.That commit changes only
manager.turn-runner.ts: pre-publication reconciliation is limited to completed, non-aborted one-shots. Persistent and cancelled turns retain upstream publication-before-final-reconciliation ordering, including its authority checks. Strict one-shot identity persistence remains intact.The two cancellation-replacement cases and four one-shot completion/readiness cases passed: 6/6 tests in two files, 130.61 seconds command wall time, 36.87 seconds project duration. Syntax-only lint and diff checks pass. Independent narrow review found no actionable P0-P2 findings. An earlier worker-preparation attempt stopped before tests and is not counted as passing evidence.
Broader Refresh Validation (fda8887)
No session found: acp-bridge:agent:main:work, then passed after making only the speculative lookup allow a missing result. Explicit routing and reset siblings also pass.git diff --checkpass. No unit-test assertions, lint limits, or baselines were weakened.Commands used the repository runner:
pnpm test <selected-files> --maxWorkers=1. The final five-file command took 1333.86 seconds, including 340 seconds preparing worker artifacts. Its three project durations were 889.54, 23.64, and 31.32 seconds. These are grouped local measurements, not individual-file or CI timings. Current-head CI timings remain pending. Persistence, requester retirement, and adapter-process boundaries use the real owners; pure predicate mocks would not cover those contracts.The official full-candidate autoreview reported no actionable P0-P2 findings. An additional independent review found the optional-bridge defect above; the regression and correction address it. A fresh narrow review of the subsequent existing-owner extraction and bridge correction found no further P0-P2 findings. These are static reviews, not provider or delivery proof.
Release-State Compatibility (fda8887)
An isolated source-owner probe used exact v2026.10.3 (
59cb44796b0f1f0daa0e37af8b1495abb45d9bc1), real SQLite persistence/migration owners, synthetic session state, and a synthetic ACP backend. It established:The observation, reopen, refusal, restore, additive-write, and additive-read phases each exited 0 without timeout and retained unchanged source fingerprints. Three earlier failures remain recorded: incorrect migration ownership in the harness; a 300-second proof-process timeout; and an overstrict observation guard rejecting a zero-byte WAL with retained SHM after behavior and shutdown assertions passed. The last failed outcome was not rewritten: a separate read-only observation completed it. Snapshot-copy checks stayed strict, and no sidecars or schema markers were deleted or rewritten to force a pass.
This is source-owner persistence evidence at the preceding refresh head, not installed-package updater or CLI backup-archive restore E2E proof. It did not use provider credentials, production state, Telegram, or real ACP subprocesses. The subsequent cancellation and test-only corrections do not change metadata formats or migration code; the full compatibility probe was not repeated for them.
Historical Provider Proof
The following real-provider proof belongs to previous head
8f2ce3799f8bbbb20cd197e94fa624a1a60660ca, not this refresh. On 2026-09-24, isolated Claude ACP 0.78.0 and Codex ACP 1.12.0 runs using ACPX 0.19.1 completed a nonce-bearing one-shot, shut down/recreated the adapter, and resumed with the original backend identity. Both recalled the nonce and working directory without repeating the nonce; tool events were zero. Source/dependency hashes stayed unchanged.This was adapter-level continuity proof, not a full Gateway restart or Telegram delivery test. It must not be read as fresh provider validation of this candidate.
Remaining Gaps
Type-aware lint/typechecking and the repository-wide suite are not run locally under host constraints. No check limits or baselines were relaxed. New-head CI and maintainer contract acceptance remain required. Previous-head CI failures are not assumed fixed merely because the base changed.
AI-assisted implementation, review, and validation.