Repository navigation
fix: isolated gateways list and open the operator's HOME Claude/Codex/OpenCode/Pi sessions - #122983
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
5f6ae4e to
791a258
Compare
|
Codex review: found issues before merge. Reviewed August 13, 2026, 2:23 AM ET / 06:23 UTC. ClawSweeper reviewWhat this changesThis 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 readinessKeep open: both prior P1 blockers remain, and the final unrelated Discord split conflicts with a newer main-branch solution. Priority: P1 Review scores
Verification
How this fits togetherGateway 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]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The privacy boundary is incomplete because Unix Codex control remains outside the new HOME-isolation guard. PR surfaceSource +339, Tests +574, Generated 0. Total +913 across 55 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cc2ed816bee4. LabelsLabel justifications:
EvidenceSecurity concerns:
What 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
HistoryReview history (2 earlier review cycles)
|
9cd7089 to
ea5f7f2
Compare
ea5f7f2 to
5ac15ae
Compare
5ac15ae to
95da118
Compare
…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.
95da118 to
25c19cd
Compare
|
Merged via squash.
|
…/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
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 thepnpm gateway:devinstance) — would surface and serve the operator's real external harness sessions from the processHOME: 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.supportsProcessHomeIsolation: true; legacy/third-party providers that cannot honor the contract are suppressed with a structured warning. All bundled providers declare it.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-emptyOPENCODE_DB, and Pi's explicit session-dir settings.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
sessions.catalog.list(previously listedgateway: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 (includingCLAUDE_CONFIG_DIRand relativeOPENCODE_DB). Focused runs: gateway/session-catalog + terminal + registrar + upstream-monitor (88 passed), bundled provider suites (285 passed), paths/config (138 passed).OPENCLAW_STATE_DIRand a synthetic~/.claudestore 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
../codexsource (CODEX_HOME→~/.codexfallback atcodex-rs/core/src/config/mod.rs;thread/listreads the configured store).git diff --checkclean; 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.