Display task titles in CLI UI instead of class type names - #665
Merged
Conversation
The workflow progress UI rendered `task.type` for every row, so two instances of one class — the two `BootstrapDownloadTask`s in `sec bootstrap`, fetching submissions.zip and companyfacts.zip — showed as two identical rows, and the `title` callers already set was never displayed. `CliTaskLine` now carries a `label` (the instance `title`, else the class type name) alongside `type`, which stays as the renderer-dispatch key so `pickRenderer` / `isRedundantSubgraph` keep matching on class identity. `TaskStatusLine`/`TaskStatusProgressRow` take `label` — that prop was always a display string (iteration rows pass `#1`), so the rename removes the last place a class name was hardcoded as UI text. `IExecuteContext.own` gains an optional config. A graph or workflow is adapted into a wrapper task the caller never sees, so this is the only way to name one; without it every `context.own(new Workflow())` renders as the same anonymous `Own[Workflow]` row. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D9HvGjLQ2SGHo1nYxSUrUa
Missed in the label rename: DefaultTaskRow's per-iteration row still passed `type`, which no longer exists on TaskStatusProgressRowProps. Vitest transpiles TSX without typechecking, so only `build-types` caught it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D9HvGjLQ2SGHo1nYxSUrUa
Coverage Report
File CoverageNo changed files found. |
…er row A task that owns a workflow produces a wrapper row whose children are the actual work, and SubtaskRows stopped at that wrapper — so `sec bootstrap` showed a lone "Own[Workflow]" line with the pipeline inside it invisible. Rows now recurse: each subtask renders its own subgraph beneath it, to a bounded depth (the breadth cap otherwise multiplies into more rows, and more attach pollers, than a terminal can use). To make that affordable, `useSubtaskRows` stops its 150ms attach poll once a childless task has settled — previously every leaf kept waking for the life of the run, which recursion would have multiplied. The four graph wrappers also get plain titles. They inherited "Group" from GraphAsTask, so with rows now labelled by title an unnamed subgraph would have read "Group" rather than the kind of subgraph it is. Covered by a test that fails when the recursion is disabled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D9HvGjLQ2SGHo1nYxSUrUa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change improves the CLI task display by showing task instance titles (when configured) instead of always showing the class type name. This allows users to distinguish between multiple instances of the same task class (e.g., two "DownloadTask" instances downloading different files).
Key Changes
cliTaskLabel()function intaskGraphCliSubscriptions.tsthat returns a task's instance title if set, falling back to the class type name, or "Unknown" as a last resortCliTaskLineinterface to include alabelfield (display name) separate fromtype(class identity)taskLabelinstead oftaskTypefor user-facing messages (e.g., completion logs)ChatTaskRow,DefaultTaskRow,StreamingTextRow,SubtaskRows,TaskStatusLine,TaskStatusProgressRow) to use the newlabelprop instead oftypeIExecuteContext.own()signature to accept an optionalTaskConfigparameter, allowing callers to configure owned tasks/graphs/workflows (particularly useful for naming anonymous owned workflows)cliTaskLabel()behavior with 5 test cases covering title preference, fallback logic, and edge casesImplementation Details
labelfield is computed once when tasks are registered and stored inCliTaskLinefor efficient renderingexamples/cli/src/test/cliTaskLabel.test.tswith full coverage of the labeling logichttps://claude.ai/code/session_01D9HvGjLQ2SGHo1nYxSUrUa