Repository navigation
fix: preserve ACP model switches and reply completion - #132040
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 7:40 PM ET / 23:40 UTC. ClawSweeper reviewWhat this changesCarries ACP backend-accepted control snapshots into persisted sessions and makes Gateway emit one post-delivery completion for ACP replies, with related Control UI lazy-loading and type-test-shard updates. Merge readinessThe branch has a coherent owner-boundary repair and no introduced source defect was found. Keep it open for human review until ACPX 0.13.2 and Codex ACP control semantics are checked directly and the stated exact-head runtime/CI gates finish. Priority: P1 Review scores
Verification
How this fits togetherACP model and thinking controls pass through the ACPX plugin to the ACP session manager, which saves what the backend accepted for later turns. Gateway chat dispatch then receives ACP replies, persists their transcript once, and publishes one terminal result to the Control UI. flowchart LR
A[ACP control command] --> B[ACPX runtime]
B --> C[ACP session manager]
C --> D[Persisted accepted options]
E[Gateway chat request] --> F[ACP reply dispatch]
F --> G[Transcript owner]
G --> H[One chat terminal]
Decision needed
Why: The patch changes compatibility-sensitive runtime and session behavior, while direct upstream ACPX and required Codex source inspection was unavailable in this reviewer environment. Before merge
Findings
Agent review detailsSecurityNeeds attention: No source-level authorization or secret-handling regression was found, but the ACPX dependency update could not be directly source-reviewed. PR surfaceSource +320, Tests +985, Docs +27, Config 0, Other +5. Total +1337 across 66 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Verify ACPX 0.13.2 and Codex control contracts against their upstream source, then complete the exact-head runtime and CI evidence before landing the canonical manager and Gateway ownership changes. Do we have a high-confidence way to reproduce the issue? Yes for the source-test path: the Gateway completion fixture drives cold and warm ACP dispatch and asserts one terminal and one transcript row pair; no tests were run under the read-only review policy. Is this the best way to solve the issue? Yes, conditionally: the source uses the canonical session and post-dispatch owners and removes redundant completion projection, but the upstream ACPX and Codex option contracts need direct verification before merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a49da4208bc8. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
444111b to
7b208b1
Compare
4f941a1 to
ef010dc
Compare
|
Final-head verification for the ACP model-switch and reply-completion repair at Exact-head CI passed, and the full build passed with the existing UI size limits. The PR body records the focused regression commands, red/green reproductions, broader owner/sibling tests, lint/type/cycle checks, and each CI repair. Real Codex and Claude Gateway runs completed six provider turns with zero tools. Sol → Terra preserved selected effort; Sonnet → Haiku removed unsupported effort. Both preserved the backend conversation and recalled an unresent fictional phrase after model switching and a full Gateway restart. Every turn produced exactly one correlated first terminal and one new user/assistant transcript pair. Root independently checked saved terminal/history records, not just the worker verdict. Both runs verified cleanup and unchanged artifact provenance. The real Chromium Control UI also passed: two composer-submitted Claude turns, Sonnet/low → Haiku/no-effort, one visible reply per turn, identical recall, and browser reload restoring exactly the same history without inference. The canonical backend has exactly two user and two assistant turns, zero tools, and stable conversation identity. All three screenshots and representative video frames were personally inspected; they contain only synthetic test data and ephemeral test paths/IDs. Authentication video was deleted, and browser/Gateway/state cleanup plus final provenance checks passed. The UI retry manifest is Known separate UI follow-up visible in the captures: the generic composer model/thinking picker does not project ACP backend controls. This proof uses visible The initial browser attempt used zero prompts and failed because the isolated HOME changed Playwright's installed-browser lookup. Only the temporary recorder's package-resolution timing changed; all product/build/dependency bytes, authentication, fresh browser profile, assertions, and deadlines remained unchanged. The new UI manifest differs from the CLI manifest in exactly those two proof files. Proof limitation: the Codex clamp clause remains explicitly blocked because no advertised public model pair exercises clamping within OpenClaw's existing effort allowlist. This is not reported as an unconditional Codex pass. Upstream ACPX has separate live clamp proof; end-to-end Claude effort removal is verified here. The latest ClawSweeper dependency-content concern and rank-up requests are addressed by personally inspected published ACPX 0.13.2 source/types, sibling Codex No OpenClaw release is part of this landing. The upstream dependency repair is already published as ACPX 0.13.2. acp-model-switch.mp4 |
|
Merged via squash.
|
* fix: keep ACP thinking aligned after model switches Carry published ACPX accepted control snapshots through the plugin boundary and reconcile selected thinking in the session owner. Preserve selectable pending thinking on automatic replay, persist accepted changes before later failures, and show effective thinking in command replies. Keep shipped optional-control replay and third-party void backends unchanged. * fix: give ACP replies one completion owner * fix: tighten ACP completion type boundaries * fix(ui): defer native chrome and recover rendered lazy surfaces * refactor(ui): separate native startup recovery tests * fix: preserve explicit reply completion ownership * test: consolidate ACP completion regression fixtures * chore(ui): refresh boot manifest after main integration * test: distinguish inbound ACP reply options * test(ui): target retargeted queue clicks deterministically * fix(ci): split UI test type graphs within the root budget



What Problem This Solves
Persistent ACP conversations could retain an obsolete thinking selection after switching models. OpenClaw discarded the backend's accepted config snapshot, so later turns or reconnects could replay a value that had been adjusted or removed.
/acpfeedback also omitted the effective thinking selection.Live testing exposed a second defect before any model switch: lifecycle completion and reply dispatch both finalized the same ACP turn, producing blank/duplicate chat finals and duplicate transcript pairs. The fix consolidates completion ownership instead of hiding duplicate events at the client.
Follow-up to #128169 and #128145. The shared ACPX repair landed in openclaw/acpx#519 and is published as ACPX 0.13.2.
Why This Change Was Made
The ACPX plugin remains a thin adapter. One generic manager helper reconciles only an already-selected thinking value against the accepted backend snapshot, preserves qualified model references, and never pins untouched backend defaults. Automatic replay preserves a still-selectable pending thinking request. Each accepted update is persisted before a subsequent control can fail, and configured bindings carry the returned model state into their thinking update. Existing void-returning third-party runtimes keep their shipped contract.
For completion, ACP offers its settled outcome and successful transcript receipt through the existing runtime-start callback. The Gateway must explicitly acknowledge ownership synchronously; ordinary observers, legacy return values, and asynchronous results cannot claim it. All forwarding wrappers preserve the full callback tuple and return value, and the redundant follow-up wrapper is deleted. Runtime lifecycle events still serve
agent.waitand session observers, while Gateway reply dispatch emits the single chat terminal after delivery hooks settle.The existing successful-write receipt identifies the canonical assistant row for media replacement. The shared user recorder prevents a second user row. The starting transcript session ID is captured before runtime work, and replacement targets are rejected visibly through the existing persistence guard. No database schema, serialized field, migration, config option, environment variable, protocol version, or default is added.
CI follow-through removes an inherited UI startup-size violation: native-only titlebar registration uses the existing lazy-element owner, and the obsolete update banner and its tests/CSS are deleted. A real failed-download test then exposed render-owned Retry doing nothing without a pending user action. The existing recovery flow now requires action persistence only when there is an action to replay. Native descriptors and browser tests are consolidated into existing modules; no size limit, assertion, or timeout is relaxed. The current update card is unchanged.
User Impact
Accepted thinking adjustments/removal survive later turns and Gateway restart.
/acpreports effective selections. Successful ACP turns produce one terminal reply and one user/assistant transcript pair, including after a model switch. Post-hook text, suppression, media, runtime failure, cancellation, timeout, and persistence failure remain distinct outcomes.Release-note context: ACP sessions keep selected reasoning aligned with accepted model switches, preserve conversation history, and avoid blank/duplicate completions and transcript rows.
Evidence
Final authenticated proof, before/after screenshots, and real Control UI video.
Verified head:
6c228b2d004751c9c7c0c55469e53a36f2d21a40, based on86a0b223142eb44d1d701cf2549ed64c429b7b12. Final full build and exact-head CI passed (pull_request, attempt 1, completed success). Authenticated Codex and Claude Gateway runs passed their executed checks, and the real Control UI passed its two-turn model-switch/reload flow. The explicitly unavailable Codex clamp clause is recorded below, not represented as a pass.dispatchInboundMessage. It failed 11 of 15 cases before the forwarding repair and passes all 15 afterward. Acknowledgement/routing regressions independently failed seven cases before repair. Full argument/return forwarding and exact synchronous ownership are covered across sibling wrappers.The live acceptance contract freezes the first terminal, rejects any second correlated terminal, verifies exactly one new user/assistant pair with an unchanged history prefix, replays the same request ID without inference, and checks memory after model switch and full Gateway restart. It does not accept later event overwrites, stale history, or increased deadlines as a pass. Isolated proof never uses the operator's Gateway or state.
Final-head CLI results: three real Codex turns and three real Claude turns, zero tool calls. Codex Sol/low → Terra/medium retained the same outer session, backend conversation, and ACPX record; invalid effort and unsupported live clearing were rejected without changing controls. Claude Sonnet/low → Haiku removed the effort control and cleared stored/desired thinking. Both recalled an unresent fictional phrase after switching and after a full Gateway process restart. Every inference had one first terminal and exactly one added user/assistant pair with the prior history unchanged. Both lanes exited successfully and verified owned-process/state cleanup plus unchanged provenance.
Codex's result is deliberately
executed-checks-pass-with-blocked-clause, not an unconditional pass: no advertised Sol/Terra/Luna pair exercises a clamp within OpenClaw's existing effort allowlist. The unsupportedultravalue was not added to OpenClaw or used to manufacture a passing witness. ACPX has separate upstream live clamp proof; Claude removal is proven end-to-end here.The CLI frozen manifest covers 14,407 files across 27 roots, including all built runtime/UI output, published ACPX, both adapters, native Codex, and all proof scripts. Manifest SHA-256:
b2a7c0c591be653768e6415f4edea854c65c10385824fde058ebe6a9ed81acc4. File-set SHA-256:7892b4c813fede3932688184330c0aa1aeb204b923fa2da3596376eddd2c9422. Build ID:2026.8.1-6c228b2d0047-2026-08-28T23-31-58.737Z. Root independently verified both descriptors before credentialed execution.The first UI attempt stopped before browser/authentication or inference: the proof script loaded Playwright after isolating HOME, so its browser registry pointed at an empty test cache. The temporary proof code now resolves installed Playwright before isolating HOME and passes that browser type to the recorder. Browser child environment, fresh profile/context, normal dashboard handoff, assertions, and deadlines are unchanged. A credential-free isolated launch passed; the retry used a fresh manifest and the two still-unused UI prompt slots, not a repeated CLI run. No product source or build output changed.
Final UI proof passed in real Chromium: normal dashboard handoff, actual composer submissions, advertised Sonnet/low → Haiku/no-effort, same backend conversation, two matching fictional replies, exactly one terminal and transcript pair per inference, and a real browser reload restoring unchanged history without inference. Final backend counts are two user/two assistant turns with zero tools. Root inspected all three screenshots, representative video frames, and saved receipts. The authentication video was deleted, all owned processes/state were removed, and final provenance remained unchanged. UI manifest SHA-256:
29bcdc48133202a1520b7d4a1045f4967187d95d26e4b12e28527fa4f6cc2e36; it differs from the CLI manifest only in the two recorder files. Eight total real provider prompts were used.Final repair/build commands (all passed):
The final build completed in 2m 5.7s with valid build-cache reuse. UI startup was 344,360 bytes gzip / eight requests, below the unchanged 345,947-byte limit.
Dependency proof was inspected directly, not inferred from wrappers: published ACPX 0.13.2
dist/runtime.js:1631-1655saves and returns the accepted response in both active and reopened control paths;dist/runtime.d.ts:528exposesSetSessionConfigOptionResponse. Installed runtime SHA-256 ise9c701679be30172cd623325d976e741deb068f08f4bd43762f963fde334146b, matching the upstream live-tested candidate and published registry integrity. Sibling Codex source atrust-v0.150.1/90854393966b21e9ebfd21b122334eb09a20c93dwas personally checked atturn_processor.rs:512-529,758,thread_processor.rs:210-266, andcatalog_processor.rs:240-258; model/effort forwarding and omission-not-clearing behavior are explicit. The existing native-version override is unchanged. Upstream proof also inspectedrust-v0.149.1.ClawSweeper's exact-head review (
6c228b2, 23:40 UTC) reports no introduced source defect. Its low-severity dependency-content concern and both rank-up requests are addressed by direct ACPX source/types and Codex source inspection recorded above, published-package integrity, green exact-head CI, and final-head Gateway/Control UI evidence. The review's serialized-state heuristic does not identify a schema change: the transcript receipt is ephemeral callback state, and persistence continues through existing canonical owners.Maintainer decision: accept the optional, void-compatible accepted-control result under the requested fix-and-land scope. This is the generic runtime-plugin owner boundary, not ACPX-specific core policy. The completion receipt is ephemeral callback state describing existing canonical writes, not a new persistent data model.
Production LOC: +524/-262 (net +262); tests/support +1189/-146 (net +1043); tooling +7/-2; docs +28/-1; metadata/lock +6/-6; generated boot manifest +2/-2. Pure finalizer/native-component moves are discounted. UI cleanup removes 37 net production lines. Remaining product growth supplies the missing accepted-result and acknowledged completion/receipt contracts. A second raw assistant projector would bypass delivery hooks; suppressing lifecycle entirely would break observers. Duplicate control policy, callback forwarding, and terminal emission have been consolidated.
CI failures were diagnosed, not waived: typed fixtures and a type-only import cycle were repaired; native UI startup size, shell/test line counts, and UI graph roots were reduced by deletion/consolidation. Two lint passes caught shadowed fixture parameters and an inferred callback type; these are corrected without suppression. The required second rebase conflicted only in the generated boot manifest, which was regenerated with the canonical isolated-capture tool.
The final browser CI shard exposed an inherited geometry assumption after #131909 moved queue items into transcript bubbles: click two at the removed row's old coordinates could miss every row. The test now targets the surviving sibling explicitly with native mouse down/up at click count two. Its exact event trace, remaining queue, and reconnect/drain assertions are unchanged; all four queue-edit cases pass. Playwright's implementation was checked directly:
click({ clickCount: 2 })would emit both clicks again, whilemouse.down/upforwards the exact count. This is a test-only correction, not a product or timeout change.Local validation also exposed an orchestration mistake: lint's plugin-declaration preparation overlapped SDK regeneration in the build. The whole-branch check passed all guards and type checks; the completed build passed, and all lint/style checks plus import-cycle checks then passed serially against settled artifacts (zero runtime value cycles). The failed overlapping command is not counted as a green gate.
CI on
085d155then found a newer-main compiler-graph limit failure: model-setup work added four roots to the combined UI pages/E2E graph, taking it from 720 to 724. The graph is now split at its existing directory boundary, with unique incremental caches and exact-once root coverage. The 720-root ceiling, five CI stripes, runner count, and concurrency stay unchanged. The existing stripe-partition test now also covers the actual five-stripe configuration; no test is excluded.Provenance limits: the old void-only runtime contract and dual-finalization branch reach this checkout's shallow-history boundary, so the first introducing PR is not established here. The incomplete completion handoff was introduced and repaired within this PR. UI obsolete-banner provenance is #127704 (
48a2b45fede5) and #124667; the render-owned retry gap was carried by #130988 (233f1f017202, Peter Steinberger author, GitHub committer). Human automation triggers are not established.Named Follow-ups
backendExtraseffort aliases is separate preference-migration work. Existing optional-rejection behavior is retained./acpacknowledgement text and canonical backend state, not that separate picker. ACP-aware composer projection remains follow-up work.