Skip to content

fix(pi): name workflow child rows by their step key, not only the agent - #26909

Merged
nwparker merged 1 commit into
stablyai:mainfrom
mmarabel:mmarabel/pi-subagent-row-names
Oct 10, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
mmarabel:mmarabel/pi-subagent-row-names

Conversation

@mmarabel

@mmarabel mmarabel commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

ELI5

When Pi runs a workflow with two helpers of the same kind, for example two reviewers, the sidebar shows both as "reviewer". This PR shows the name each helper was started under, such as "review-code" and "review-rollout", so you can tell them apart.

What Changed

Before: every child row under a Pi pane showed the pi-subagents agent name. Siblings that used the same agent had identical rows.

After: a workflow child's row shows its workflow step key. A child started outside a workflow still shows the agent name, and OMP children still show their task description.

Mechanism: the status extension that Orca installs into Pi now copies workflowKey from subagent:async-started into the child's description, but only when the event has no description of its own. The sidebar already names a row by description before agentType (src/shared/agent-child-row-model.ts), so no renderer change is needed.

Why

pi-subagents redacts task prompts, so #23201 used the agent name as the only safe label. pi-subagents also sends workflowKey on every workflow child. That key is the one the script passed to runs.run / runs.all, and pi-subagents only accepts 1–128 letters, numbers, ., _ or -, so it is a short label and never prompt text. Using it fixes the duplicate rows without touching prompts or the renderer.

Alternatives considered:

  • Show agent · key. That makes rows longer for a case the key alone already covers, and it would need a renderer change shared with Claude and Codex rows.
  • Wait for pi-subagents to send a description. That needs an upstream change for data that is already on the event.

Linked Issue

Fixes #26908

Visual Proof

The row text changes. Before/after screenshots will follow in a comment.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • New test in src/main/pi/agent-status-extension-async-subagents.test.ts: a workflow starts two reviewer children keyed review-code and review-rollout, and the posted roster carries each key as the child's description. It fails without the fix and passes with it.

  • The event shape matches real pi-subagents 0.76.1 runs: each workflow child's status.json carries workflowKey and parentWorkflowRunId.

  • Ran on Linux: vitest run src/main/pi/ (31 files, 446 tests), pnpm tc, oxlint and oxfmt on the changed files, and pnpm run check:code-quality:changed against upstream/main. Full pnpm lint and pnpm build were not run locally.

AI Disclosure

Claude Opus 5.5 (claude-opus-5-5, xhigh thinking) in the Pi coding agent investigated the bug, wrote the change and the test, and drafted this description.

Review

  • Cross-platform / SSH / remote: the change is in the extension text that runs inside Pi, so it behaves the same on every OS and on remote runtimes. It adds no paths, shell calls or IPC.
  • Agents and integrations: pi-subagents children without a workflowKey and OMP children (which send description) keep their current labels. description still wins over the key.
  • Security / privacy: the key is a validated slug. Task and goal text stay redacted.
  • Performance: one extra string read per child start.
  • UI: only the row label changes. Width is bounded by the existing truncation.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security, cross-platform support, remote SSH, mobile, backwards compatibility and performance are covered under Review. Older pi-subagents versions that don't send workflowKey keep the agent name.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

pi-subagents never sends a description, so every child row fell back to
the agent name and two children on one agent read the same. Workflow
children do carry workflowKey, a bounded slug, so use it as the label.

Fixes stablyai#26908
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6745ed10-a819-4e42-b87d-99706fdeda38

📥 Commits

Reviewing files that changed from the base of the PR and between bd85767 and fb7b137.


📒 Files selected for processing (2)
  • src/main/pi/agent-status-extension-async-subagents.test.ts
  • src/main/pi/agent-status-subagent-roster-source.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

The Pi subagent roster source now uses a nonblank workflowKey as the description when a started child has no nonblank description. A test verifies that two workflow children using the same agent appear as separate rows, with their run IDs and workflow keys.


Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to fb7b1

For the verified pi-subagents v0.76.1 workflow path, step keys reach the sidebar labels as intended. No merge-blocking issue is established; the repository does not pin the external runtime version.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: naming Pi workflow child rows by their step key instead of only the agent name.
Description check Passed The description is complete and aligned with the template. It explains the user impact, mechanism, rationale, alternatives, linked issue, testing, AI use, compatibility considerations, and checklist s…
Linked Issues check Passed Issue #26908 requires distinct sidebar labels for Pi workflow children that use the same agent. The roster source now sets description to record.description or, when that value is blank, `record.w…
Out of Scope Changes check Passed The pull request changes only the Pi subagent roster label fallback and adds a focused automated test. These changes directly support issue #26908. The diff does not change the shared renderer, task p…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[Bug]: Pi workflow children that share an agent all show the same name in the sidebar

2 participants