Repository navigation
Add a Pi scenario driver and watch items read through a shell variable (refs #3748) - #3793
Conversation
Pragmatic code review (initial review)Recommendation: COMMENT. Net positive: the driver is small, follows the established driver shape, and its framing and shutdown follow Pi's RPC docs (LF-only framing, Requirements (issue #3748, Pi items)
Should fix before merge[Important] The Claude Code plugin has its own, unchanged copy of the parser. [Important] [Important] A failed run is recorded as a successful, empty turn. Variable expansion (
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: COMMENT (initial review; posted as a comment because GitHub blocks self-review states). No hard blockers; fix before merge: the Claude Code plugin's own copy of nodespaceInvocations is not updated, un-cancelled Bun.sleep timers keep the driver process alive until the turn deadline, and a failed Pi run is recorded as an empty successful turn. Full findings in the review comment above.
Review addressed (1b98739)Addressed
Not changed
Live: a second clean run on the revised driver passes all four cases and the process exits at the end of the run. Tests: skill 283, plugin 58, Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The parser change is the review's own suggestion applied to the second copy and tightened for |
…n the line (refs #3748) - scripts/eval/harness/pi.ts runs the scenario in one pi --mode rpc process, with the extension and skill this checkout's installer writes, loaded by path so Pi's own sign-in directory is left where it is. - trace.ts reads Pi's tool execution, message and extension UI records. - Found by the run: an agent that wrote id=<uuid>; nodespace node context $id was not watched, because the invocation's id was the text $id. A plain assignment earlier in the same line now supplies it; a prefix assignment and a variable set elsewhere are left as they are. Tests pin both. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (refs #3748) - The Claude Code plugin's copy of nodespaceInvocations gets the same variable resolution, so its column does not diverge from the others for a reason that is not the harness. A value that is still an expansion ($(...), a backtick, a name not set in the line) makes the name unknown instead of the text $. Cases pin both copies, including reassignment, chaining, a prefix assignment, export and command substitution. - pi.ts: one timer per wait, cleared on the way out (a pending timer kept the process alive); an assistant message that stopped on an error throws, so a failed sign-in is not an empty column; shutdown escalates to SIGKILL and waits; a caller's own PI_CODING_AGENT_DIR is kept; the agent directory's context files, templates and themes are off. - records() is exported and its framing is tested. Skipped: answering dialog extension_ui_requests (the extension only sets a status), stdin backpressure on the few small commands sent. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1b98739 to
123ecd0
Compare
Refs #3748.
What this adds
scripts/eval/harness/pi.ts: runs the harness scenario in onepi --mode rpcprocess (the extension keeps its watch state in-process, and a reload loses it). The extension and skill are the ones this checkout's installer writes, loaded by path with Pi's own discovery off; Pi's agent directory is not moved, so its sign-in is not copied.HARNESS_MODEL=<provider>/<model>names the model.run.tsandtrace.tswiring (Pi tool execution, message and extension UI records).id=<uuid>; nodespace node context $idwas not watched, because the invocation's id was the text$id. A plain assignment earlier in the same line now supplies it; a prefix assignment and a variable set elsewhere are left alone. Without the fix, the "task finished elsewhere" case was caught only by the CLI's version check at the write; with it, the plugin refuses the tool call and names the change.Pi results (Pi 1.2.0, openrouter sonnet, one clean run)
NodeSpace: Widget)Tests
bun run --cwd packages/skill test283 pass (the new test fails without the fix),bun run test:scripts1544 pass, scripts lint and typecheck clean. The Rust tiers oftest:changedcannot build in a fresh worktree here (llama.cpp / OpenSSL header); nothing Rust changed, and the gate runs them.🤖 Generated with Claude Code