Skip to content

fix(subagents): align investigator role wording - #523

Open
bkyssn wants to merge 1 commit into
openpi-dev:mainfrom
bkyssn:fix/514-investigator-role-contract
Open

fix(subagents): align investigator role wording#523
bkyssn wants to merge 1 commit into
openpi-dev:mainfrom
bkyssn:fix/514-investigator-role-contract

Conversation

@bkyssn

@bkyssn bkyssn commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Built-in explorer, reviewer, and advisor inherit the active parent child-tool surface in ordinary mode, but their role descriptions and child system-prompt addenda described them as read-only. This made the model-visible role purpose conflict with the [inherited-tools] capability class and the effective tools reported after spawn. Fixes #514.

Value

Parents can select investigator roles from wording that matches the capability boundary actually enforced by Pi and OpenPI. Explicit role allowlists and Plan Mode remain the places that create a read-only child boundary.

Approach

  • Remove read-only authority claims from the three built-in investigator role descriptions and system-prompt addenda.
  • Align the Subagents role reference with the existing inherited-tool contract.
  • Add a focused prompt contract that exercises capabilityClass() through the public roster, derives effective child tools with the existing helpers, and confirms spawn reporting excludes parent-only tools. It also keeps READ_ONLY_AGENT_TOOLS classified as read-only for explicitly bounded roles.

Validation

  • node --test --experimental-strip-types tests/extensions/subagents/prompt.test.ts — 14 passed.
  • node --test --experimental-strip-types tests/extensions/subagents/agent-types.test.ts — 22 passed.
  • node --test --experimental-strip-types tests/extensions/shared/child-session.test.ts tests/extensions/workflows/execute.e2e.test.ts — 42 passed.
  • bun run check — passed.
  • bun run test — failed in two pre-existing, independently reproducible Plan Mode renderer cases: tests/extensions/plan-mode/result-rendering.test.ts leaves OSC 8 terminal-link escapes in rendered text. This diff does not touch Plan Mode or rendering code.
  • Manual Pi TUI smoke — not run; the focused tests cover the model-facing role roster and spawn-result contract deterministically.

Impact

  • User-visible behavior: investigator role wording and the Subagents reference now match ordinary-mode inherited tools.
  • Model-visible context: the three child system-prompt addenda no longer claim a read-only capability they do not enforce.
  • Runtime/lifecycle and persisted config/data: none.
  • Compatibility: built-in implementer, custom roles that omit tools, explicit allowlists, parent-only exclusions, and Plan Mode restrictions retain their existing behavior.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area:subagents Subagent delegation, skills, or tests labels Sep 9, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at exact head cd359f2. Standards and Spec both pass with no actionable findings. The revised investigator wording now matches the runtime-enforced inherited-tool contract, while explicit allowlists and Plan Mode remain the real read-only boundaries. Focused contract tests and hosted CI are green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:subagents Subagent delegation, skills, or tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(subagents): explorer/reviewer described as read-only but inherit write/bash [under investigation]

2 participants