Skip to content

fix(codex): keep ordinary chats out of personal history - #149355

Merged
roboclaw-bot merged 5 commits into
mainfrom
openclaw/fix-codex-default-session-isolation
Sep 16, 2026
Merged

roboclaw-bot merged 5 commits into
mainfrom
openclaw/fix-codex-default-session-isolation

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes an issue where ordinary OpenClaw chats and background work appeared in personal Codex Desktop/CLI history when an existing native login silently selected the user home. It also completes detected-Codex setup for users who need an OpenClaw sign-in after isolating that home.

Why This Change Was Made

Runtime preparation, native-login discovery, model discovery, and setup now honor the existing agent-home default. Detected Codex reuses eligible OpenClaw credentials or invokes the existing OpenAI sign-in owner before verification. Saved credentials retain the selected runtime settings for retry, and cancellation cannot promote the route. No new credential import or refresh owner is introduced.

User Impact

Ordinary sessions stay isolated and durable, regardless of an existing native Codex login. Explicit appServer.homeScope: "user", native-session adoption, and supervision remain supported. No personal history is moved or deleted.

Users who relied on automatic native-login borrowing can select detected Codex in Model Setup to sign in, or use openclaw models auth login --provider openai. Existing explicit user-home settings remain unchanged; remove that setting to isolate ordinary sessions. A failed verification retains the saved sign-in for retry without another login.

Evidence

  • Original isolation regression reproduced: the deferred-auth/local-stdio path selected the user home instead of the agent home. The repaired connection test also checks the actual startup CODEX_HOME.

  • The setup P1 was reproduced at activation: guided sign-in was never called. The repaired activation suite passes 42 tests, including fresh/existing installations, saved credential reuse, cancellation, retry, and explicit native sharing. Plugin configuration tests: 63 passed.

  • Targeted fresh-thread continuity, canonical SQLite replay, stale-binding continuity, and supervised native ownership checks: 15 passed. Native auth, connection, catalog, and binding siblings also passed during the isolation repair.

  • Local build, core/core-test typechecks, formatting, targeted lint, and boundary/storage/auth guards passed. Final lint cleanup extracted the unchanged shared activation fixture and preserved the JSON persistence assertion rather than suppressing rules. The build passed before that mechanical cleanup; exact-head hosted CI is now green (run 35045457812).

  • Fresh independent autoreview of the substantive setup repair was scoped-clean through P2. Independent parent review also corrected the native catalog cache-isolation assertions.

  • Before/after setup screenshots are embedded in the linked comment and verified to render. Both real Control UI rendering scenarios pass with mocked Gateway replies and inert sign-in fixtures; this is not authenticated Desktop/OAuth proof. Screenshots were also delivered to the originating conversation.

  • CI follow-up: the real native-login auth-refresh worker fixture now opts into user-home sharing explicitly. The expanded suite passes 30 tests, including omitted/agent-scope isolation and user-scope login/logout. It uses the actual Codex CLI and isolated credential files with a synthetic API key, not a live provider account. Production code is unchanged by this follow-up.

Published head: 0b4bd0d95d6432b0ee576a8357bb1683d5c66e71; tree: 8cfd07c3d6be7ff19ae77b4982319afd97ec4ea6; adopted main base: 174bbf31b588d3483d6773ce420afcf13e9e8936. The five Codex commits are patch-identical to the previous public head (17941e0020a557d22a4d75dec103e96cb4641c22): the same 17-file delta, 842 additions and 378 deletions. Every task commit preserves the contributor co-author trailer.

The former exact-head CI failure (run 35039988603, job 104623127671) was reproduced on its exact tested merge and traced to the unrelated shared PR-wrapper fixture. The refresh adopts #149477, landed at 476fa7a270e4aeef5d485efaa7b92ae62341cd3c, from protected main rather than adding a competing patch. The actual main fixture retains exactly one dependency setup before the Node recorder, with the helper, guards, and assertions unchanged. The full wrapper suite passes 92 tests on adopted main and again on this candidate; the native-worker integration suite passes 30 tests on this candidate. No wrapper source or fixture change is part of the Codex delta.

Exact-head CI run 35045457812 completed successfully, including the required openclaw/ci-gate. Native preparation and merge completed; merged as 45bacfa7232f37b06dff315c2284bcbea82e5f69 on September 16, 2026 at 02:27 UTC. The latest completed ClawSweeper review examined exact head 0b4bd0d95d6432b0ee576a8357bb1683d5c66e71 at 2026-09-16 01:54:11 UTC and found no actionable code/security findings; it recommends accepting the bounded coverage. The existing owner acceptance of the documented sign-in transition and coverage remains in force. The authenticated-upgrade evidence assessment is recorded in the owner response: the existing home/auth owners and isolated source, activation, continuity, and real native CLI/store proof are reused; no real provider-account/OAuth upgrade was run.

Worked on by: @fuller-stack-dev

Team session: https://team.openclaw.ai/chat/roboclaw/dashboard/a87929a9-447d-48d1-9629-7f7bddcce417


View the OpenClaw implementation session

@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex size: S maintainer Maintainer-authored PR labels Sep 15, 2026
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-codex-default-session-isolation branch from bc5b692 to 0b4ce35 Compare September 15, 2026 19:16
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 15, 2026 19:18
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 15, 2026, 9:54 PM ET / September 16, 2026, 01:54 UTC (Revision 4).

ClawSweeper review

What this changes

Keeps ordinary Codex-backed chats in per-agent storage and connects detected-Codex setup to existing OpenAI sign-in, credential reuse, and saved-login retry flows.

Merge readiness

⛔ Blocked before merge - 4 items remain

The fix remains necessary, and the earlier sign-in finding is addressed. No new blocking code defect was found; the remaining judgment is whether the documented authentication transition has sufficient upgrade coverage.

Priority: P2
Reviewed head: 0b4bd0d95d6432b0ee576a8357bb1683d5c66e71
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful boundary coverage and no new blocking findings; the upgrade-confidence tradeoff remains explicit.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied member/bot authorship exempts this PR from the ordinary external-contributor proof gate. Inspected screenshots prove guided-control rendering, and reported native CLI/store runs cover login discovery; neither establishes authenticated OAuth upgrade continuity, which remains the explicit owner decision.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied member/bot authorship exempts this PR from the ordinary external-contributor proof gate. Inspected screenshots prove guided-control rendering, and reported native CLI/store runs cover login discovery; neither establishes authenticated OAuth upgrade continuity, which remains the explicit owner decision.
Evidence reviewed 9 items Introduced runtime correction: The pinned merge-base delta removes the implicit user-home override from connection preparation. The existing home-scope owner defaults ordinary harness connections to agent storage and retains explicit user scope and supervision.
Current-main necessity: Fetched main still allows native-login discovery when homeScope is omitted. The latest supplied release does not contain this native-auth module; no merged replacement establishing this PR's isolation behavior was identified.
Earlier setup finding addressed: Detected Codex now selects an eligible existing profile, checks configured credentials, or invokes stageProviderAuthCandidate before verification. Saved credentials retain Codex runtime settings; cancellation and final activation continue through the existing owner checks.
Findings None None.
Security None None.

How this fits together

The Codex plugin translates OpenClaw conversations into native Codex sessions. Its home and credential selection determines where conversation history lives and which account authenticates requests.

flowchart TD
  A[OpenClaw conversation] --> B[Home selection]
  B -->|Default| C[Per-agent Codex home]
  B -->|Explicit sharing| D[Personal Codex home]
  E[Model Setup] --> F[OpenAI sign-in or saved credential]
  F --> C
  C --> G[Native Codex session]
  D --> G
Loading

Decision needed

Question Recommendation
Is the existing setup, retry, continuity, and native CLI/store coverage sufficient to accept removal of implicit native-login borrowing? Accept the bounded coverage: Accept the documented transition using the existing owners and supplied boundary coverage, retaining the stated authenticated-upgrade limitation.

Why: The follow-up gives a substantive proportional-proof explanation, but the transition can interrupt existing authentication and no authenticated upgrade was exercised.

Before merge

  • Resolve merge risk (P1) - Installations relying only on implicit native-login borrowing will need OpenClaw sign-in or explicit personal-home sharing before ordinary chats authenticate.
  • Resolve merge risk (P1) - Authenticated provider-account upgrade and conversation continuity were not demonstrated end to end; the supplied coverage combines synthetic activation, continuity tests, native CLI/store checks, and mocked-Gateway rendering.
  • Complete next step (P2) - Record owner acceptance of the documented authentication transition and existing coverage, or supply focused authenticated upgrade evidence.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Source +41, Tests +412, Docs +11. Total +464 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 7 115 74 +41
Tests 9 709 297 +412
Docs 1 18 7 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 842 378 +464

Review metrics

Metric Value Why it matters
Production versus test growth Production net +41 lines; tests and support net +412 lines Production growth connects existing sign-in and retry owners; most growth supplies activation and rendering coverage.

Merge-risk options

Maintainer options:

  1. Accept the documented sign-in transition (recommended)
    An owner can accept the existing boundary coverage and the requirement for previously implicit native-login users to sign in through Model Setup.
  2. Pause for authenticated upgrade evidence
    Keep the patch intact while obtaining a redacted recovery and conversation-continuity demonstration from an affected installation.

Technical review

Best possible solution:

Retain per-agent isolation and guided Model Setup recovery, with explicit owner acceptance of the authentication transition and its bounded upgrade coverage.

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

Yes, from source: main's deferred-auth local-stdio path selects the personal home despite the canonical agent-home default. The connection regression covers that trigger; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the canonical home selector and existing sign-in/activation owners avoids competing credential logic; acceptance of the upgrade coverage remains a separate landing judgment.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This repairs a bounded Codex history-isolation problem and its setup recovery path.
  • merge-risk: 🚨 compatibility: Existing implicit native-login configurations change behavior and can require user action.
  • merge-risk: 🚨 auth-provider: Removing implicit credential borrowing changes which existing installations can authenticate ordinary Codex turns.
  • 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 supplied member/bot authorship exempts this PR from the ordinary external-contributor proof gate. Inspected screenshots prove guided-control rendering, and reported native CLI/store runs cover login discovery; neither establishes authenticated OAuth upgrade continuity, which remains the explicit owner decision.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied member/bot authorship exempts this PR from the ordinary external-contributor proof gate. Inspected screenshots prove guided-control rendering, and reported native CLI/store runs cover login discovery; neither establishes authenticated OAuth upgrade continuity, which remains the explicit owner decision.

Evidence

What I checked:

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record owner acceptance of the documented authentication transition and existing coverage, or provide the narrowly requested authenticated upgrade evidence.

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 (3 earlier review cycles)
  • reviewed 2026-09-15T19:24:10.792Z sha 0b4ce35 :: blocked before merge. :: [P1] Complete sign-in before verifying the detected Codex candidate
  • reviewed 2026-09-15T23:13:16.435Z sha 4d05846d46db54b1bfd3aba2ec5f24116988e1de :: blocked before merge. :: none
  • reviewed 2026-09-16T00:32:52.944Z sha 17941e0020a557d22a4d75dec103e96cb4641c22 :: blocked before merge. :: none

@roboclaw-bot

roboclaw-bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Setup recovery rendering proof (1280×900, light theme): the actual Control UI receives mocked Gateway responses for the formerly credential-free detected-Codex failure and the repaired guided sign-in. The code and URL are inert fixtures, not a live OpenAI login. Both browser scenarios pass; backend activation tests separately exercise saved OAuth credentials and promotion.

Before: verification fails without an OpenClaw credential.

Before: missing OpenClaw authentication

After: detected Codex uses the existing guided OpenAI sign-in controls before verification.

After: guided sign-in before verification

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Addressed the setup P1 in 4d05846d46db54b1bfd3aba2ec5f24116988e1de: detected Codex now reuses an eligible OpenClaw credential or completes the existing OpenAI sign-in flow before verification. Cancellation leaves the route unchanged, and a saved sign-in retains the Codex runtime settings for retry. Explicit native sharing remains opt-in.

Activation tests: 42 passed; plugin configuration: 63 passed; targeted continuity/native-ownership cases: 15 passed. Build, core/core-test typechecks, corrected-file lint, and remaining boundary/auth guards passed. The oversized activation fixture was extracted without dropping cases or adding suppressions.

The PR body is current and links inspected before/after screenshots, verified in the GitHub comment. They render the actual Control UI with mocked Gateway replies, not a live OAuth account. The requested isolation policy is retained; no personal history is moved or deleted.

@clawsweeper

clawsweeper Bot commented Sep 15, 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:

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

The native-worker CI failure is fixed in 17941e0020a557d22a4d75dec103e96cb4641c22; it was not retried as an infrastructure failure. The fixture now requests user-home sharing explicitly for the positive native-login case, while omitted and agent scopes retain negative coverage. The expanded suite passes 30 tests through the real Codex CLI/auth-refresh worker, with isolated credential files and a synthetic API key. Targeted lint, core-test typechecking, and the max-lines guard also pass. Production code is unchanged from reviewed 4d05846.

On the compatibility-proof request: no provider-auth protocol, storage-format migration, or retention implementation was added. The repair selects the existing agent-home bridge and existing OpenAI sign-in/activation owners. The activation/retry/cancellation, continuity, and native worker/store tests are the proportional evidence for this bounded default-selection repair. A real provider-account/OAuth upgrade exercise was not run and is not represented as completed; that confidence limitation remains documented. No personal credentials were borrowed for testing, and no personal history was moved or deleted.

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

The latest CI failure is in the shared PR-wrapper fixture, not the Codex delta. I reproduced the nine exit-1/expected-73 failures on the exact tested merge 80563e72b41e16b131b4dbe480ab42ca27200f88. A local, unpublished refresh onto main 653e15a3296a incorporates #149481 and #149488, but their combined fixture initializes dependencies twice and fails all 12 alias cases with EEXIST. The Codex commits remain patch-identical after that refresh; native-worker integration still passes all 30 cases.

Existing repairs #149561, #149562, and #149563 already cover this dependency, so I am not adding a competing wrapper patch here. A diagnostic one-call variant passes all 12 alias cases, including the three trust-refusal cases, without changing guards or assertions. #149561 and #149562 are alternatives: their diffs remove opposite initialization calls; combining both removals would leave no initialization. The adopted main revision must retain exactly one setup call before the recorder.

I will consume the verified upstream repair, rerun the affected checks, and then continue this PR through exact-head CI and native landing.

roboclaw-bot and others added 5 commits September 16, 2026 01:43
Use the canonical agent-home default for runtime, model discovery, and setup. Native login requires explicit user-home sharing; OpenClaw profiles and native supervision keep their existing ownership.

Co-authored-by: fuller-stack-dev <[email protected]>
OpenClaw-Publication: f69d37ae-c63a-4e9a-8953-6ed4d021c08f
Co-authored-by: fuller-stack-dev <[email protected]>
Use the existing OpenAI sign-in owner before verifying detected Codex, preserve saved credential retries, and cover activation, cancellation, and explicit native sharing.

Co-authored-by: fuller-stack-dev <[email protected]>
Keep native login/logout coverage for explicit user scope and prove omitted or agent-scoped homes remain isolated through the real auth-refresh worker.

Co-authored-by: fuller-stack-dev <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/fix-codex-default-session-isolation branch from 17941e0 to 0b4bd0d Compare September 16, 2026 01:47
@roboclaw-bot
roboclaw-bot merged commit 45bacfa into main Sep 16, 2026
206 of 208 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/fix-codex-default-session-isolation branch September 16, 2026 02:27
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
)

* fix(codex): keep ordinary chats out of personal history

Use the canonical agent-home default for runtime, model discovery, and setup. Native login requires explicit user-home sharing; OpenClaw profiles and native supervision keep their existing ownership.

Co-authored-by: fuller-stack-dev <[email protected]>

* fix(codex): keep ordinary chats out of personal history

OpenClaw-Publication: f69d37ae-c63a-4e9a-8953-6ed4d021c08f
Co-authored-by: fuller-stack-dev <[email protected]>

* test(codex): check catalog identity on the native scope

Co-authored-by: fuller-stack-dev <[email protected]>

* fix(codex): finish isolated setup sign-in

Use the existing OpenAI sign-in owner before verifying detected Codex, preserve saved credential retries, and cover activation, cancellation, and explicit native sharing.

Co-authored-by: fuller-stack-dev <[email protected]>

* test(codex): require explicit native home in worker fixtures

Keep native login/logout coverage for explicit user scope and prove omitted or agent-scoped homes remain isolated through the real auth-refresh worker.

Co-authored-by: fuller-stack-dev <[email protected]>

---------

Co-authored-by: fuller-stack-dev <[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 merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant