Skip to content

fix(runtime): pass system prompts through private files - #647

Open
cookerpapa wants to merge 1 commit into
HenryLach:mainfrom
cookerpapa:fix/system-prompt-file
Open

cookerpapa wants to merge 1 commit into
HenryLach:mainfrom
cookerpapa:fix/system-prompt-file

Conversation

@cookerpapa

Copy link
Copy Markdown

Fixes #612. Refs #640, #642.

Runtime V2 puts the composed system prompt directly on argv. Large base templates and project overlays can prevent every worker in a batch from starting because of OS command-line limits.

Pass the prompt through a unique private file using pi's existing --system-prompt <file> support. This preserves replacement semantics for workers, reviewers and mergers. Keep the file for the child's lifetime, remove it after successful completion, and retain failed runs for diagnostics. Empty overrides keep their existing behavior.

History check: #365 added file transport to the legacy RPC wrapper. Runtime V2's host was introduced in #370 with inline prompt text; the old wrapper's workaround was not carried into that path. This uses pi's direct replacement flag, without the old append/@ workaround. Whole-argv preflight and doctor diagnostics requested in #642 remain separate work.

Validation on Node 24 / Linux:

  • Eight new real-child-process regressions pass; six fail on the original base, including a native spawn E2BIG with a 256 KiB prompt. Coverage includes all three roles, Unicode, paths with spaces, overlapping spawns, defaults, cleanup and failure retention.
  • Upstream CI test selection: 3,609 passed, no skips. Full suite: 4,104 passed, the same six Windows-path/base-agent lookup failures as the unmodified base. Upstream CI already excludes those files.
  • Typecheck, lint, format and documentation link checks pass.
  • Real pi 0.80.10 loads a 342,000-byte prompt through a 437-character argv with Taskplane loaded and /orch registered. The effective prompt matches the file plus pi's normal working-directory suffix. This startup/RPC smoke makes no model requests. Native Windows execution has not been run.

Base: 293d9a833ba685d4c2291a1d68e9b68b0271e00a.

This branch has not been deployed

No deployments
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.

Windows: worker spawn fails with ENAMETOOLONG when agent system prompt is large (passed via cmdline arg)

1 participant