[Bug]: Claude subagent rows show a raw `<tools-used-before-summary>` tag before the summary

Đang mở Phù hợp với người mới
#30,069 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend, frontend

Hướng nghiên cứu

Bắt đầu từ claudeSubagentResultText trong apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts, nơi văn bản kết quả của công cụ được sao chép vào result của subagent, và tiếp theo là plainDetail trong apps/web/src/components/chat/V2LifecycleRow.tsx, nơi các dòng được nối lại. Bài kiểm thử adapter gửi kết quả subagent chạy ở tiền cảnh bắt đầu bằng <tools-used-before-summary> cho thấy assertion đang thất bại. Công việc hoàn tất khi bài kiểm thử đó đạt và dòng thẻ đầu tiên không còn hiển thị trong tóm tắt của hàng, đồng thời các kết quả không có thẻ vẫn giữ nguyên.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area: apps/server

Steps to reproduce

  1. Use the Claude provider with Claude Code CLI 2.1.316.
  2. Ask Claude to hand a small job to a subagent, for example: "Use a subagent to list the functions in math.ts with their line numbers."
  3. Wait for the subagent to finish and look at its row in the thread.

Expected behavior

The settled subagent row shows the subagent's summary:

add (line 1) mean (line 6)

Actual behavior

The row shows Claude Code's internal markup in front of the summary:

<tools-used-before-summary>Read</tools-used-before-summary> add (line 1) mean (line 6)

The subagent's work and the parent agent's answer are correct; only the shown summary is wrong.

Cause: Claude Code 2.1.316 opens a foreground Agent tool result with a <tools-used-before-summary>…</tools-used-before-summary> line. It is a note for the parent model naming the tools the subagent called. claudeSubagentResultText in apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts copies the tool result text into the subagent's result as is. The row's plainDetail in apps/web/src/components/chat/V2LifecycleRow.tsx joins the lines but leaves the tag, which gives the text above. Nothing in the repo handles the tag today (git grep tools-used-before-summary finds nothing).

The CLI does not add the line to every result: its own schema describes it as the tools the subagent called that the conversation's requests did not yet name. So some subagent rows look fine and others don't.

Impact

Cosmetic issue

Version or commit

main @ cefb544af3

Environment

macOS (Darwin 25.6.0), Claude Code CLI 2.1.316 through the Claude Agent SDK.

Logs or stack traces

An adapter test that sends a foreground subagent result opening with the line fails on main:

AssertionError: expected '<tools-used-before-summary>Read, Grep…' to equal 'add (line 1)\nmean (line 6)'

- Expected
+ Received

+ <tools-used-before-summary>Read, Grep</tools-used-before-summary>
  add (line 1)
  mean (line 6)

Workaround

None found.


Note for whoever files this: the row text above was seen in a downstream build that shares this adapter and row code, not in a T3 Code build. On T3 main the defect is shown by the adapter test only.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
7 giờ 39 phút
Pull request đã merge (30 ngày)
123

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.