Skip to content

bug: Runtime V2 ignores standalone prompts and bypasses merger composition #619

Description

@daemons2000

Summary

TaskPlane 0.30.4 Runtime V2 does not consistently honor the documented agent-template contract:

  1. The worker spawn path ignores standalone: true and always composes the stock worker body with the local body.
  2. The reviewer bridge ignores standalone: true and always appends the local reviewer body to the stock body.
  3. The merger spawn path bypasses composition entirely and passes the raw local Markdown file, including frontmatter, as the complete system prompt.
  4. The canonical loader cannot find bundled templates when TaskPlane is installed by Pi under ~/.pi/agent/npm/node_modules/taskplane, because the package resolver does not try its own module-relative package root.

The exported loadAgentDef() helper already has the intended standalone/composition semantics, but the live Runtime V2 worker/reviewer/merger paths do not consistently use it.

This is related to #612: unintended worker composition increased one observed Windows worker prompt from 5,775 characters to 32,584 characters, reaching the Windows command-line limit discussed there. This report is about the ignored rendering contract rather than prompt transport.

Steps to Reproduce

  1. Install TaskPlane 0.30.4 through Pi so it resides under ~/.pi/agent/npm/node_modules/taskplane.
  2. Create .pi/agents/task-worker.md and .pi/agents/task-reviewer.md with non-empty bodies and standalone: true frontmatter.
  3. Create a non-standalone .pi/agents/task-merger.md containing concise project-specific guidance.
  4. Use Runtime V2 and inspect the system prompts constructed at the worker, reviewer, and merger spawn sites.
  5. Independently call the exported loadAgentDef() for the same files and compare its results with the live spawn paths.

Expected Behavior

  • Worker and reviewer prompts with standalone: true contain only their local bodies, with frontmatter removed.
  • A non-standalone merger prompt contains the stock merger body followed by the local body under the project-guidance separator.
  • Every Runtime V2 role uses one canonical parsing/rendering implementation.
  • Bundled templates resolve from TaskPlane's own installed module root, including Pi-managed package installations.

Actual Behavior

Observed with non-proprietary measurements from a real project:

  • Worker: 26,772-character stock body + 5,775-character local body rendered as 32,584 characters; standalone: true was ignored.
  • Reviewer: 10,856-character stock body + 3,205-character local body rendered as 14,098 characters; standalone: true was ignored.
  • Merger: the 600-character local Markdown file was passed verbatim, including frontmatter; the stock body was absent.
  • Supervisor composition worked correctly and provides a useful reference implementation.
  • Calling loadAgentDef() directly produced the correct standalone worker/reviewer results. For merger composition, its package lookup initially missed the Pi-managed TaskPlane installation until a module-relative package-root candidate was added.

The divergent paths are in:

  • extensions/taskplane/execution.ts (Runtime V2 worker prompt construction)
  • extensions/taskplane/agent-bridge-extension.ts (loadReviewerPrompt())
  • extensions/taskplane/merge.ts (merger system prompt construction)
  • extensions/taskplane/path-resolver.ts (bundled-template resolution)

Proposed Fix

  • Route worker and merger prompt construction through a shared canonical agent-definition loader.
  • Move reviewer parsing/rendering onto the same lightweight shared loader, or make its current loader honor standalone: true identically.
  • Add TaskPlane's module-relative package root as the first installed-package candidate in resolveTaskplanePackageFile().
  • Add Runtime V2 tests covering standalone worker/reviewer prompts, composed merger prompts, frontmatter stripping, and Pi-managed installation layout.

Acceptance Criteria

  • Worker standalone: true renders only the local body.
  • Reviewer standalone: true renders only the local body.
  • Non-standalone worker/reviewer prompts still compose stock plus local guidance.
  • Non-standalone merger renders stock plus local guidance and never includes raw frontmatter.
  • Bundled templates resolve when TaskPlane is installed under Pi's package directory.
  • All Runtime V2 role spawn paths use one tested rendering contract or equivalent shared implementation.
  • Existing bridge tools, reviewer authority, supervisor composition, and model/tool configuration remain unchanged.

Logs / Output

worker:   base=26772 local=5775 rendered=32584 standaloneHonored=false
reviewer: base=10856 local=3205 rendered=14098 standaloneHonored=false
merger:   rawLocal=600 containsStockBody=false startsWithFrontmatter=true

expected after compatibility fix:
worker:     rendered=5775 standalone=true
reviewer:   rendered=3205 standalone=true
merger:     rendered=7402 composed=true
supervisor: rendered=10809 composed=true

Relevant Config

taskRunner:
  worker:
    tools: read,write,edit,bash,grep,find,ls,aft_outline,aft_zoom,aft_inspect
  reviewer:
    tools: read,write,bash,grep,find,ls,aft_outline,aft_zoom,aft_inspect
orchestrator:
  supervisor:
    autonomy: supervised

Environment

  • TaskPlane: 0.30.4
  • Pi: 0.83.0
  • Node.js: 24.18.0
  • OS: Windows 11
  • Runtime: V2 subprocess mode

Pre-flight checks

  • Ran taskplane doctor successfully in the native environment.
  • Searched open and closed issues before filing.
  • Removed/redacted project-specific and sensitive information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions