Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 018846e8cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review Addressed the exact-head Codex P1 in
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
maintainer update: the durable owner-boundary repair is now upstream at openclaw/acpx#522. the latest head here correctly stops metadata clearing when the local write fails. it still should not land as written, because ACPX #522 adds please keep this PR open. after the ACPX change is reviewed, merged, and published, this contributor branch can be updated to consume the upstream API with the exact runtime handle. @MoerAI's report and implementation direction remain credited. |
|
Codex review: found issues before merge. Reviewed August 26, 2026, 11:43 PM ET / August 27, 2026, 03:43 UTC. ClawSweeper reviewWhat this changesThe PR makes manual ACP close discard persistent state and adds a durable ACPX reset marker intended to force a fresh backend session after restart. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open, but block the current head: it repairs the reported current-main gap while retiring ACPX state through the wrong identifier. The member review already identifies the correct upstream owner-boundary path. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherACP close flows from the command handler through the session manager to the ACPX runtime and its persistent session record. That record determines whether the next persistent turn resumes an old backend session or starts a fresh one. flowchart LR
A[ACP close command] --> B[Session manager]
B --> C[ACPX runtime]
C --> D[Persistent ACPX record]
D --> E[Next persistent turn]
E --> F[Resume old session or start fresh]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +79. Total +110 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: After ACPX publishes its handle-based preparation API, pass the exact runtime handle through recovery, delete the local record-marker synthesis, and prove a restart with distinct sessionKey and acpxRecordId values. Do we have a high-confidence way to reproduce the issue? Yes. The PR body provides before-and-after three-process ACP traces, and current-main source confirms the command omits persistent discard; the remaining untested case is a distinct ACPX record ID. Is this the best way to solve the issue? No. The local wrapper should not synthesize ACPX-private state from a bare OpenClaw key; the upstream owner API must receive the exact runtime handle. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c1a55d44627. LabelsLabel changes:
Label justifications:
EvidenceWhat 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
|
|
Thanks — confirmed. I’ll keep #130601 open and will not extend the local ACPX-private persistence path further. After openclaw/acpx#522 is reviewed, merged, and published, I’ll update this branch to pass the exact runtime handle, remove the local marker synthesis, and add three-process restart proof where |
|
Closing this OpenClaw-side implementation in favor of the persistence-owner This branch synthesizes ACPX-private reset state and addresses records by the The linked OpenClaw issue should remain open until the owner repair is |
Closes #107487
What Problem This Solves
Summary
Fixes an issue where users who ran
/acp closeon a persistent ACPX session could have that same backend session resume after OpenClaw restarted. The command reported the session closed, but the persistent ACPX record remained reusable.Why This Change Was Made
Root Cause
src/auto-reply/reply/commands-acp/lifecycle.tsclosed manual sessions without requestingdiscardPersistentState.prepareFreshSessionwhen an ACP agent cannot implementsession/close.extensions/acpx/src/runtime.tsimplementedprepareFreshSessiononly with a process-local hidden-key set. That prevented reuse in the current process but did not survive restart.[email protected]already defines the durable contract: successful discard writesclosed: trueplusacpx.reset_on_next_ensure: true, and the next ensure refuses to reuse that record.Execution path:
/acp close->AcpSessionManager.closeSession-> unsupported backend close ->AcpxRuntime.prepareFreshSession-> persisted reset markerChanges
/acp closenow requests persistent-state discard.reset_on_next_ensuremarker used by successful upstream discard close, while retaining the existing process-local hide for the current process.Production delta is +48/-17 (+31 net). The growth is limited to two owner boundaries that cannot be expressed by existing state: the private durable ACPX reset marker path and precise propagation of an invoked preparation failure while preserving existing missing-plugin cleanup. Test delta is +86/-7.
User Impact
After
/acp close, the next persistent ACP turn starts a fresh backend session even when the agent does not supportsession/closeand OpenClaw restarts between the close and the next turn.Evidence
Real Behavior Proof
I ran the production
AcpSessionManager,/acp closehandler,AcpxRuntime, and real file session store against an external ACP stdio agent in three separate Node 24 OS processes (seed->close->resume). The agent advertisedsession/resumebut intentionally did not advertisesession/close. No runtime or manager mocks were used.mainbefore/acp closefake-session-001,acpx: {}fake-session-001,acpx.reset_on_next_ensure: truesession/resume(fake-session-001)session/new -> fake-session-002session/closenoticeBefore:
After:
This covers the
merge-risk: session-stateboundary in the original execution order and across a real process restart.Review failure-path proof used the same production setup with the actual ACPX sessions directory and record made read-only before close:
The failed durable write is visible and actionable, metadata is not cleared, and no reset marker is claimed. The old identity remains resumable because the close was not acknowledged.
Test
discardPersistentState: undefinedprepareFreshSessionstill resolved close withmetaCleared: truepnpm test src/auto-reply/reply/commands-acp.test.ts src/acp/control-plane/manager.test.ts src/gateway/server.sessions.reset-cleanup.test.ts extensions/acpx/src/runtime.test.ts -- --reporter=dot— 224 passedpnpm test src/acp/control-plane/manager.runtime-resume-state.test.ts src/acp/control-plane/manager.test.ts src/auto-reply/reply/commands-acp.test.ts extensions/acpx/src/runtime.test.ts -- --reporter=dot— 207 passedpnpm test:extension acpx— 253 passedpnpm build— passednode scripts/check-changed.mjs -- extensions/acpx/src/runtime.ts extensions/acpx/src/runtime.test.ts src/acp/control-plane/manager.runtime-resume-state.ts src/acp/control-plane/manager.runtime-resume-state.test.ts src/acp/control-plane/manager.test.ts src/auto-reply/reply/commands-acp/lifecycle.ts src/auto-reply/reply/commands-acp.test.ts— passedCodex contract check:
thread.rsdefines resume by thread ID.message_processor.rsdispatchesThreadResume.Risk
Changelog
Not added: repository policy keeps
CHANGELOG.mdrelease-generated for normal PRs.Notes