DatabricksAdapter yields text content during tool-calling rounds, causing response duplication
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
- #436 @MarioCadenas による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
DatabricksAdapter の streamCompletion() と、196 行目付近の run() メソッドから始め、次に maxSteps: 10 と describeTable や executeSql などの複数のツールを使って問題を再現します。ツール呼び出しの 1 ラウンドにわたって message_delta イベントと tool-call イベントを追跡します。完了の条件は、中間テキストによってユーザーに表示される回答が重複せず、最終応答が引き続き 1 回だけ表示されることです。
索引モデルが issue の本文から書いたものです。
説明
DatabricksAdapter yields text content during tool-calling rounds, causing response duplication
Problem
When using DatabricksAdapter with Claude models via Databricks Model Serving (OpenAI-compatible endpoint), the model produces substantial text content alongside tool calls in the same response turn. The adapter's streamCompletion() method yields all delta.content text as message_delta events regardless of whether the same response also contains tool calls.
In a multi-step ReAct loop, this causes the model's intermediate text (which often includes the full answer) to be emitted and displayed to the user on every tool-calling turn — resulting in the same answer appearing 3-4× in the final output.
Root Cause Analysis
Claude's native API uses a trained-in tool-use system prompt that shapes the model to produce brief commentary before tool_use blocks. The Databricks OpenAI-compatible translation layer does not include this trained-in prompt, so Claude produces more verbose text during tool-calling rounds.
The adapter loop (run() method, line ~196) correctly breaks when no tool calls are present, but during tool-calling rounds, streamCompletion() yields ALL delta.content as message_delta events — there's no mechanism to suppress or buffer text that arrives in a turn that also contains tool calls.
Expected Behavior
Text content from tool-calling rounds should either:
- Be suppressed (not yielded as
message_delta) when the same response also containstool_calls - Be buffered until
streamCompletionreturns, and only yielded if no tool calls were detected - Be marked with metadata so consumers can distinguish intermediate text from final-answer text
Current Workaround
We added:
- A system prompt instruction telling the model to only write brief status notes during tool-calling turns
- Client-side text buffering in the SSE transport layer that discards accumulated text when a
function_callevent arrives in the same round
Environment
- AppKit version: 0.38.1
- Model:
databricks-claude-opus-4-6via Model Serving - Adapter:
DatabricksAdapter.fromServingEndpoint()
Reproduction
- Create an agent with
maxSteps: 10and multiple tools (e.g.,describeTable,executeSql) - Ask a question that triggers 3+ tool calls
- Observe that the assistant's text response contains the full answer repeated once per tool-calling round
- 主要言語
- TypeScript
- スター
- 119
- フォーク
- 36
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 37
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
databricks/appkit のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
databricks/appkit#729 ·
メンテナーはふだん 3 日以内に返信
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hours対応中かも @billmcmillin が 5 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
databricks/appkit#718 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
databricks/appkit#699 ·
メンテナーはふだん 3 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 42/100
databricks/appkit#656 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
databricks/appkit#648 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
databricks/appkit の issue をすべて見る
似ている issue
-
Add "append" and "prepend" slots for vue-vuetify extended renderers対応中かも @simeyc が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eclipsesource/jsonforms#2668 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
README の通知条件を実際の判定処理に合わせる対応中かも @unhappychoice が今日担当しました。 オープンfactory:in-progress priority:medium
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
unhappychoice/oss-issue-opener#395 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug Website
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
OWASP/OWASP-Hunting#88 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信