Anthropic API: tool calls intermittently emitted inside `thinking` and returned as `end_turn`
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with the attached failing SSE log and trace the /v1/messages streaming path for thinking and tool-call output. Compare a failing turn with thinking enabled against a successful tool-use turn and the reported thinking-off run. Done means intended tool calls are emitted in an Anthropic tool_use block with stop_reason: "tool_use", rather than as thinking_delta followed by end_turn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
AI disclosure: This issue was created with the assistance of AI based on captured Pi session logs and raw SSE traffic. Im not a dev :)
System
- OS: Ubuntu 26.04.1 LTS
- Kernel: 7.0.0-34-generic
- CPU: AMD Ryzen 7 9800X3D
- RAM: 32 GB DDR5-6000
- GPU: NVIDIA GeForce RTX 3090 24 GB
- NVIDIA driver: 595.91.07
- CUDA: 13.2
- Strata: Docker, v0.1.38
- Model:
qwen3.8-flash-next-coder-iq1_m - Context: 262144
- API: Anthropic-compatible
/v1/messages - Client: Pi 1.0.2
- Pi thinking mode:
low(budget_tokens: 2048)
Setup
- Strata: current Docker build / v0.1.38-era code
- Model:
qwen3.8-flash-next-coder-iq1_m - API:
/v1/messages - Client: Pi 1.0.2
- Pi thinking:
low - Request thinking budget:
2048 - Context: well below 262K
With thinking enabled, Strata intermittently emits a complete intended tool call inside the Anthropic thinking block instead of producing a structured tool_use.
Raw SSE from a failing request:
event: content_block_delta
data: {"type":"content_block_delta","index":0,
"delta":{"type":"thinking_delta","thinking":"<tool_call>"}}
...
event: content_block_delta
data: {"type":"content_block_delta","index":0,
"delta":{"type":"thinking_delta","thinking":"</tool_call>"}}
Immediately afterwards:
event: content_block_stop
data: {"type":"content_block_stop","index":0}
event: message_delta
data: {"type":"message_delta",
"delta":{"stop_reason":"end_turn","stop_sequence":null},
"usage":{"input_tokens":243,
"cache_read_input_tokens":28792,
"output_tokens":79}}
event: message_stop
data: {"type":"message_stop"}
There is no Anthropic tool_use content block in the failed turn.
Successful turns in the same session correctly produce:
event: content_block_start
data: {"type":"content_block_start","index":2,
"content_block":{"type":"tool_use", ...}}
event: message_delta
data: {"type":"message_delta",
"delta":{"stop_reason":"tool_use", ...}}
Reproduction
Using the same multi-step tool workload:
thinking low: C1 FAIL / C2 FAIL / C3 FAIL
thinking off: C4 PASS
Failures occurred at different context sizes (~21K–34K), so this does not appear to be a context-limit or timeout issue.
Expected
When the model transitions from reasoning to a tool call, Strata should emit a structured Anthropic tool_use block and stop_reason: "tool_use".
Actual
The intended tool call is sometimes streamed as thinking_delta, followed by a clean end_turn, causing the client agent loop to stop.
- Ngôn ngữ chính
- C++
- Star
- 11.6k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Niko1221/Strata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Niko1221/Strata#5286 · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Niko1221/Strata#5240 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của Niko1221/Strata
Issue tương tự
-
[Feature]: Fedora 45 repoĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
metasequoiaime/msime#10989 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vek-language/vek-lang#1 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-score/lifecycle#957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
mw00/project-maya#877 ·
Maintainer thường phản hồi trong vòng 1 ngày