Bug: A Responses API tool call announced but never completed is dropped, and the turn mislabelled no_response_body
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #1419 de @evaline-ju — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
Línea de trabajo
Start in core/plugins/inferenceparser/plugin.go, where InferenceParser.OnResponseFrame handles the Responses API frames and the terminal arm records pctx.Skip("no_response_body"). Read the existing Anthropic test TestInferenceParser_AnthropicMessages_StreamToolUseOnlyIsNotASkip for the expected handling of truncated arguments. Done means the four-shape table in the issue holds, with the added-only case returning one call with empty arguments and the duplicate-added case still returning one call.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
When a Responses API stream emits response.output_item.added for a tool call but the stream ends before the matching response.output_item.done — a turn cancelled in that window — the call is lost entirely. The turn then also gets mislabelled as having carried no response body.
Measured against main (c8415388) by feeding frames through InferenceParser.OnResponseFrame:
| Frame shape | Result on main |
|---|---|
added → done(incomplete) → terminal |
1 call, partial args "const r = await" |
added → done(in_progress), no terminal |
1 call, partial args |
added only, stream cut |
0 calls ← this bug |
Two of the three shapes are fine and should stay as they are: keeping truncated arguments is what the Anthropic dialect in this same package does deliberately — TestInferenceParser_AnthropicMessages_StreamToolUseOnlyIsNotASkip pins "Arguments stay as the model left them — truncated, not discarded".
Why the mislabelling matters more than the missing call
InferenceParser's terminal arm records pctx.Skip("no_response_body") when Completion, FinishReason, TotalTokens and ToolCalls are all empty (core/plugins/inferenceparser/plugin.go, the "Tool calls count as a body" guard). A turn cancelled mid-tool-call has no completion text, no finish reason and no usage block — so with the call dropped too, all four are empty and the row is labelled as carrying nothing, when it demonstrably started a tool call. The guard's own comment says that outcome is what it exists to prevent; it just cannot see a call that was never recorded.
Fix
Track a tool call from response.output_item.added (call_id + name, no arguments yet), and have response.output_item.done fill in the arguments on that same entry rather than appending a second one. An id-keyed lookup is needed so a call seen on both events is not double-counted.
Add no status-based exclusion. This is the part worth stating explicitly, because it was tried and was wrong — see #1331, which excluded items whose status was incomplete/in_progress and thereby dropped calls main keeps, regressing two shapes to fix one. The concern behind it (truncated arguments presented as complete) is already answered: shape 1 sets FinishReason: "incomplete", which is the signal a consumer should read.
Expected result — strictly additive, nothing else changes:
| Shape | Before | After |
|---|---|---|
| added → done(incomplete) | 1, partial | 1, partial (unchanged) |
| added → done(in_progress) | 1, partial | 1, partial (unchanged) |
| added only | 0 | 1, empty args |
| normal complete call | 1, full | 1, full (unchanged) |
Tests worth having
- One per row of that table, asserting the count AND the arguments, so a future change that blanks the partial-argument rows fails loudly.
- A duplicate-
addedguard case: twoaddedevents for onecall_idmust not yield two calls. - A
done-with-no-addedcase (not expected on live traffic, but the fallback should not drop the call). - A
function_call-typed case alongsidecustom_tool_call, since #1331's review found both arms could be individually deleted with the suite staying green.
Severity
Low. It needs a cancellation landing in the window between added and done, which is narrow — Codex emits custom_tool_call_input.delta events in between, so the window is real but small. Filed because it is now a well-understood small fix rather than an open question.
Context: #1331 (closed, has the full analysis), #942, #1239.
Assisted-By: Claude (Anthropic AI) [email protected]
- Lenguaje dominante
- Go
- Estrellas
- 16
- Forks
- 41
- Merge medio
- 11 h 55 min
- PR fusionados (30 d)
- 255
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 rossoctl/cortex
-
UI shows costs for all sessions even when drilled into a sessionPosiblemente ocupada @esnible la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
rossoctl/cortex#1116 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
laptop
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
rossoctl/cortex#1437 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Support mTLS for Session APIAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
Los mantenedores suelen responder en 1 día
-
Add a coding-agent demo with cpex policy enforcementPosiblemente ocupada @araujof la tomó hace 2 días. Abierto
rossoctl/cortex#1428 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Release cortex-cpex binaries and add installer supportPosiblemente ocupada @araujof la tomó hace 2 días. Abierto
rossoctl/cortex#1427 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de rossoctl/cortex
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Billionmail/BillionMail#389 ·
-
good first issue help wanted v3
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
oras-project/oras-go#1621 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
kaimahi-agents/kaimahi#570 ·
Los mantenedores suelen responder en 1 día