Skip to content

feat(chat): inline agent task list card in message history - #1305

Open
pedramamini wants to merge 1 commit into
mainfrom
feat/429-inline-agent-task-list
Open

feat(chat): inline agent task list card in message history#1305
pedramamini wants to merge 1 commit into
mainfrom
feat/429-inline-agent-task-list

Conversation

@pedramamini

@pedramamini pedramamini commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Phase 1 of #429, implemented the generic way rather than as a Claude-Code-specific panel: agent checklists now render as an inline card in the message history.

Several agents keep a working checklist and emit it as a tool call - Claude Code and OpenCode via TodoWrite (todos array), Codex via update_plan (plan array). Maestro previously collapsed all of that into a single summary line (Running tests (1/3)) with no way to see the individual items or their states.

What changed

  • src/renderer/utils/agentTaskList.ts (new): extractAgentTaskList() normalizes any checklist-shaped tool payload into a common { content, status } list. Detection keys off the payload shape, not the tool name, so any agent emitting the same structure gets the richer rendering for free. Status spellings are normalized (in-progress, done, COMPLETE, ...), and a list with any unlabeled entry is rejected outright so progress is never misreported.
  • src/renderer/components/AgentTaskListCard.tsx (new): the inline card. Collapsed by default - a progress bar plus the exact same one-line summary that has always been shown. Click to expand the full checklist with per-task state glyphs (✓ done, ▸ in progress, ○ pending). Completed items are dimmed and struck through.
  • TerminalOutput.tsx: routes checklist payloads to the card and drops the old TodoWrite-specific summarizeTodos helper (its behavior now lives in the shared extractor).

Design notes

Two deliberate calls, both worth a sanity check from the issue author:

  1. Inline with the agent, not a separate panel. Matches both the issue's UX principle and the preference in the issue thread for keeping this generic and in the message history.
  2. Collapsed by default. These tools fire on every checklist update, so always-expanding would mean 10 updates x 10 tasks = 100 lines of transcript noise. The progress bar gives at-a-glance state; the detail is one click away.

Phases 2 and 3 from the issue (reading ~/.claude/tasks/, team coordination views) are intentionally out of scope here - they are Claude-Code-specific and deserve their own discussion.

Testing

  • New unit tests for the extractor and summary formatter (10 cases: all three payload shapes, status normalization, and the null/rejection paths).
  • New component tests: collapsed-by-default, expand-shows-items, and Codex update_plan rendering.
  • src/__tests__/renderer/components/TerminalOutput.test.tsx: 125 passed.
  • npm run lint clean.

Drive-by: removed an unused @testing-library/user-event import from TerminalOutput.test.tsx. That package is not in package.json and is not installed, so the import made the entire suite fail to load before it ran a single test.

closes #429

Summary by CodeRabbit

  • New Features

    • Tool output now displays checklist-style task lists with progress summaries and expandable task details.
    • Supports task lists from multiple formats, including todos, plans, and generic task collections.
    • In-progress tasks show their active status text, while completed tasks are visually marked.
  • Tests

    • Added coverage for task-list extraction, status handling, progress summaries, and expanded tool output rendering.

Agents that keep a working checklist emit it as a tool call: Claude Code
and OpenCode via TodoWrite (todos array), Codex via update_plan (plan
array). Until now that rendered as a single summary line with no way to
see the individual items or their states.

Add a shape-driven extractor that normalizes those payloads into a
common { content, status } list, plus an inline card in the message
history that shows a progress bar and the same one-line summary when
collapsed, and the full checklist with per-task states when expanded.

Detection keys off the payload shape rather than the tool name, so this
stays agent-agnostic - a new agent emitting the same structure gets the
richer rendering for free.

Also drops an unused @testing-library/user-event import from
TerminalOutput.test.tsx; the package is not installed, so the whole
suite failed to load.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

This change normalizes checklist-style tool payloads, renders them as expandable inline cards, integrates them into tool output, and adds utility and component coverage for TodoWrite and update_plan payloads.

Agent task list display

Layer / File(s) Summary
Task-list normalization and summaries
src/renderer/utils/agentTaskList.ts, src/__tests__/renderer/utils/agentTaskList.test.ts
Checklist payloads from todos, plan, and tasks are normalized into shared task data with status, completion, active-task selection, and summary formatting.
Expandable checklist card
src/renderer/components/AgentTaskListCard.tsx
A collapsible card displays progress, task status glyphs, active forms, and completed-task styling.
Tool output checklist integration
src/renderer/components/TerminalOutput.tsx, src/__tests__/renderer/components/TerminalOutput.test.tsx
Tool logs render structured task lists through the checklist card and test TodoWrite and update_plan behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ToolLog as Tool log
  participant Extractor as extractAgentTaskList
  participant Card as AgentTaskListCard
  ToolLog->>Extractor: Pass toolState.input
  Extractor-->>ToolLog: Return normalized taskList
  ToolLog->>Card: Render taskList
  Card-->>ToolLog: Toggle expanded task details
Loading

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: rendering an inline agent task list card in chat history.
Linked Issues check ✅ Passed The PR implements the phase 1 inline task list flow by extracting checklist payloads and rendering expandable status cards.
Out of Scope Changes check ✅ Passed The changes stay focused on task-list extraction, rendering, and tests, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/429-inline-agent-task-list

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.

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

Introduces generic inline rendering for checklist-shaped agent tool calls.

  • Normalizes TodoWrite, update_plan, and generic task payloads into a shared task-list model.
  • Adds a collapsed, expandable progress card to message history.
  • Routes matching tool payloads through the new card while preserving generic rendering for other inputs.
  • Adds extractor and component coverage and removes an unavailable unused test import.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code defect identified.

Checklist extraction rejects malformed lists, preserves generic rendering when extraction fails, and the new card renders normalized task data without altering persisted session state or agent execution.

Important Files Changed

Filename Overview
src/renderer/utils/agentTaskList.ts Adds defensive shape-based extraction, status normalization, and summary formatting for supported checklist payloads.
src/renderer/components/AgentTaskListCard.tsx Adds an accessible expandable card with progress and normalized per-task state rendering.
src/renderer/components/TerminalOutput.tsx Routes recognized checklist inputs to the new card and retains generic summaries for unmatched payloads.
src/tests/renderer/utils/agentTaskList.test.ts Covers supported payload shapes, normalization aliases, rejection cases, and summary selection.
src/tests/renderer/components/TerminalOutput.test.tsx Verifies collapsed and expanded TodoWrite rendering and Codex update_plan integration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Tool input payload] --> B{Checklist-shaped?}
    B -- No --> C[Generic tool summary]
    B -- Yes --> D[Normalize labels and statuses]
    D --> E[Collapsed progress card]
    E -->|User expands| F[Per-task status list]
Loading

Reviews (1): Last reviewed commit: "feat(chat): inline agent task list card ..." | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a generic, agent-agnostic task list rendering in the terminal message history by detecting checklist-shaped tool payloads (TodoWrite, update_plan, and similar) and showing them as an inline, collapsed-by-default card.

Changes:

  • Introduces a shared task list extractor and one-line summary formatter (extractAgentTaskList, summarizeAgentTaskList).
  • Adds an inline expandable AgentTaskListCard UI and wires it into TerminalOutput for checklist tool inputs.
  • Adds unit and component tests to cover extraction, normalization, and rendering behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/renderer/utils/agentTaskList.ts New extractor and summary formatter to normalize checklist payload shapes across agents.
src/renderer/components/AgentTaskListCard.tsx New inline UI card for collapsed/expanded task list display with progress.
src/renderer/components/TerminalOutput.tsx Detects checklist payloads and renders the task list card instead of generic tool summaries.
src/tests/renderer/utils/agentTaskList.test.ts New unit tests for extraction, status normalization, and summary formatting.
src/tests/renderer/components/TerminalOutput.test.tsx Updates tests to validate collapsed-by-default and expansion behavior for task list cards.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
const item = raw as Record<string, unknown>;
const content = extractContent(item);
// Every entry must carry a label — a partial list would misreport progress.
const props = createDefaultProps({ session });
render(<TerminalOutput {...props} />);

// Collapsed by default — individual items are not rendered

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/renderer/utils/agentTaskList.ts`:
- Around line 37-42: Update the checklist detection used by extractAgentTaskList
to avoid classifying arbitrary tool arguments as task lists. Require stronger
evidence such as recognized task status values on most items and/or an
allowlisted tool name, while preserving valid checklist extraction and ensuring
unrelated MCP tool summaries are not replaced with null toolSummary.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 499d6585-06d4-4cca-be00-ee6d4f030ba9

📥 Commits

Reviewing files that changed from the base of the PR and between d2085a0 and 42a83db.

📒 Files selected for processing (5)
  • src/__tests__/renderer/components/TerminalOutput.test.tsx
  • src/__tests__/renderer/utils/agentTaskList.test.ts
  • src/renderer/components/AgentTaskListCard.tsx
  • src/renderer/components/TerminalOutput.tsx
  • src/renderer/utils/agentTaskList.ts

Comment on lines +37 to +42
/** Keys whose array value may hold a checklist, in priority order. */
const TASK_ARRAY_KEYS = ['todos', 'plan', 'tasks'] as const;

/** Keys that may hold an individual task's label, in priority order. */
const CONTENT_KEYS = ['content', 'step', 'title', 'task', 'description', 'text'] as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether any other in-repo tool/schema definitions use "tasks"/"plan"/"todos"
# array fields with generic labels that could collide with this heuristic.
rg -nP --type=ts -C2 '\b(tasks|plan|todos)\s*:' src/main src/renderer -g '!**/*.test.*'

Repository: RunMaestro/Maestro

Length of output: 5659


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the task-list heuristic and TerminalOutput integration points.
sed -n '1,130p' src/renderer/utils/agentTaskList.ts
printf '\n--- TerminalOutput task-list usages ---\n'
sed -n '700,740p' src/renderer/components/TerminalOutput.tsx 2>/dev/null || sed -n '700,740p' src/renderer/components/terminal/TerminalOutput.tsx
printf '\n--- agentTaskList usages ---\n'
rg -n "computeAgentTaskList|agentTaskList|toolSummary" src/renderer/components/TerminalOutput.tsx src/renderer -g '!**/*.test.*'

Repository: RunMaestro/Maestro

Length of output: 7535


Narrow the checklist detection before replacing generic tool summaries.

TASK_ARRAY_KEYS and CONTENT_KEYS are tool-agnostic, and every 'tool' log entry has toolSummary set to null whenever extractAgentTaskList(...) matches. This can misrepresent unrelated MCP tool arguments with a matching shape such as tasks: [{ title, description }] as a checklist card; tighten the heuristic, e.g. require valid status values on a majority of items, an allowlist/tool-name guard, or both.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/utils/agentTaskList.ts` around lines 37 - 42, Update the
checklist detection used by extractAgentTaskList to avoid classifying arbitrary
tool arguments as task lists. Require stronger evidence such as recognized task
status values on most items and/or an allowlisted tool name, while preserving
valid checklist extraction and ensuring unrelated MCP tool summaries are not
replaced with null toolSummary.

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.

Feature: Native TaskList panel for Claude Code task tracking and agent team coordination

2 participants