Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 2:31 PM ET / 18:31 UTC. ClawSweeper reviewWhat this changesThe PR restores accepted ACP model and configuration selections after reconnects and returns complete accepted control responses to embedded runtime callers. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open. This remains a necessary, focused repair: the current base lacks reconnect replay and accepted-selection reconciliation, while the rewritten head has targeted source changes, broad regression coverage, real-adapter evidence, and active maintainer involvement. Priority: P2 Review scores
Verification
How this fits togetherACPX stores selected ACP controls with the conversation record. When a client reconnects, the session runtime resumes or loads the backend session, reapplies compatible saved choices, then runs the next prompt or serves an embedded caller. flowchart LR
A[Saved session record] --> B[Reconnect or resume]
B --> C[ACP adapter controls]
C --> D[Accepted control response]
D --> E[Reconciled saved selections]
E --> F[Prompt and runtime caller]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the centralized reconnect and accepted-selection repair after the exact-head required checks complete. Do we have a high-confidence way to reproduce the issue? Yes. The supplied exact-head Codex and Claude adapter probes cover model switching, accepted sibling controls, fresh-process reconnection, and conversation continuity; source and regression tests map directly to those paths. Is this the best way to solve the issue? Yes. Centralizing accepted-response reconciliation and reconnect replay in the session owner avoids parallel state bookkeeping while preserving warm-session reuse. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e13174878468. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Added real OpenCode ACP resume evidence and corrected resumed-session diagnostics. @clawsweeper re-review |
|
Thanks @programmerlapar — I’m consolidating the reconnect repair here with the connected model/effort selection-state fix. Real Codex and Claude testing reproduced stale saved effort after a model switch. Codex also resumed the same conversation with a different model and effort, so restoring ordinary config alone is not sufficient for that adapter. The repair will restore an advertised saved model before config replay, preserve warm-session reuse, and persist the adapter’s accepted selections without pinning unrelated defaults. I’m validating an independently implemented rewrite against current main, with regression tests and real adapter sessions, before updating this branch. Your original resume-replay contribution and credit will be preserved. |
Restore saved model and valid config selections on genuine reconnects, reconcile complete acknowledgements, and preserve notification ordering through initialization, idle controls, and active turns. Do not reuse a client after failed preference restoration. Consolidates the resume repair with accepted model/effort persistence and returns the accepted snapshot to embedded consumers. Co-authored-by: Firmansyah Otoluwa <[email protected]>
cc3543f to
af319d3
Compare
|
The credited maintainer rewrite is pushed as af319d3; the PR body now records the root cause, consolidation, and exact-candidate proof. Clean AWS validation passed 965 tests plus the separate 140-test coverage run and docs checks. Final source-blind Codex/Claude validation passed all five behavior clauses: 52 complete adapter-matching control responses, six no-tool prompts, accepted effort adjustment/removal, real reconnect before prompting, unchanged session identity/history, unpinned defaults, and visible invalid-value rejection. Independent Codex autoreview is clean. All owned proof processes, isolated state, and leases are cleaned up. Thanks @programmerlapar for the original resume repair; your contribution is credited in the commit and changelog. The earlier diagnostics concern is addressed without logging arbitrary config values. Exact-head CI is the remaining landing gate. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Landed in 10a4cac from reviewed source af319d3. Exact-head CI is fully green, including mutation testing; this resolves the latest ClawSweeper review's remaining CI requirement. The clean-machine and live Codex/Claude proof is recorded above. The repair consolidates accepted-selection ownership and reconnect replay, removes 53 net production lines, and preserves the original resume contribution. Thanks @programmerlapar! |
What Problem This Solves
Switching models can change or remove reasoning-effort controls. ACPX saved the requested value instead of the adapter's accepted value, so a successful switch could leave a stale preference behind. A new ACP client also skipped saved model/config replay after
session/loadorsession/resume, even when the adapter resumed the same conversation with different defaults.This consolidates the reconnect repair from @programmerlapar with the accepted-selection repair, preserving contributor credit. Real Codex and Claude sessions reproduced the stale-selection behavior before the fix.
Why This Change Was Made
Session selection state now has one reconciliation path for explicit controls and replay: accept the complete config response, update only existing non-mode selections, and remove selections whose controls disappeared. Unselected backend defaults remain unpinned. Embedded
AcpxRuntime.setConfigOptionreturns the complete accepted response after saving it; third-party implementations of the public runtime interface may still return void.The reconnect owner restores the saved model before surviving config preferences on genuine new/load/resume connections. It reconciles stale values written by earlier versions against the model acknowledgement, including when the resumed model is already current. Warm reusable sessions do not replay. Explicit replacement controls can replace an obsolete saved selection without first replaying it.
The session owner also keeps notifications and acknowledgements in execution order and never pools a client whose preference replay failed. Initial, idle, active-turn, and reconnect paths share the repaired state ownership. Duplicate prompt-model replay, setter bookkeeping, and idle state mirrors were removed. Legacy
session/set_modereplay policy is unchanged.User Impact
Model switches preserve the conversation while accepted effort adjustments/removals survive reconnects. A failed replay stops visibly; a retry must reconnect and reapply preferences before prompting. No new operator configuration, environment variable, dependency, or storage schema is introduced.
Evidence
Verified source commit:
af319d35bb8730b472c4525edc6d3a6c8a3fb39e. Its patch is byte-identical to the reviewed and tested candidate. Production: +368/-421 (net -53); tests: +877/-239 (net +638). Documentation and changelog are separate.pnpm run check && pnpm run check:docspassed on clean Linux/AWS after a frozen dependency install: 965 tests, then 140 coverage tests. The configured coverage target passed at 95.06% lines/statements, 88.81% branches, and 96.63% functions; this is not whole-repository coverage. Crabbox run, leasecbx_f049840dc24d, verified released.Real Codex ACP 1.6.0 and Claude ACP 0.60.0 ran against the built candidate (
runtime.jsSHA-256e9c701679be30172cd623325d976e741deb068f08f4bd43762f963fde334146b). Independent, source-blind probes exercised model switching, complete accepted responses, saved state, untouched defaults, invalid values, and genuine reconnects. Six no-tool prompts completed; 52 control responses matched the complete real adapter response. Codex Sol → Luna adjusted selectedultrato accepted/savedmedium; Claude Sonnet → Haiku removed effort and its saved preference. Fresh processes resumed the same backend identities and restored selected settings before prompting; marker recall confirmed conversation continuity. Higher efforts were selected only for control probes, never used for inference. Isolated state, native processes, and the credential task window were removed.Earlier clean-machine attempts were blocked before tests by an undersized image disk and unsupported local Actions hydration. The final run used the same configured AWS provider with a supported disk size and an explicit frozen install. No assertions, deadlines, or test-cache settings were weakened. The existing ineffective dynamic import warning in
output/render.tsremains unchanged.Dependency inspection includes the real Codex and Claude ACP adapter control handlers and Codex
rust-v0.149.1codex-rs/app-server/src/request_processors/turn_processor.rs:776(omitted effort is not an explicit clear).Review Follow-through
The prior ClawSweeper review requested maintainer review and real resume proof; both are supplied above. This maintainer rewrite broadens the repair only within session selection/reconnect ownership. Diagnostics now say “ACP session” on both fresh and resumed paths; replay logs do not print arbitrary config values. Fresh ClawSweeper review is requested for the rewritten head, and exact-head CI remains a landing gate.