Skip to content

feat: discover OpenCode and Pi sessions on paired nodes - #106941

Merged
steipete merged 13 commits into
mainfrom
codex/external-sessions-opencode-pi
Jul 14, 2026
Merged

steipete merged 13 commits into
mainfrom
codex/external-sessions-opencode-pi

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #106913

What Problem This Solves

OpenCode and Pi users could not discover or inspect prior sessions from the Control UI, especially when those histories lived on paired nodes. Codex and Claude had external-session support, leaving these two common runtimes outside the same workflow.

Why This Change Was Made

This adds plugin-owned OpenCode and Pi catalog providers on the existing generic session-catalog and paired-node seams. Both auto-detect by default, expose enabled-by-default settings through the existing schema-driven Control UI, and remain view-only; no new core runtime-specific policy or copied session state is introduced.

The OpenCode provider uses the upstream list/export CLI contracts. The Pi provider reads its upstream versioned JSONL format, applies the v1/v2 display migration during projection, bounds summary scanning, and caps full transcript reads at 32 MiB.

AI-assisted: implementation and review used Codex. I inspected the resulting code, upstream storage contracts, tests, and live behavior.

User Impact

Users now see local and paired-node OpenCode and Pi sessions in the existing sidebar and can open their transcripts. Operators can disable either catalog under the OpenCode or ACPX plugin settings in the Control UI. Continue and archive actions remain unavailable.

Evidence

Blacksmith Testbox: tbx_01kxf0st7k1hm2ce8b4nkzs1gr (Actions run).

  • Focused gateway, OpenCode, Pi, and UI E2E tests passed: 62 gateway, 13 Pi, 6 OpenCode, and 1 browser E2E test.
  • Full plugin lint passed.
  • Extension production and test type lanes passed.
  • Full production build passed.
  • Source-aware Codex autoreview rerun after fixes: clean.
  • Live user-path proof passed with a real Gateway and paired node. The node advertised opencode.sessions.list.v1 and acpx.pi.sessions.list.v1; both catalogs listed the synthetic node-local session and read two transcript items. The runtime config schema exposed OpenCode Session Catalog and Pi Session Catalog.

Representative commands run on Testbox:

pnpm test src/gateway/server-plugins.test.ts
pnpm test extensions/acpx/src/pi-session-catalog.test.ts extensions/opencode/session-catalog.test.ts
pnpm test:ui:e2e ui/src/e2e/external-session-catalogs.e2e.test.ts
pnpm lint:extensions
pnpm tsgo:extensions
pnpm tsgo:extensions:test
pnpm build

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime extensions: acpx plugin: file-transfer extensions: opencode size: XL maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete

steipete commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification complete for head 93d690548f8765391dda70e25b9d0e4725338846.

Exact-head hosted CI: run 29306110686. All feature-relevant jobs passed, including build, lint, production/test types, dependency guard, shrinkwrap, docs, UI, protocol, and session-boundary gates.

Blacksmith Testbox proof:

  • tbx_01kxf0st7k1hm2ce8b4nkzs1gr (run 29296338234): 62 gateway, 13 Pi, 6 OpenCode, and 1 Chromium UI E2E test passed; extension lint/types and full production build passed.
  • tbx_01kxfdwrx8fc3j80n8p1qwmq4f (run 29305894175): final post-review OpenCode and Pi catalog suites passed, 21 tests total.
  • tbx_01kxffzrmq565gmaxpfczcaff9 (run 29307405795): exact merged commit 05fb55eb7b555ec60214c86d2b07935814db0e90 built, then a real Gateway and paired node advertised all four OpenCode/Pi list/read commands; each catalog listed its node-local fixture and read two transcript items.
  • Fresh source-aware autoreview after the final commits: clean, no accepted/actionable findings.

Live before/after proof: before this PR, the external-session catalog had no OpenCode or Pi providers. The same real Gateway/paired-node scenario passed before merge and again on the exact landed commit. The live config schema exposed the enabled-by-default OpenCode Session Catalog and Pi Session Catalog settings.

Known proof gaps: none for the view-only scope. Continue/archive remain intentionally unsupported.

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

Copy link
Copy Markdown
Contributor

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: 926f678b4f

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

## Surface

skills
skills; session catalog: pi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Keep generated plugin surfaces in sync

This generated reference page now edits the ## Surface line by hand, but the inventory generator only emits channels/providers/contracts/skills there; I confirmed node scripts/generate-plugin-inventory-doc.mjs --check fails with docs/plugins/reference/acpx.md is stale. The same unsupported session catalog addition appears in the OpenCode reference page, so CI will keep failing or pnpm plugins:inventory:gen will strip these surface entries unless the generator/manifest surface model is updated or the catalog note stays only in the preserved manual section.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 14, 2026, 12:44 AM ET / 04:44 UTC.

Summary
Adds plugin-owned OpenCode and Pi read-only session discovery for the Gateway and paired nodes, including Control UI settings, documentation, tests, and a trusted-plugin node invocation scope change.

PR surface: Source +2197, Tests +1293, Docs +42. Total +3532 across 20 files.

Reproducibility: not applicable. as a bug reproduction: this is a new feature. The missing-current-main behavior and the branch's earlier live Gateway/paired-node demonstration establish the feature gap and intended flow.

Review metrics: 1 noteworthy metric.

  • Config and default surfaces: 2 settings added, 1 startup activation default changed. Both catalogs default to enabled and OpenCode now activates at startup, so maintainers need explicit fresh-install, upgrade, privacy, and operator-impact proof.

Stored data model
Persistent data-model change detected: migration/backfill/repair: docs/nodes/index.md, serialized state: extensions/acpx/src/pi-session-catalog.ts, serialized state: extensions/acpx/src/pi-session-paths.ts, serialized state: extensions/opencode/session-catalog-plugin.ts, serialized state: extensions/opencode/session-catalog.test.ts, serialized state: extensions/opencode/session-catalog.ts, and 4 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #106913
Summary: This PR is the active implementation candidate for the linked OpenCode and Pi paired-node session catalog feature issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix relative Pi environment-path resolution and restore generator ownership for plugin reference surfaces.
  • Obtain explicit maintainer approval or narrow the shared node-scope and default-discovery policy.
  • Rerun redacted real Gateway, paired-node, and Control UI proof on the exact final head.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR contains relevant live Gateway, paired-node, schema, and transcript output, but it is tied to head 926f678 rather than current head 93d6905; rerun the list/read and Control UI flow at the final head with private paths, hostnames, credentials, and transcript contents redacted, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] Merging the current Gateway change lets bundled or trusted official plugins replace a narrower request scope with their requested synthetic node scope; maintainers must confirm that this is the intended reusable authorization boundary, not merely a workaround for these catalogs.
  • [P1] Both catalogs are enabled by default, and OpenCode changes to startup activation, so upgrades can begin discovering local and paired-node transcript metadata that was previously invisible and can trigger node pairing command-surface upgrades.
  • [P1] The generated plugin reference pages will drift or lose the manually added Surface values when the inventory generator next runs.
  • [P1] The Pi catalog silently disappears for valid relative PI_CODING_AGENT_SESSION_DIR configurations.
  • [P1] The available live proof demonstrates an earlier head rather than the exact current head.

Maintainer options:

  1. Narrow the authorization contract before merge (recommended)
    Use an explicit session-catalog node-read authorization path, repair the two remaining defects, and prove fresh-install and upgrade behavior before landing.
  2. Accept and document the trusted-plugin boundary
    A maintainer may intentionally approve caller-scope replacement and default-on discovery, but should document operator access, pairing upgrades, and privacy implications first.
  3. Pause paired-node discovery
    If the shared authorization policy is not ready, keep the provider implementations but defer or disable paired-node/default-on behavior rather than merging an accidental security contract.

Next step before merge

  • [P1] A maintainer must first choose the shared authorization and default-discovery policy; afterward the contributor can address the two focused defects and refresh final-head proof.

Maintainer decision needed

  • Question: Should enabled-by-default external session catalogs be allowed to replace a narrower authenticated caller scope with plugin-requested synthetic node scopes when reading paired-node transcripts?
  • Rationale: The PR changes a shared Gateway authorization path and exposes previously undiscoverable transcript data by default; code review cannot decide the intended operator/privacy boundary without maintainer intent.
  • Likely owner: steipete — They own the linked feature direction and are the strongest available routing candidate for the external-session and Gateway scope policy.
  • Options:
    • Narrow and approve the read seam (recommended): Keep the catalogs but introduce or use an explicit trusted session-catalog node-read path with documented operator access and default-discovery behavior instead of broadly changing all runtime.nodes.invoke calls.
    • Approve the shared escalation: Accept the forceSyntheticClient behavior for all bundled and trusted official plugin node invocations, document that trusted plugins may replace caller scopes, and explicitly approve default-on transcript discovery.
    • Ship opt-in or local-only first: Avoid the shared scope change by making paired-node discovery or both catalogs opt-in until a narrower authorization contract is designed.

Security
Needs attention: The implementation avoids obvious command injection and bounds transcript reads, but its shared trusted-plugin scope substitution and default-on transcript discovery require explicit security-boundary approval.

Review findings

  • [P2] Resolve relative Pi session-dir environment overrides — extensions/acpx/src/pi-session-paths.ts:70
  • [P2] Keep generated plugin surfaces generator-owned — docs/plugins/reference/acpx.md:18
Review details

Best possible solution:

Keep the plugin-owned catalog design, but fix Pi relative environment resolution and generated-doc ownership, obtain explicit approval for a narrowly documented trusted node-read authorization/default-discovery policy, and rerun the Gateway, paired-node, and Control UI proof on the exact final head.

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

Not applicable as a bug reproduction: this is a new feature. The missing-current-main behavior and the branch's earlier live Gateway/paired-node demonstration establish the feature gap and intended flow.

Is this the best way to solve the issue?

No, not yet. Plugin-owned providers on the generic catalog seam are the right architecture, but the broad node-scope substitution, unresolved default/privacy policy, two remaining defects, and stale proof prevent this from being the best final implementation.

Full review comments:

  • [P2] Resolve relative Pi session-dir environment overrides — extensions/acpx/src/pi-session-paths.ts:70
    PI_CODING_AGENT_SESSION_DIR is still passed to resolveConfiguredPath without the available cwd base. A relative override such as .pi/sessions therefore throws and piSessionStoreAvailable() silently hides a valid Pi catalog; resolve this environment value relative to cwd, matching Pi's accepted relative session-directory contract.
    Confidence: 0.97
  • [P2] Keep generated plugin surfaces generator-owned — docs/plugins/reference/acpx.md:18
    This generated reference page still adds session catalog: pi directly to the ## Surface line, but the inventory generator does not own or reproduce that field; the OpenCode reference has the same problem. Update the generator/manifest surface model or leave this information only in the preserved manual section so regeneration does not strip it or report drift.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The feature closes a meaningful workflow gap, but the remaining defects and policy decision have limited rather than emergency impact.
  • merge-risk: 🚨 compatibility: The PR adds enabled-by-default settings, changes OpenCode startup activation, and can trigger new paired-node command approvals for existing installations.
  • merge-risk: 🚨 security-boundary: The Gateway change permits trusted plugin-requested synthetic node scopes to replace a narrower authenticated caller scope while exposing transcript data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR contains relevant live Gateway, paired-node, schema, and transcript output, but it is tied to head 926f678 rather than current head 93d6905; rerun the list/read and Control UI flow at the final head with private paths, hostnames, credentials, and transcript contents redacted, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +2197, Tests +1293, Docs +42. Total +3532 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 12 2207 10 +2197
Tests 4 1293 0 +1293
Docs 4 46 4 +42
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 3546 14 +3532

Security concerns:

  • [medium] Confirm caller-scope replacement for node invocation — src/gateway/server-plugins.ts:710
    Setting forceSyntheticClient whenever trusted plugin scopes are present lets a bundled or trusted official plugin replace a narrower authenticated request scope with its requested node scope. This is a shared authorization-contract change, not only an OpenCode/Pi implementation detail, and should be narrowed or explicitly approved and documented.
    Confidence: 0.96

What I checked:

  • Current main lacks the requested catalogs: Current main documents and implements external catalogs for Codex and Claude, while the OpenCode and Pi providers are introduced only by this PR; the feature remains necessary. Public docs: docs/nodes/index.md. (docs/nodes/index.md:421, 861d1d5d53d6)
  • Correct owner boundary: The branch registers OpenCode and Pi catalogs from their owning bundled plugins through the existing plugin SDK session-catalog and node-host seams rather than adding runtime-specific scanners to core. (extensions/opencode/index.ts:154, 93d690548f87)
  • Generated documentation remains hand-edited: The current head still adds an unsupported session-catalog value to a generated plugin reference Surface line, despite docs policy identifying this page as generator-owned; the same issue exists in the OpenCode reference. Public docs: docs/plugins/reference/acpx.md. (docs/plugins/reference/acpx.md:18, 93d690548f87)
  • Relative Pi environment override remains broken: The final head still resolves PI_CODING_AGENT_SESSION_DIR without passing the available cwd base, so relative overrides are rejected and the catalog silently disappears; this prior finding was not addressed by the final ID-validation commits. (extensions/acpx/src/pi-session-paths.ts:70, 93d690548f87)
  • Upstream Pi path contract: Pi documents relative session directories and gives PI_CODING_AGENT_SESSION_DIR precedence over settings, so the catalog must follow Pi's relative-path behavior rather than treating an otherwise valid store as unavailable. (extensions/acpx/src/pi-session-paths.ts:70, 93d690548f87)
  • Authorization boundary changed: The branch forces a synthetic client whenever a bundled or trusted official plugin requests node scopes, allowing those requested scopes to replace a narrower authenticated caller scope; the added test explicitly exercises operator.read becoming operator.write. (src/gateway/server-plugins.ts:710, 93d690548f87)

Likely related people:

  • steipete: The linked issue and this implementation come from @steipete, and recent current-main transcript/session work also identifies them with this product area; they are the best available routing candidate for the scope and default-policy decision. (role: feature owner and recent area contributor; confidence: medium; commits: 019aa679eae5, 292adff1f4ae, 93d690548f87; files: src/gateway/server-plugins.ts, docs/nodes/index.md, extensions/opencode/session-catalog-plugin.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (6 earlier review cycles)
  • reviewed 2026-07-14T00:51:12.953Z sha 926f678 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-14T01:35:55.241Z sha 42c26eeb3800e8f00e49d54052d8b5ed1b9323c4 :: needs real behavior proof before merge. :: [P2] Resolve relative Pi sessionDir settings | [P2] Keep generated plugin surfaces generator-owned
  • reviewed 2026-07-14T02:00:53.813Z sha 42c26eeb3800e8f00e49d54052d8b5ed1b9323c4 :: needs real behavior proof before merge. :: [P2] Resolve settings-relative Pi session directories | [P2] Keep generated plugin surfaces generator-owned
  • reviewed 2026-07-14T03:13:24.025Z sha 3604a6c85df1f315ecdb01df700d0f970ef536fb :: needs real behavior proof before merge. :: [P2] Resolve Pi sessionDir relative to its settings file | [P2] Keep generated plugin surfaces generator-owned | [P2] Honor Pi project trust before reading project settings
  • reviewed 2026-07-14T03:55:42.252Z sha b1d2a6ce3b2e91d0a6c7504c19bda6f6bbc50da2 :: needs real behavior proof before merge. :: [P2] Resolve relative Pi session-dir environment overrides | [P2] Keep generated plugin surfaces generator-owned
  • reviewed 2026-07-14T04:24:09.747Z sha b1d2a6ce3b2e91d0a6c7504c19bda6f6bbc50da2 :: needs real behavior proof before merge. :: [P2] Resolve relative Pi session-dir environment overrides | [P2] Keep generated plugin surfaces generator-owned

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

Copy link
Copy Markdown
Contributor

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: ffc1dee7cb

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

Comment on lines +39 to +40
if (!isPiSessionCatalogPathAbsolute(resolved)) {
throw new Error("Pi session catalog requires absolute or home-relative storage paths");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Resolve Pi sessionDir relatives from settings files

When a user follows Pi's documented sessionDir settings contract with a relative value such as .pi/sessions, this branch throws and piSessionStoreAvailable() catches it as unavailable, so the Pi catalog never advertises or lists those existing sessions. Since the code just read the setting from a known settings.json path, resolve relative sessionDir values against that settings file's directory instead of rejecting them as unsafe.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. 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. labels Jul 14, 2026
@steipete
steipete force-pushed the codex/external-sessions-opencode-pi branch from 42c26ee to 3604a6c Compare July 14, 2026 02:43

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

Copy link
Copy Markdown
Contributor

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: 3604a6c85d

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

Comment thread extensions/acpx/src/pi-session-paths.ts Outdated
? resolveConfiguredPath(customAgentDir, env)
: path.join(home, ".pi", "agent");
const configuredSessionDir =
settingsSessionDir(path.join(process.cwd(), ".pi", "settings.json")) ??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Gate project Pi settings on Pi trust

When the Gateway is started from a checkout that contains .pi/settings.json but Pi has not trusted that project, this lookup still reads the project-local setting and lets it redirect the catalog to an arbitrary sessionDir. Pi's upstream Project Trust contract ignores project settings unless a saved/temporary trust decision (or defaultProjectTrust: "always") allows them, so OpenClaw can list/read sessions that Pi itself would not use for that project. Gate this project-settings read on the same trust/default decision, or fall back to the global settings file when the project is untrusted.

Useful? React with 👍 / 👎.

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

Copy link
Copy Markdown
Contributor

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: b1d2a6ce3b

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

): { root: string; flat: boolean } {
const customSessionDir = env.PI_CODING_AGENT_SESSION_DIR?.trim();
if (customSessionDir) {
return { root: resolveConfiguredPath(customSessionDir, env), flat: true };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Resolve relative Pi session-dir env overrides

When PI_CODING_AGENT_SESSION_DIR is set to a relative path such as .pi/sessions, Pi accepts it relative to the process cwd, but this call omits the available cwd base so resolveConfiguredPath() throws and piSessionStoreAvailable() reports the store as absent. In that configuration the new catalog silently disappears even though the PR docs say the env override is honored; resolve the env session dir against cwd just like project/global settings are resolved against their owning directory.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 14, 2026
@steipete
steipete force-pushed the codex/external-sessions-opencode-pi branch from b1d2a6c to 93d6905 Compare July 14, 2026 04:29
@steipete
steipete merged commit 05fb55e into main Jul 14, 2026
158 of 159 checks passed
@steipete
steipete deleted the codex/external-sessions-opencode-pi branch July 14, 2026 04:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

* feat(sessions): add opencode and pi catalogs

* fix(sessions): satisfy catalog lint

* fix(sessions): validate pi storage paths

* fix(sessions): index growing pi transcripts

* refactor(sessions): split pi path resolution

* docs(sessions): refresh catalog map

* refactor(sessions): privatize pi catalog internals

* fix(sessions): validate node catalog payloads

* fix(sessions): harden external catalog discovery

* fix(sessions): normalize catalog transcript data

* refactor(gateway): keep node scope gate compact

* fix(opencode): reject option-like session ids

* fix(sessions): align external id validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation extensions: acpx 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. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: discover OpenCode and Pi sessions on paired nodes

1 participant