Skip to content

fix(codex): resume remote conversations after instruction changes - #149647

Merged
sjf-oa merged 5 commits into
mainfrom
sjf/claw-2-remote-config-refresh
Sep 16, 2026
Merged

sjf-oa merged 5 commits into
mainfrom
sjf/claw-2-remote-config-refresh

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

A persistent conversation on a remote Codex app-server can stop before inference after OpenClaw instructions change. The refresh path rejects remote transports even when the existing connection can unsubscribe and resume the same native thread.

Change

Allow ordinary configuration refresh over WebSocket, Unix-socket, and stdio-proxy connections using the existing unsubscribe-and-resume flow. Preserve the native conversation ID and history, verify that the original client remains current and the thread is idle, require confirmed native unload, and install the current developer policy before admitting the next turn. Manual thread adoption retains its separate local-process requirements.

Ownership contract

OpenClaw must be the sole lifecycle owner of the native conversation, including when the gateway owns an app-server running remotely. Independent clients that can reload the same conversation during unsubscribe/resume are outside this supported contract. The connection and unload checks do not provide an atomic handoff between competing clients.

The maintainer decision is to retain this sole-owner design. Supporting independent competing owners, including native effective-configuration attestation or an atomic handoff, is outside this fix. The conversation ID remains unchanged.

Validation

  • 373 tests passed across thread-lifecycle.binding.test.ts and shared-client.test.ts.
  • Regression coverage exercises instruction replacement and withdrawal, unchanged warm reuse, active turns, missing unload confirmation, retired connections, policy-write errors, and binding failures across local and remote transports. The warm-refresh cases verify unsubscribe and resume use the original conversation ID.
  • Extension source and changed-test TypeScript checks passed.
  • Local execution used the 2026.9.4 compatibility baseline with the published changes applied. Current-main test setup requires @openclaw/[email protected]; the local environment's dependency-age policy prevents installing that version, so this is not a claim of a local current-main suite pass.
  • No live gateway rollout was performed.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@sjf-oa sjf-oa changed the title fix(codex): refresh remote conversations with configured successors fix(codex): recover remote chats after instruction changes Sep 16, 2026
@sjf-oa sjf-oa changed the title fix(codex): recover remote chats after instruction changes fix(codex): resume remote conversations after instruction changes Sep 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 7:27 PM ET / 23:27 UTC (Revision 3).

ClawSweeper review

What this changes

Allows existing remote Codex conversations to refresh instructions without changing conversation IDs, with transport regression coverage and ownership documentation.

Merge readiness

✅ Ready for maintainer review

This remains useful: main and the latest release still reject ordinary remote refresh. No blocking defect remains within the documented sole-owner contract; the previous competing-client finding is resolved by the explicitly accepted scope limitation, not by an atomic-handoff fix.

Priority: P2
Reviewed head: 5a06d33d04f5cb253ecd1c1d7d62e097e3d37368

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with meaningful regression coverage and an explicit, accepted deployment boundary; no remaining blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified maintainer-author exemption applies. The captured validation exercises the production lifecycle through mocked RPC responses; it does not establish a live remote refresh or native compaction result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified maintainer-author exemption applies. The captured validation exercises the production lifecycle through mocked RPC responses; it does not establish a live remote refresh or native compaction result.
Evidence reviewed 9 items Introduced production change: The pinned merge-base comparison changes ordinary resume from native-process ownership to thread-configuration lifetime. Manual adoption retains its native-process check; host authority, cancellation, active-thread checks, and observed-unload validation remain.
Current main still needs the change: Inspected fetched main's resume preparation and client-lifetime implementation: ordinary refresh still requests native-process ownership, which rejects WebSocket, Unix-socket, and proxy transports.
Latest-release comparison: The supplied latest release, v2026.9.4, also requests native-process ownership for ordinary resume; the remote allowance is not already shipped there.
Findings None None.
Security None None.

How this fits together

The Codex plugin connects OpenClaw conversations to native Codex threads. When instructions change, its lifecycle owner checks the connection and thread, resumes the existing conversation, and installs the current policy before admitting another turn.

flowchart TD
  A[Existing conversation and current instructions] --> B[Codex lifecycle owner]
  B --> C{Connection current and thread idle?}
  C -->|No| D[Preserve conversation and refuse turn]
  C -->|Yes| E[Release subscription and resume same thread]
  E --> F{Native unload observed?}
  F -->|No| D
  F -->|Yes| G[Install current policy and admit turn]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +136, Docs +15. Total +151 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 2 6 6 0
Tests 4 563 427 +136
Docs 2 24 9 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 593 442 +151

Review metrics

None.

Technical review

Best possible solution:

Keep one guarded refresh path for local and remote conversations under OpenClaw's sole lifecycle ownership, preserving native history and manual-adoption restrictions.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: an ordinary remote conversation requiring cold or changed-policy resume reaches main's local-process guard and is refused before inference. No runtime reproduction was executed.

Is this the best way to solve the issue?

Yes, within the accepted sole-owner contract: the patch reuses the existing refresh owner and preserves its admission checks without introducing another conversation or configuration mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8d823fa50ce9.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified maintainer-author exemption applies. The captured validation exercises the production lifecycle through mocked RPC responses; it does not establish a live remote refresh or native compaction result.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 session-state: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repairs instruction-refresh failures for existing remote Codex conversations with a bounded lifecycle change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified maintainer-author exemption applies. The captured validation exercises the production lifecycle through mocked RPC responses; it does not establish a live remote refresh or native compaction result.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Mert Başar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-16T03:54:04.495Z sha 954894b :: needs changes before merge. :: none
  • reviewed 2026-09-16T23:15:52.895Z sha 3ea6f52 :: blocked before merge. :: [P2] Fence competing remote resumes before accepting configuration

sjf-oa pushed a commit that referenced this pull request Sep 16, 2026
…49647)

Backport-Of: #149647
Release-Target: sjf_openclaw_2026-09-04

Source-Commit: eb34617
Source-Commit: 954894b
@sjf-oa

sjf-oa commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@sjf-oa

sjf-oa commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@sjf-oa

sjf-oa commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

The maintainer has explicitly chosen to retain the sole-owner design after considering the competing-client finding. Commit 5a06d33 documents that contract in both remote policy-refresh guides.

The reported interleaving is valid when another independent client can reload the same native conversation. This PR supports remote app-servers whose native conversation lifecycle is owned exclusively by OpenClaw; competing owners are outside that contract. The documentation now explicitly states that observing unload is not an atomic reservation, and the PR does not claim safe refresh across independent competing clients.

The existing client-lifetime, active-turn, unload, policy-write, and binding guards remain unchanged, and unsubscribe/resume preserves the conversation ID. Supporting shared app-servers with competing owners would require a separate native handoff/attestation contract; the maintainer has declined that scope expansion here.

CI repairs so far are test-only: replacing a map spread and extracting the existing lifetime/policy-refresh cases while retaining the original suite setup and cleanup.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@sjf-oa
sjf-oa merged commit a3a961b into main Sep 16, 2026
108 of 109 checks passed
@sjf-oa
sjf-oa deleted the sjf/claw-2-remote-config-refresh branch September 16, 2026 23:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…enclaw#149647)

* fix(codex): refresh remote conversations with configured successors

* fix(codex): preserve remote conversations across policy refresh

* test(codex): avoid object spread in transport matrix

* test(codex): extract lifetime and policy refresh cases

* docs(codex): clarify sole-owner remote refresh contract

---------

Co-authored-by: Sarah Fortune <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants