Skip to content

Run the Pi and OpenCode plugins in their harnesses; refuse an empty NODESPACE_SESSION - #3691

Merged
malibio merged 2 commits into
mainfrom
issue-3684-run-pi-opencode-plugins
Oct 7, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-3684-run-pi-opencode-plugins

Conversation

@malibio

@malibio malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #3684.

Ran each plugin once in its real harness (Pi 1.0.4, OpenCode 1.18.35) against a daemon-registered session with NODESPACE_SESSION and NODESPACE_LAUNCHED_FOR set, using a scripted model.

  • Pi: task context arrives in the first request; the reported id is Pi's own and is accepted; the re-registered bash tool carries NODESPACE_WRITE_JOURNAL and no launch variables; a script write does not stop the session.
  • OpenCode: the same three checks hold. shell.env is merged over the process environment, so launch variables arrive blank, not absent.
  • Fix: the CLI took a blank NODESPACE_SESSION as a session id and the RPC failed with an empty id. report-harness-session now refuses an empty value like an absent one (unit test added; references/cli.md regenerated).
  • README records what was seen, corrects the OpenCode limit, and notes Pi 1.0.4 needs Node 22.15+ (or PI_OFFLINE=1).

Not observed: the ai-chat-pty node holding the harness id. A CLI-launched session has no node, and the daemon writes the id when the session ends; this needs a desktop-app launch.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Review: APPROVE (comment-only, self-authored)

Scope. One CLI parser change plus its test, a README section recording the Pi and OpenCode runs, a comment correction in the OpenCode plugin, and the regenerated references/cli.md. The change is atomic and net positive.

Requirements (issue acceptance criteria)

  • Pi: task context in the first request, reported id equals Pi's own session id, bash env has the journal variable and no launch variables, script write did not stop the session. Supported by requests-pi.jsonl and reports-pi.log. Partly overstated: the criterion says "the ai-chat-pty node holds Pi's session id". The run could not observe that (CLI-launched sessions have no node; the report returned node_id: null), and the README says so explicitly. That is honest, but the criterion is not met, so the PR description or issue should state it stays open or is waived rather than ticking it.
  • Pi env check: met.
  • Same three checks for OpenCode: met, with the same node caveat.
  • OpenCode merge vs replace and the blank-variable report: answered (merge), and the empty id is now refused locally. Met.
  • README says what was seen, and the disproved limit is corrected: met.

Findings

  • [Improvement] packages/skill/README.md (new run section): the sentence that the daemon writes the harness id to the node when the session ends is not something this run exercised. Attribute it to the daemon's design, or drop it.
  • [Improvement] packages/cli/src/commands/session.rs:102: the CLI has only one consumer of NODESPACE_SESSION (this arg; I grepped packages), so the empty-value change has no other blast radius. The new test covers only the explicit --session "" flag. The case the PR is really about is the env path. The OpenCode run covers it manually (reports.log, exit=2), so this is acceptable; consider one integration test in tests/it/launched_session.rs that runs the CLI with an empty variable if that is cheap.
  • Nit: the README quotes clap's message "a value is required for '--session'". That wording is clap's and will drift with versions; paraphrase.
  • Nit: packages/skill/plugins/opencode/nodespace.ts:146: the reworded comment line is longer than its neighbours; wrap it.

Standards check

No issue numbers in docs or code comments, no Sync-boundary wording, no suppressions, no compatibility code. references/cli.md matches the doc comment change.

Recommendation

Approve. No blockers; call out the unobserved ai-chat-pty criterion as unverified in the PR description.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Verdict: approve with minor improvements; see the comment above. The ai-chat-pty node criterion was not observed and should be called out as unverified.

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed

Addressed (4 of 4, no skips):

  • Added an integration test for NODESPACE_SESSION set to empty (the environment path, which is the actual bug); it fails with the fix removed.
  • README: the daemon's write of the harness id to the node is now attributed to its design, not to an observation.
  • README: paraphrased clap's message instead of quoting it.
  • Wrapped the long comment in the OpenCode plugin.

Acceptance criteria not observed: "the session's ai-chat-pty node holds the harness's session id" (Pi and OpenCode). A CLI-launched session has no node, so the report returned node_id: null. The reported id was verified instead (equal to the harness's own id, accepted by the daemon). The node write needs a launch from the desktop app, so that part of those two criteria stays open and I'll leave it unchecked.

test:changed passes.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: A test, README wording and a comment wrap; no product-code change since the reviewed commit.

malibio and others added 2 commits October 7, 2026 13:25
…nCode harness runs (closes #3684)

OpenCode's shell.env output is merged over the process environment, so the
launch variables can only be blanked there. The CLI took the blank
NODESPACE_SESSION for a session id and sent it to the daemon; it now refuses
an empty value like an absent one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- Integration test for NODESPACE_SESSION set to empty (fails without the fix)
- README: paraphrase the CLI's message; attribute the node write to the
  daemon's design instead of an observation
- Wrap a long comment in the OpenCode plugin

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@malibio
malibio force-pushed the issue-3684-run-pi-opencode-plugins branch from de06565 to 181eaad Compare October 7, 2026 11:25
@malibio
malibio merged commit 02c709d into main Oct 7, 2026
@malibio
malibio deleted the issue-3684-run-pi-opencode-plugins branch October 7, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the Pi extension and the OpenCode plugin once in their harnesses with a launch

1 participant