Repository navigation
feat: discover OpenCode and Pi sessions on paired nodes - #106941
Conversation
|
Land-ready verification complete for head 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:
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 Known proof gaps: none for the view-only scope. Continue/archive remain intentionally unsupported. |
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed July 14, 2026, 12:44 AM ET / 04:44 UTC. Summary 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.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 861d1d5d53d6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2197, Tests +1293, Docs +42. Total +3532 across 20 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (6 earlier review cycles)
|
There was a problem hiding this comment.
💡 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".
| if (!isPiSessionCatalogPathAbsolute(resolved)) { | ||
| throw new Error("Pi session catalog requires absolute or home-relative storage paths"); |
There was a problem hiding this comment.
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 👍 / 👎.
42c26ee to
3604a6c
Compare
There was a problem hiding this comment.
💡 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".
| ? resolveConfiguredPath(customAgentDir, env) | ||
| : path.join(home, ".pi", "agent"); | ||
| const configuredSessionDir = | ||
| settingsSessionDir(path.join(process.cwd(), ".pi", "settings.json")) ?? |
There was a problem hiding this comment.
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 👍 / 👎.
3604a6c to
5a5e3f6
Compare
There was a problem hiding this comment.
💡 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 }; |
There was a problem hiding this comment.
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 👍 / 👎.
b1d2a6c to
93d6905
Compare
|
Merged via squash.
|
) * 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
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).opencode.sessions.list.v1andacpx.pi.sessions.list.v1; both catalogs listed the synthetic node-local session and read two transcript items. The runtime config schema exposedOpenCode Session CatalogandPi Session Catalog.Representative commands run on Testbox: