DatabricksAdapter yields text content during tool-calling rounds, causing response duplication
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
- #436 de @MarioCadenas — cerrado sin fusionar
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
Línea de trabajo
Empieza por DatabricksAdapter's streamCompletion() y el método run() alrededor de la línea 196, y después reproduce el problema con maxSteps: 10 y varias herramientas como describeTable y executeSql. Rastrea los eventos message_delta y tool-call a lo largo de una ronda de llamadas a herramientas. Se considera terminado cuando el texto intermedio no produce respuestas duplicadas visibles para el usuario, mientras que la respuesta final sigue apareciendo una sola vez.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 119
- Forks
- 36
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 37
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de databricks/appkit
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
databricks/appkit#729 ·
Los mantenedores suelen responder en 3 días
-
@databricks/lakebase: pool drops maxLifetimeSeconds and other pg options, so connections never recycle and Unity Catalog claims access fails after 4 hoursPosiblemente ocupada @billmcmillin la tomó hace 5 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
databricks/appkit#718 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
databricks/appkit#699 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 Medio día Aptitud para principiantes 42/100
databricks/appkit#656 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
databricks/appkit#648 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de databricks/appkit
Issues similares
-
Add "append" and "prepend" slots for vue-vuetify extended renderersPosiblemente ocupada @simeyc la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eclipsesource/jsonforms#2668 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
README の通知条件を実際の判定処理に合わせるPosiblemente ocupada @unhappychoice la tomó hoy. Abiertofactory:in-progress priority:medium
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
unhappychoice/oss-issue-opener#395 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug Website
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
OWASP/OWASP-Hunting#88 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día