HOMELAB-2321: fix(pi-swarm-suite): tell orchestrators ending the turn is safe #68

Open
aaron wants to merge 1 commit from plane/HOMELAB-2321-poll-loop-guard into main
Owner

Fixes the orchestrator busy-poll seen in the HOMELAB-2319 session: get_subagent_result(wait:false) was called 12 times in 5 min while a background teamlead ran. The model knew it shouldn't poll, but nothing told it that ending its turn was safe. The still-running reply even said "check back later".

Ticket: HOMELAB-2321

Changes (pi-swarm-suite/src/core/index.ts only)

  • The spawn reply, the still-running reply, the Agent tool usage notes and the prompt guidelines now say that the completion notification (triggerTurn: true) starts a new turn, so ending the turn is safe.
  • A status check repeated on the same running agent within 60s gets a firm "you checked Ns ago, stop checking, end your turn" reply. The wait: true path is unchanged.

Verification

  • tsc --noEmit passes.
  • vitest run: 106/106 files passed on 3 runs. One earlier run had 2 failures that didn't come back on any of the 3 reruns or on the baseline (looks flaky).
  • No existing test exercises the tool's execute path, so the 60s guard has no unit test.

Class: oversight path (agent tool prompt text). Needs the normal review.

🤖 Generated with Claude Code

Fixes the orchestrator busy-poll seen in the HOMELAB-2319 session: `get_subagent_result(wait:false)` was called 12 times in 5 min while a background teamlead ran. The model knew it shouldn't poll, but nothing told it that ending its turn was safe. The still-running reply even said "check back later". Ticket: HOMELAB-2321 **Changes** (`pi-swarm-suite/src/core/index.ts` only) - The spawn reply, the still-running reply, the Agent tool usage notes and the prompt guidelines now say that the completion notification (`triggerTurn: true`) starts a new turn, so ending the turn is safe. - A status check repeated on the same running agent within 60s gets a firm "you checked Ns ago, stop checking, end your turn" reply. The `wait: true` path is unchanged. **Verification** - `tsc --noEmit` passes. - `vitest run`: 106/106 files passed on 3 runs. One earlier run had 2 failures that didn't come back on any of the 3 reruns or on the baseline (looks flaky). - No existing test exercises the tool's `execute` path, so the 60s guard has no unit test. Class: oversight path (agent tool prompt text). Needs the normal review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
HOMELAB-2321: fix(pi-swarm-suite): tell orchestrators ending the turn is safe
All checks were successful
CI / pr-title (pull_request) Successful in 0s
CI / forgejo-ci (pull_request) Successful in 44s
CI / plane (pull_request) Successful in 57s
CI / pi-otel-telemetry (pull_request) Successful in 59s
CI / nats-intercom (pull_request) Successful in 19s
CI / mcp-bridge (pull_request) Successful in 22s
CI / skill-args (pull_request) Successful in 36s
CI / ask-user-question (pull_request) Successful in 34s
CI / refocus (pull_request) Successful in 40s
CI / redact (pull_request) Successful in 41s
CI / pi-friction (pull_request) Successful in 42s
CI / todo (pull_request) Successful in 56s
CI / forgejo (pull_request) Successful in 1m3s
CI / pi-swarm-suite (pull_request) Successful in 3m44s
449e754cce
The HOMELAB-2319 orchestrator called get_subagent_result(wait:false) 12 times
in 5 minutes while a background teamlead ran. The tool text said "don't
poll", but the still-running reply said "check back later", and nothing said
the completion notification (triggerTurn: true) wakes an idle session.

- Spawn reply, still-running reply and prompt guidelines now say: end your
  turn; the notification starts a new turn.
- A status check repeated on the same running agent within 60s gets a firm
  "stop checking, end your turn" reply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All checks were successful
CI / pr-title (pull_request) Successful in 0s
CI / forgejo-ci (pull_request) Successful in 44s
CI / plane (pull_request) Successful in 57s
CI / pi-otel-telemetry (pull_request) Successful in 59s
CI / nats-intercom (pull_request) Successful in 19s
CI / mcp-bridge (pull_request) Successful in 22s
CI / skill-args (pull_request) Successful in 36s
CI / ask-user-question (pull_request) Successful in 34s
CI / refocus (pull_request) Successful in 40s
CI / redact (pull_request) Successful in 41s
CI / pi-friction (pull_request) Successful in 42s
CI / todo (pull_request) Successful in 56s
CI / forgejo (pull_request) Successful in 1m3s
CI / pi-swarm-suite (pull_request) Successful in 3m44s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin plane/HOMELAB-2321-poll-loop-guard:plane/HOMELAB-2321-poll-loop-guard
git switch plane/HOMELAB-2321-poll-loop-guard

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff plane/HOMELAB-2321-poll-loop-guard
git switch plane/HOMELAB-2321-poll-loop-guard
git rebase main
git switch main
git merge --ff-only plane/HOMELAB-2321-poll-loop-guard
git switch plane/HOMELAB-2321-poll-loop-guard
git rebase main
git switch main
git merge --no-ff plane/HOMELAB-2321-poll-loop-guard
git switch main
git merge --squash plane/HOMELAB-2321-poll-loop-guard
git switch main
git merge --ff-only plane/HOMELAB-2321-poll-loop-guard
git switch main
git merge plane/HOMELAB-2321-poll-loop-guard
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Homelab/pi-extensions!68
No description provided.