Skip to content

fix: close backend sessions on reset#228

Merged
dutifulbob merged 3 commits intomainfrom
fix/reset-closes-backend-session
Apr 7, 2026
Merged

fix: close backend sessions on reset#228
dutifulbob merged 3 commits intomainfrom
fix/reset-closes-backend-session

Conversation

@dutifulbob
Copy link
Copy Markdown
Collaborator

Summary

  • add runtime support for discarding persistent state by closing the live backend ACP session before marking the record closed
  • thread the new discardPersistentState flag through the public runtime contract and ACPX runtime manager
  • bump ACPX to 0.5.2 and document the reset fix in CHANGELOG.md

Why

OpenClaw bound ACP resets could look successful but silently reopen the same persistent backend session on the next turn. In practice that meant Claude/Codex channels could keep old context after reset even when the local binding had been rotated.

Validation

  • pnpm run typecheck
  • pnpm run build:test && node --test dist-test/test/runtime-manager.test.js dist-test/test/runtime.test.js dist-test/test/client.test.js
  • pnpm run build
  • pnpm run check:docs
  • node dist/cli.js --approve-all --timeout 120 claude exec "Reply with exactly ACPX_052_CLAUDE_OK and nothing else."
  • node dist/cli.js --approve-all --timeout 120 codex exec "Reply with exactly ACPX_052_CODEX_OK and nothing else."

Embedded manual proof

With OpenClaw linked to this local ACPX branch, I manually verified the live claude-1 bound session flow:

  • pre-reset probe replied as Claude
  • code reset returned {\"ok\":true}
  • the next prompt created a new acp_session_id
  • the saved session file no longer contained the pre-reset probe
  • the post-reset prompt answered with 1, proving only the new message was in context

@osolmaz osolmaz marked this pull request as ready for review April 6, 2026 23:17
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a466209f2

ℹ️ 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".

@dutifulbob dutifulbob merged commit bdd0f7a into main Apr 7, 2026
8 checks passed
@dutifulbob dutifulbob deleted the fix/reset-closes-backend-session branch April 7, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants