Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Anthropic API: tool calls intermittently emitted inside `thinking` and returned as `end_turn`

オープン
#754 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
api

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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 :)

strata-failing-sse.txt

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.

主要言語
C++
スター
11.6k
フォーク
1k
平均マージ
7時間 46分
マージ済み PR(30日)
30

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Niko1221/Strata のほかの issue

Niko1221/Strata の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。