Skip to content

サブエージェント子セッションナビゲーションと@agentメンション#25

Merged
ktmage merged 15 commits into
developmentfrom
feature/12/child-session-nav
Feb 28, 2026
Merged

サブエージェント子セッションナビゲーションと@agentメンション#25
ktmage merged 15 commits into
developmentfrom
feature/12/child-session-nav

Conversation

@ktmage

@ktmage ktmage commented Feb 28, 2026

Copy link
Copy Markdown
Owner

概要

Issue #12 「サブエージェント子セッションのナビゲーション追加」の実装。

2つの機能を含む:

1. 子セッションナビゲーション

サブエージェントが生成した子セッションの内容をインラインで表示し、セッション間をナビゲーション可能にする。

  • SubtaskPartView コンポーネント: サブタスク / task ツール呼び出し(type: "tool", tool: "task")をインライン表示
    • AgentIcon + エージェント名 + 説明を表示
    • クリックで子セッションへ遷移(selectSession メッセージ送信)
    • ステータス: running(スピナー)、completed(AgentIcon)、error(エラーメッセージ表示)
    • 子セッションの特定: metadata.sessionId 直接マッチ → タイトル部分一致(サーバーは description (@agent subagent) 形式でタイトルを設定するため)
  • ChatHeader 戻るボタン: 子セッション閲覧時に親セッションへ戻る
  • 子セッション閲覧時: InputArea 非表示(子セッションへの直接入力を抑制)

2. @agent メンション

チャット入力で @ を入力するとサブエージェント候補がポップアップ表示され、選択してメッセージを送信できる。

  • AgentPopup コンポーネント: エージェント一覧をポップアップ表示(# のファイル添付ポップアップと同様のパターン)
  • InputArea: @ トリガー検出、クエリフィルタリング、エージェント選択チップをコンテキストバー(ファイルチップの先頭)に表示
  • SDK/プロトコル層: getAgents() API、sendMessage で AgentPartInput を使用したサブエージェント呼び出し
  • フィルタリング: mode === "subagent" || mode === "all" のエージェントのみ表示(primary は除外)

バグ修正

  • エージェントフィルタリング: primary エージェントが表示される問題を修正(subagent/all のみ表示)
  • @agent 呼び出し: body.agent ではなく AgentPartInputparts 配列に含めるよう修正
  • subtask 表示: task ツール呼び出しがコードブロックとしてダンプ表示される問題を修正 → SubtaskPartView で表示
  • 子セッションマッチング: 完全一致から metadata.sessionId 直接マッチ + タイトル部分一致に改善

テスト

  • 全 772 テスト PASS(0 failures)
  • 新規テスト: SubtaskPartView ユニットテスト(28件)、findMatchingChild テスト(8件)、AgentPopup ユニットテスト(4件)、子セッションナビゲーションシナリオテスト(12件)、エージェントメンションシナリオテスト(9件)

コミット構成

コミット 内容
d68c766 feat: add getChildSessions API and child session protocol messages SDK/プロトコル層(子セッション)
4bc3d70 feat: add child session navigation UI with subtask display and back navigation UI層(子セッション)
38f9f59 test: add child session navigation unit and scenario tests テスト(子セッション)
553417b feat: add @agent mention SDK and protocol layer SDK/プロトコル層(@agent
31e74a9 feat: add @agent mention UI components UI層(@agent
f141710 test: add agent mention unit and scenario tests テスト(@agent
86a90a7 fix: filter agents to subagent-only and refresh child sessions on session.created エージェントフィルタリング修正
60b7229 test: update agent mention test to verify subagent-only filtering テスト更新
3d79a46 fix: use AgentPartInput in parts instead of body.agent for subagent invocation @agent 呼び出し修正
39779f7 feat: render task tool calls as subtask display instead of code block dump subtask 表示改善
0b4ea19 test: add task tool part rendering and isTaskToolPart tests テスト追加
08de313 fix: use metadata sessionId and partial title match for child session navigation 子セッションマッチング改善
63a1273 test: add findMatchingChild tests and server-format title matching tests テスト追加
446e1ab style: move agent chip to context bar alongside file chips エージェントチップ配置改善
80eafce style: fix import ordering in MessageItem リンター修正

Closes #12

@ktmage ktmage merged commit 801f3e3 into development Feb 28, 2026
1 check passed
@ktmage ktmage deleted the feature/12/child-session-nav branch March 1, 2026 17:58
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