Skip to content

feat(subagents): add dismiss tool for stale running entries#43

Open
interpreteragent wants to merge 1 commit into
HazAT:mainfrom
interpreteragent:fix/subagent-dismiss-stale-status-20260430
Open

feat(subagents): add dismiss tool for stale running entries#43
interpreteragent wants to merge 1 commit into
HazAT:mainfrom
interpreteragent:fix/subagent-dismiss-stale-status-20260430

Conversation

@interpreteragent
Copy link
Copy Markdown
Contributor

Summary

Adds a subagent_dismiss tool for cleaning up stale subagent status entries from the parent session.

This covers cases where the child pane/session is killed outside the normal lifecycle, or a child gets stuck in a non-standard waiting/stalled state and never produces the normal sentinel/result. Today the widget can keep showing that child forever, with no parent-side way to forget it.

The new tool:

  • removes the selected running subagent from runningSubagents
  • aborts its watcher so no later subagent_result is emitted for the dismissed entry
  • updates the widget immediately
  • optionally closes the pane via closePane: true

I also added subagent_dismiss to the spawning: false denied tool set so child agents do not get parent-side subagent management tools.

Example

subagent_dismiss({ name: "Worker" })
subagent_dismiss({ id: "abcd1234", closePane: true })

Test plan

  • Added unit coverage for tool registration.
  • Added unit coverage for dismissing with and without closing the pane.
  • Ran bun build for pi-extension/subagents/index.ts and pi-extension/subagents/subagent-done.ts.
  • Ran bun build for test/test.ts.

No package-lock changes included.

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.

1 participant