Skip to content

feat(desktop): TODO ライブストリームをサブエージェント入れ子 + スタイリッシュ UI に刷新 (#234)#236

Merged
MocA-Love merged 1 commit intomainfrom
feat/todo-live-stream-revamp
Apr 16, 2026
Merged

feat(desktop): TODO ライブストリームをサブエージェント入れ子 + スタイリッシュ UI に刷新 (#234)#236
MocA-Love merged 1 commit intomainfrom
feat/todo-live-stream-revamp

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

Closes #234

Summary

AgentManager の TODO 詳細ライブストリーム表示を改善します。

  • サブエージェント入れ子化: Claude Code の Task/Agent ツールが呼び出したサブエージェントのツール活動 (Grep, Glob, Read 等) を、親 Agent ブロックの開閉内に正しく内包表示するようにしました。これまではフラットに並んでしまっていた問題 (画像参照 → Issue desktop: TODO ライブストリームを改善(サブエージェント入れ子表示 + スタイリッシュ化) #234) を修正しています。
  • スタイリッシュ化: 各ツールにカード・lucide-react の種別アイコン・パレット色を与え、実行中のツールは pure CSS の ShinyText シマーと amber のドットで「動いている感」を表現。子を持つカードには件数バッジを付け、子が増えた瞬間に自動展開します。

主な実装ポイント

Backend (apps/desktop/src/main/todo-agent)

  • classifyStreamJsonparent_tool_use_id (top-level)、tool_use ブロックの id、tool_result ブロックの tool_use_id を抽出して TodoStreamEvent に伝搬。
  • TodoStreamEvent に optional な toolUseId / parentToolUseId を追加。旧 stream.jsonl との互換は renderer 側の legacy 位置ペアリングで維持。

Frontend (apps/desktop/src/renderer/features/todo-agent/TodoManager)

  • pairStreamEvents (位置ベース) → buildStreamTree (id ベース + サブエージェント親子ツリー) に差し替え。
  • ToolCallCard をツリー再帰レンダリング対応に再設計。<details> は controlled open state にして、再レンダリング時にユーザーの展開操作が巻き戻る問題を回避。子が 0→1 になった瞬間だけ自動展開。
  • 実行中ツール名 / OUT 空欄の「実行中…」に <ShinyText> 適用。
  • ツール名と getToolPalette() で Bash/Read/Edit/Write/Grep/Glob/Task/Agent/TodoWrite/WebFetch/WebSearch 等の色分けとアイコン表示。

Styling (apps/desktop/src/renderer/globals.css)

  • @keyframes shine + .animate-shine を追加。currentColor--shine-peak (light/dark テーマ別) を使った軽量なシマー。

テスト観点

  • bun run typecheck ✅ 通過確認済み
  • bun run lint ✅ 通過確認済み
  • 新規 TODO セッションを起動してサブエージェント (Task ツール) を呼ばせたとき、サブエージェントの tool_use が親 Agent ブロック内に入れ子表示されること
  • 実行中ツールの名前が shimmer すること
  • 旧セッション (stream.jsonl に toolUseId が無いもの) を開いたとき、tool_use ↔ tool_result の組がこれまで通り対表示されること

参考

  • Claude Agent SDK docs の Subagents セクション: "Messages from within a subagent's context include a parent_tool_use_id field, letting you track which messages belong to which subagent execution."

#234 — AgentManager の TODO 詳細で、Claude Code のサブエージェント (Task/Agent
ツール) の tool_use/tool_result が親 Agent ブロック外にフラット表示される
不具合を修正し、併せて全体のビジュアルを改善する。

- supervisor: stream-json の `parent_tool_use_id` と tool_use/tool_result
  ブロックの id を抽出して TodoStreamEvent に `parentToolUseId` /
  `toolUseId` として伝搬。
- types: TodoStreamEvent に optional な id フィールドを追加。旧 jsonl
  (id 無し) は renderer 側の legacy 位置ペアリングで従来通り動作する。
- renderer: pairStreamEvents を id ベース + 親子ツリー化した
  buildStreamTree に差し替え。ToolCallCard はツリー再帰表示・
  lucide-react のツール別アイコン/パレット・実行中 ShinyText シマー・
  子件数バッジを持つカード型に刷新。子がいる場合は初回に自動展開。
- globals.css: pure CSS の `.animate-shine` キーフレームを追加
  (currentColor + --shine-peak で theme 対応)。
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 50 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 43 minutes and 50 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eaab72c6-f162-4d66-b31f-3e287cc608b7

📥 Commits

Reviewing files that changed from the base of the PR and between 8c082df and f7da887.

📒 Files selected for processing (4)
  • apps/desktop/src/main/todo-agent/supervisor.ts
  • apps/desktop/src/main/todo-agent/types.ts
  • apps/desktop/src/renderer/features/todo-agent/TodoManager/TodoManager.tsx
  • apps/desktop/src/renderer/globals.css
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/todo-live-stream-revamp

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 and usage tips.

@MocA-Love
Copy link
Copy Markdown
Owner Author

@codex review

@MocA-Love MocA-Love self-assigned this Apr 16, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7da887eca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1597 to +1598
// Modern path: already attached via resultByUseId.
if (ev.toolUseId && toolNodeById.has(ev.toolUseId)) continue;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent duplicate tool_result rows for out-of-order events

buildStreamTree pre-indexes tool_result by toolUseId and later attaches that result to the matching tool_use, but this guard only skips rendering the standalone result when the parent tool node has already been seen in the same pass. If a tool_result arrives before its tool_use (the exact out-of-order case this code is meant to handle), the result is first emitted as a message row and then also shown inside the tool card once the tool_use is processed, so the same output appears twice.

Useful? React with 👍 / 👎.

@MocA-Love MocA-Love merged commit e836a73 into main Apr 16, 2026
6 checks passed
MocA-Love added a commit that referenced this pull request Apr 16, 2026
chore: open PR 11 件をまとめて取り込み (#216#236)
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.

desktop: TODO ライブストリームを改善(サブエージェント入れ子表示 + スタイリッシュ化)

1 participant