Skip to content

feat(subagent): add an optional short label to delegated tasks - #379

Open
liuedcson wants to merge 2 commits into
mainfrom
feat/subagent-description
Open

liuedcson wants to merge 2 commits into
mainfrom
feat/subagent-description

Conversation

@liuedcson

@liuedcson liuedcson commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A delegated task carries the child's full instruction. It is usually long, so when several children share one agent type the list rows, the /subagents output and the expanded record all show the same agent name and an unreadable task start.

Change

Add an optional short description to the single call, to tasks entries and to chain entries, next to model at each level.

  • step-subagent.ts: schema fields and types. Entry text: Short label (3-5 words) naming this task in the UI.
  • subagent/execute.ts: read the value (trimmed, empty means none) and write it into the queued, running, completed and failed records.
  • subagent/projection.ts: carry it through the live and final projections, clipped like other identifiers.
  • subagent/lane-events.ts: validate it as a string at the lane snapshot boundary.
  • subagent/rendering.ts, step-subagents-command.ts: use it as the row title, falling back to the task; the expanded record shows it above the full task.

The field is optional, so existing calls are accepted unchanged and every surface behaves as before when it is absent.

Prompt change to an existing field

The top-level description and model are read only in single mode; in tasks and chain each entry carries its own. Their schema text now says so: description gets (for single mode) like the neighbouring agent and task, and model gets (single mode) to stay inside the existing 200-character budget. Without the marker, a model in parallel mode filled the top-level label next to the per-entry ones, and a top-level model in parallel mode is ignored silently.

Validation

  • pnpm exec vitest --run test/subagent-child-queue.test.ts test/subagent-list-widget.test.ts test/step-capabilities-extension.test.ts test/subagent-model-route.test.ts in packages/coding-agent: 73 passed, including the model description size budget.
  • pnpm run check: passes.
  • Built the darwin-arm64 binary and ran it against a Step model in a scratch workspace: two parallel calls labelled each entry and left the top-level field empty; one single call filled the top-level label. All records carried the label through to the final result.

Not in this change

The <agent-notification> text sent to the parent model is unchanged. Hosts that render subagent rows themselves need to read the new field separately.

A task carries the child full instruction, which is too long to tell rows apart when several children share one agent type. Accept an optional description on the single call, tasks entries and chain entries, carry it through the live and final projections and the lane snapshot validation, and show it as the row title in the list widget, the subagents command and the expanded record. Without a label every surface behaves as before.
In parallel mode a model filled the top-level description next to the per-entry labels, because the top-level field shared the entry text. Mark the top-level description and model as single-mode fields, matching the neighbouring agent and task fields. Shorten the label text to one line.
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