Skip to content

fix: isolated gateways list and open the operator's HOME Claude/Codex/OpenCode/Pi sessions - #122983

Merged
steipete merged 4 commits into
mainfrom
steipete/isolated-catalog-home
Aug 13, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/isolated-catalog-home

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a gateway running on isolated state — a custom OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH/OPENCLAW_HOME, a relocated home, or any named --profile (including the pnpm gateway:dev instance) — would surface and serve the operator's real external harness sessions from the process HOME: Claude Code, Codex, OpenCode, and Pi stores appeared in the Control UI sidebar's external session catalogs, and their transcripts were readable, continuable, archivable, and reopenable in terminals. Isolated dev/test gateways listed the human operator's private session titles; recordings made against them leaked those titles.

Why This Change Was Made

Maintainer decision: an isolated-state gateway must not inherit HOME. External session catalogs are an operator-machine feature; their process-HOME scans are only legitimate on the default install identity.

Enforcement is closed over the whole provider surface, not just listing:

  • allowsProcessHomeSessionScan() (src/config/paths.ts) — true only for the default profile on the existing default-install-identity fact; isDefaultInstallIdentity() keeps its host-service meaning unchanged.
  • Fail closed for unknown providers: in isolated state the registrar only admits catalog providers that declare supportsProcessHomeIsolation: true; legacy/third-party providers that cannot honor the contract are suppressed with a structured warning. All bundled providers declare it.
  • Every HOME-sensitive verb receives the isolation flag and rejects HOME-fallback local targets: list, read, continue (transcript import), archive (native-thread mutation), terminal open/start, and upstream-activity probes. Paired-node hosts keep working (node scans run in the node's environment), and explicitly rooted local stores keep working even when isolated — the named enablement path: CLAUDE_CONFIG_DIR, CODEX_HOME / appServer.homeScope: "agent", any non-empty OPENCODE_DB, and Pi's explicit session-dir settings.
  • One structured gateway warning records the suppression (external session catalog HOME fallback skipped: isolated state; configure an explicit root to enable) — an intentional non-outcome, not silence.

Default-identity gateways are completely unchanged. No new config keys, env vars, or protocol changes; the SDK additions are additive optional fields.

User Impact

Dev/test/profile gateways no longer display, read, or mutate the operator's private harness sessions. Multi-instance operators keep external catalogs by configuring explicit roots; the gateway warning names that path.

Evidence

  • Boundary regression tests fail pre-fix per guard: named-profile suppression at sessions.catalog.list (previously listed gateway:local), continue/archive rejection (previously accepted local targets), terminal-start guard (previously reached the local plan), legacy-provider registration suppression, and explicit-root listing while isolated (including CLAUDE_CONFIG_DIR and relative OPENCODE_DB). Focused runs: gateway/session-catalog + terminal + registrar + upstream-monitor (88 passed), bundled provider suites (285 passed), paths/config (138 passed).
  • Live dev-gateway before/after, recorded per the AGENTS.md video-proof policy. Both runs use an isolated OPENCLAW_STATE_DIR and a synthetic ~/.claude store seeded from test fixtures (private-project / demo-session-1 — no real data).

Before (current main): the isolated gateway lists the HOME store in the sidebar (CLAUDE CODE → private-project → demo-session-1):

catalog-leak-before.mp4

After (this PR, same inputs): no external catalog section; the gateway logs external session catalog HOME fallback skipped: isolated state; configure an explicit root to enable:

catalog-isolated-after.mp4
  • Codex upstream contract verified directly in ../codex source (CODEX_HOME → ~/.codex fallback at codex-rs/core/src/config/mod.rs; thread/list reads the configured store).
  • Production delta +~420/-~100 across core seam + four bundled providers; growth carries the privacy boundary (per-verb enforcement + capability contract) — a narrower diff would leave bypass verbs open, which review rounds proved concretely.
  • SDK baseline check, targeted oxfmt/oxlint, git diff --check clean; Codex autoreview iterated four rounds (registration-only → scan-time seam preserving node hosts → continue/archive guards → terminal verbs + fail-closed capability + CLAUDE_CONFIG_DIR) and the final round is clean.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: acpx extensions: anthropic labels Aug 13, 2026
@steipete
steipete marked this pull request as ready for review August 13, 2026 04:11
@steipete
steipete force-pushed the steipete/isolated-catalog-home branch from 5f6ae4e to 791a258 Compare August 13, 2026 04:16
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 13, 2026, 2:23 AM ET / 06:23 UTC.

ClawSweeper review

What this changes

This PR blocks isolated Gateway profiles from using process-HOME Claude, Codex, OpenCode, and Pi session catalogs while retaining explicit local roots and paired-node catalogs.

Merge readiness

⚠️ Needs maintainer review before merge - 8 items remain

Keep open: both prior P1 blockers remain, and the final unrelated Discord split conflicts with a newer main-branch solution.

Priority: P1
Reviewed head: 5ac15ae2104c434c5f4be79605a53e6c038a9412

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The recorded Claude proof is strong, but two P1 boundary and public-contract defects remain.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR body provides a redacted before/after isolated dev-Gateway recording with synthetic Claude data and a visible post-fix warning; it does not cover the remaining Unix Codex defect.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body provides a redacted before/after isolated dev-Gateway recording with synthetic Claude data and a visible post-fix warning; it does not cover the remaining Unix Codex defect.
Evidence reviewed 7 items Unix Codex bypass: The new local-access predicate marks HOME fallback only for stdio, while all catalog verbs rely on it.
Unix is user-home scoped: Current configuration rejects Unix transport unless its home scope is user, and the control test sends thread/list using that scope.
Missing SDK contract documentation: The public session-catalog SDK exports the new policy types, but the provider documentation still lists only the previous hooks and omits isolated-state behavior.
Findings 2 actionable findings [P1] Treat user-scoped Unix Codex control as HOME-sensitive
[P1] Document the isolated-session provider contract
Security Needs attention Unix Codex control bypasses session isolation: The stdio-only predicate allows the user-home Unix catalog path through all local session operations in an isolated Gateway.

How this fits together

Gateway session catalogs feed external CLI-session entries into the Control UI, continuation, archive, terminal, and upstream-monitor flows. Provider plugins resolve local or node-backed stores, while Gateway supplies the process-isolation policy.

flowchart LR
  A[Gateway profile and state] --> B[HOME isolation decision]
  B --> C[Session catalog registry]
  C --> D[Provider operations]
  D --> E[Control UI and terminal actions]
  D --> F[Local or paired-node stores]
Loading

Before merge

  • Treat user-scoped Unix Codex control as HOME-sensitive (P1) - The predicate only blocks stdio, but Unix transport is configured only with homeScope: "user" and the local control path issues thread/list through that user-scoped connection. The same predicate controls list, read, continue, archive, terminal, and monitor access, so an isolated gateway can still reach local Codex sessions. Reject this transport too unless a separate verified socket-root isolation contract exists, and add Unix coverage.
  • Document the isolated-session provider contract (P1) - The SDK now adds supportsProcessHomeIsolation and policy inputs to every local operation, while isolated registries suppress providers that do not declare the capability. The published session-catalog guide still documents only the previous hooks, so external providers have no upgrade contract. Document required verb coverage, explicit-root behavior, and isolated-state suppression.
  • Resolve security concern: Unix Codex control bypasses session isolation - The stdio-only predicate allows the user-home Unix catalog path through all local session operations in an isolated Gateway.
  • Resolve merge risk (P1) - An isolated gateway can still expose or act on user-home Codex sessions through Unix transport.
  • Resolve merge risk (P1) - Existing external session-catalog plugins are suppressed in isolated gateways unless authors discover and implement the new public contract.
  • Resolve merge risk (P1) - The branch is merge-conflicted with main's newer Discord test split and needs that unrelated commit dropped or reconciled.
  • Resolve merge risk (P1) - Production code grows +433/-98 for a bug fix; the provider-specific explicit-root semantics explain most of the growth, but the corrected boundary should avoid further duplicated policy.
  • Complete next step (P2) - This maintainer-owned, protected PR needs its branch conflict resolved and both concrete P1 findings addressed before another exact-head review.

Findings

  • [P1] Treat user-scoped Unix Codex control as HOME-sensitive — extensions/codex/src/session-catalog.ts:1450-1452
  • [P1] Document the isolated-session provider contract — src/plugins/session-catalog.ts:14-52
  • [high] Unix Codex control bypasses session isolation — extensions/codex/src/session-catalog.ts:1451
Agent review details

Security

Needs attention: The privacy boundary is incomplete because Unix Codex control remains outside the new HOME-isolation guard.

PR surface

Source +339, Tests +574, Generated 0. Total +913 across 55 files.

View PR surface stats
Area Files Added Removed Net
Source 22 438 99 +339
Tests 16 1113 539 +574
Docs 0 0 0 0
Config 0 0 0 0
Generated 17 17 17 0
Other 0 0 0 0
Total 55 1568 655 +913

Review metrics

Metric Value Why it matters
Production versus test delta production +433/-98; tests +1,118/-540; generated baselines +17/-17 The privacy repair spans Gateway and provider implementations; the positive production growth needs the complete cross-provider boundary justification.
Public provider contract 1 provider capability flag and 7 optional isolation-policy inputs added External providers that omit the new capability are suppressed in isolated gateways, so documentation and upgrade behavior are merge-critical.

Stored data model

Persistent data-model change detected: persistent cache schema: src/plugins/loader.runtime-registry.test.ts, serialized state: extensions/anthropic/session-catalog-registration.ts, serialized state: extensions/anthropic/session-catalog.test.ts, serialized state: extensions/anthropic/session-catalog.ts, serialized state: extensions/beam/src/session-catalog.ts, serialized state: extensions/codex/src/session-catalog.test.ts, and 22 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the isolation boundary (recommended)
    Drop the conflicting Discord split, reject user-scoped Unix Codex control in isolated state, and document the provider contract before merge.

Technical review

Best possible solution:

Rebase onto current main, drop the obsolete Discord split, gate user-scoped Unix Codex control, document the public provider contract and upgrade behavior, then add focused Unix coverage before rerunning exact-head validation.

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

Yes, by source: configure Codex app-server transport as Unix with its required user home scope, run an isolated Gateway, and request the local catalog; the stdio-only predicate permits that path. The review did not execute the scenario because this checkout is read-only.

Is this the best way to solve the issue?

No. The current approach is incomplete because it treats only stdio as HOME-sensitive and publishes the provider contract without its required documentation.

Full review comments:

  • [P1] Treat user-scoped Unix Codex control as HOME-sensitive — extensions/codex/src/session-catalog.ts:1450-1452
    The predicate only blocks stdio, but Unix transport is configured only with homeScope: "user" and the local control path issues thread/list through that user-scoped connection. The same predicate controls list, read, continue, archive, terminal, and monitor access, so an isolated gateway can still reach local Codex sessions. Reject this transport too unless a separate verified socket-root isolation contract exists, and add Unix coverage.
    Confidence: 0.97
  • [P1] Document the isolated-session provider contract — src/plugins/session-catalog.ts:14-52
    The SDK now adds supportsProcessHomeIsolation and policy inputs to every local operation, while isolated registries suppress providers that do not declare the capability. The published session-catalog guide still documents only the previous hooks, so external providers have no upgrade contract. Document required verb coverage, explicit-root behavior, and isolated-state suppression.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc2ed816bee4.

Labels

Label justifications:

  • P1: The current Unix Codex path defeats the core privacy boundary for isolated gateways.
  • merge-risk: 🚨 compatibility: The new public provider contract can disable existing external catalogs in isolated deployments.
  • merge-risk: 🚨 security-boundary: The intended operator-session isolation remains bypassable through Unix Codex control.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (recording): The PR body provides a redacted before/after isolated dev-Gateway recording with synthetic Claude data and a visible post-fix warning; it does not cover the remaining Unix Codex defect.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a redacted before/after isolated dev-Gateway recording with synthetic Claude data and a visible post-fix warning; it does not cover the remaining Unix Codex defect.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body provides a redacted before/after isolated dev-Gateway recording with synthetic Claude data and a visible post-fix warning; it does not cover the remaining Unix Codex defect.

Evidence

Security concerns:

  • [high] Unix Codex control bypasses session isolation — extensions/codex/src/session-catalog.ts:1451
    The stdio-only predicate allows the user-home Unix catalog path through all local session operations in an isolated Gateway.
    Confidence: 0.97

What I checked:

Likely related people:

  • steipete: Authored the isolation commit and the recent Codex catalog and Discord test-split work. (role: feature author and recent area contributor; confidence: high; commits: 531189b3583d, 909509a5db8d, 7c8f08a88ccc; files: extensions/codex/src/session-catalog.ts, src/plugins/session-catalog.ts, extensions/discord/src/send.creates-thread.test.ts)
  • xingzhou: Authored the thread-chunking change whose test layout is the subject of the separate Discord CI issue. (role: adjacent Discord test contributor; confidence: medium; commits: 329ed12fcffa; files: extensions/discord/src/send.creates-thread.test.ts)

Rank-up moves

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

  • Block user-scoped Unix Codex access for isolated Gateways and add focused coverage.
  • Document the public provider contract and upgrade behavior.
  • Rebase and drop or reconcile the obsolete Discord-only commit.

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-08-13T04:22:46.312Z sha 791a258b686260a74b818d8aeb372d7726097fbf :: found issues before merge. :: [P1] Document the isolated-session provider contract
  • reviewed 2026-08-13T05:18:38.131Z sha ea5f7f2eee02ccb022eab923b25560a8f5f4ffa2 :: needs changes before merge. :: [P1] Treat user-scoped Unix Codex control as HOME-sensitive | [P1] Document the isolated-session provider contract

@steipete
steipete force-pushed the steipete/isolated-catalog-home branch 3 times, most recently from 9cd7089 to ea5f7f2 Compare August 13, 2026 05:13
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Aug 13, 2026
@steipete
steipete force-pushed the steipete/isolated-catalog-home branch from ea5f7f2 to 5ac15ae Compare August 13, 2026 05:33
@openclaw-barnacle openclaw-barnacle Bot added the channel: discord Channel integration: discord label Aug 13, 2026
@steipete steipete self-assigned this Aug 13, 2026
@steipete
steipete force-pushed the steipete/isolated-catalog-home branch from 5ac15ae to 95da118 Compare August 13, 2026 07:35
@openclaw-barnacle openclaw-barnacle Bot removed the channel: discord Channel integration: discord label Aug 13, 2026
…ion catalogs

A gateway on isolated state (custom OPENCLAW_STATE_DIR/CONFIG_PATH/OPENCLAW_HOME,
relocated home, or any named profile) listed, read, continued, archived, and
reopened the operator's real Claude Code/Codex/OpenCode/Pi sessions from the
process HOME. External catalogs now require the default install identity for
process-HOME scans: every catalog verb receives the isolation policy and rejects
HOME-fallback local targets, unknown providers fail closed unless they declare
supportsProcessHomeIsolation, and one structured warning records the skip.
Paired-node hosts and explicitly rooted stores (CLAUDE_CONFIG_DIR, CODEX_HOME,
OPENCODE_DB, Pi session dirs) keep working; default-identity gateways are
unchanged.
@steipete
steipete force-pushed the steipete/isolated-catalog-home branch from 95da118 to 25c19cd Compare August 13, 2026 07:53
@steipete
steipete merged commit b54034d into main Aug 13, 2026
128 checks passed
@steipete
steipete deleted the steipete/isolated-catalog-home branch August 13, 2026 08:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…/OpenCode/Pi sessions (openclaw#122983)

* fix(sessions): isolated gateways no longer inherit HOME external session catalogs

A gateway on isolated state (custom OPENCLAW_STATE_DIR/CONFIG_PATH/OPENCLAW_HOME,
relocated home, or any named profile) listed, read, continued, archived, and
reopened the operator's real Claude Code/Codex/OpenCode/Pi sessions from the
process HOME. External catalogs now require the default install identity for
process-HOME scans: every catalog verb receives the isolation policy and rejects
HOME-fallback local targets, unknown providers fail closed unless they declare
supportsProcessHomeIsolation, and one structured warning records the skip.
Paired-node hosts and explicitly rooted stores (CLAUDE_CONFIG_DIR, CODEX_HOME,
OPENCODE_DB, Pi session dirs) keep working; default-identity gateways are
unchanged.

* fix(sessions): inject catalog HOME-isolation fact at registry construction

* chore(sdk): regenerate plugin API baselines after rebase

* chore(sdk): regenerate plugin API baselines after rebase
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: acpx extensions: anthropic extensions: codex extensions: opencode gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. plugin: beam Beam session sharing plugin proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant