Skip to content

Fix RunPane Claude prompt submission#351

Open
parsakhaz wants to merge 2 commits into
mainfrom
issue-302-striderv-investigate
Open

Fix RunPane Claude prompt submission#351
parsakhaz wants to merge 2 commits into
mainfrom
issue-302-striderv-investigate

Conversation

@parsakhaz

@parsakhaz parsakhaz commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Closes #302.

This fixes the Claude direct-submit path in RunPane so runpane panels submit --text ... no longer writes prompt text plus CR as one blind terminal write when the target panel is a Claude composer. Pane now writes the text payload first, waits briefly for composer state, submits through the same verified composer path used by panels submit-composer --strategy auto, and reports whether submission was verified.

It also wires the same verified submit behavior into Claude panes create / panels create initial-input delivery after --wait-ready, so orchestrators get explicit initialInput status instead of treating a staged-but-idle prompt as started work.

Visual Overview

RunPane Claude submit before/after

Root Cause

The direct-submit and initial-input paths could leave Claude Code holding pasted text in its composer while RunPane reported success/readiness. The command-level result did not include a verification contract, so orchestrators could believe work had started even though Claude was idle with the prompt staged.

The existing submit-composer path already knew the per-agent submit sequence and could verify that the composer cleared. This PR routes Claude direct submit and Claude initial-input submit through that verified path instead of assuming a plain terminal Enter means the agent accepted the task.

Verification Contract

panels submit now returns submission verification fields for Claude panels:

  • strategy: "enter"
  • sequenceName: "enter-cr"
  • verifiedSubmitted: boolean
  • blocked when Pane detects an interactive prompt/update gate

Pane creation results now include:

  • initialInput.delivered
  • initialInput.submitted
  • initialInput.verifiedSubmitted
  • initialInput.strategy
  • initialInput.sequenceName
  • initialInput.nextCommand

The Node and Python wrappers now exit nonzero for unverified panels submit results and print blocked guidance when present.

Tests

Passed under Node v22.23.1:

  • pnpm --filter main exec vitest run src/ipc/runpane.test.ts (44 tests)
  • pnpm run test:runpane-contract
  • pnpm typecheck
  • pnpm lint (passes with existing warnings)

CI / Environment Notes

The local default node v26.4.0 cannot install this repo today because better-sqlite3-multiple-ciphers@12.6.2 fails to compile against Node 26 V8 APIs. The supported repo runtime used for verification was Homebrew Node 22. Vitest also prints existing main...HEAD git revision warnings during the focused IPC suite, but the suite completes successfully.

Codex QA Summary

Status: Passed automated QA with live-daemon limit (2026-07-21 17:25 PDT). Marker: qa-pr351-2026-07-21-pdt.

Validated under Homebrew Node v22.23.1:

  • Confirmed PR Fix RunPane Claude prompt submission #351 targets main from issue-302-striderv-investigate at d797ab797ad9db1439152e002ae47d3c0069e8b0; no review comments were present when tested.
  • Focused IPC suite passed: Claude panels submit uses separate verified composer Enter, Claude initial-input auto-submit still works, unverified Claude initial-input marks creation unsuccessful, Codex/non-Claude submit-composer and exact-byte paths remain covered by existing tests.
  • Contract/package checks passed: generated Node/Python RunPane contracts are up to date and agree; package smoke passed.
  • Wrapper checks passed: Node and Python panels submit keep legacy success behavior, surface verifiedSubmitted, and return nonzero plus blocked/next-command guidance when verification fails.

Limit: an isolated PR-code headless daemon with PANE_DIR=/tmp/pane-pr351-qa.lqchVF did not start because better-sqlite3-multiple-ciphers was built for Node ABI 127 while Electron required ABI 136. I did not run mutating live Claude-pane submissions against the installed daemon because it is Pane 2.4.29 on the real ~/.pane, not isolated PR code.

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

Copy link
Copy Markdown

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

ℹ️ 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 packages/runpane/src/localControl.ts Outdated
Comment thread contracts/runpane/contract.json
@parsakhaz

Copy link
Copy Markdown
Member Author

Codex PR Test Automation QA

Status: Passed automated QA with live-daemon limit
Marker: qa-pr351-2026-07-21-pdt
Run time: 2026-07-21 17:25 PDT
Target: PR #351 issue-302-striderv-investigate -> main, HEAD d797ab797ad9db1439152e002ae47d3c0069e8b0

What passed

  • PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm --filter main exec vitest run src/ipc/runpane.test.ts
    • 44 tests passed. Relevant coverage observed in test names includes Claude direct submit via separate verified composer Enter, Claude initial-input auto-submit for panes create / panels create, unverified Claude initial-input failure, Codex submit-composer blocked behavior, non-Claude Enter submit behavior, wait/readiness blocked fields, and exact-byte panels input behavior.
    • Known existing warning: several main...HEAD git revision warnings printed, suite still passed.
  • PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm run test:runpane-contract
    • Contract generated files were fresh; RunPane package built; Node/Python contract checks passed.
  • PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm typecheck
    • Full workspace typecheck passed for frontend, main, runpane, and shared.
  • PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm lint
    • Passed with existing warnings; no lint errors.
  • PATH=/opt/homebrew/opt/node@22/bin:$PATH pnpm run test:runpane-package-smoke
    • Node package pack/install smoke passed and Python wheel install smoke passed.
  • Additional mocked wrapper checks against built local sources:
    • Node runPanelsSubmit returns 0 and preserves legacy output when daemon result has no verification fields.
    • Node runPanelsSubmit returns 0 and prints verified when verifiedSubmitted: true.
    • Node runPanelsSubmit returns 1 and prints Could not verify, Blocked:, and Next: when daemon returns ok:false, verifiedSubmitted:false, and blocked guidance.
    • Python run_panels_submit matches the same three cases.
  • Read-only local-control context check:
    • node packages/runpane/dist/cli.js agent-context --command "panels submit" --json reports the documented distinction: panels submit is ordinary text plus Enter; exact byte workflows remain on panels input; response includes nextCommand for validation.

Daemon/live limits

  • Started an isolated daemon attempt with PANE_DIR=/tmp/pane-pr351-qa.lqchVF pnpm daemon:headless. Startup failed before daemon readiness because the installed native module was compiled for NODE_MODULE_VERSION 127, while Electron required NODE_MODULE_VERSION 136.
  • I intentionally did not run pnpm electron:rebuild during QA because the requested checks were focused under Node 22 and rebuilding would switch the local native module target to Electron mid-run.
  • The installed daemon is reachable only as Pane 2.4.29 against real /Users/parsas/.pane; PR code is wrapper 2.4.30. I used that only for read-only doctor/context visibility and did not create panes or submit text against real user state.
  • Therefore, live Claude Code composer submission and live Claude initial-input delivery were not exercised against a running PR-code daemon in this pass. The behavior is validated by the focused IPC tests and wrapper mocks above.

No product code was changed. Nothing was merged.

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.

panes create --initial-input-file / --prompt pastes into the Claude composer but never submits

1 participant