HTTP 400 missing messages[N].reasoning_content after context compaction (long sessions)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
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
- Activo
- Stack tecnológico
- ai-infra-agents, typescript
- Área
- ai-infra-agents, backend
Línea de trabajo
Start by locating the harness message serializer and the compaction/history rebuild path; the issue does not name specific files or tests. Reproduce with a model that requires reasoning_content, then inspect assistant messages after compaction. Done means serialized history retains required reasoning on every assistant message, with a regression test covering compacted turns.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
After a long multi-turn session with auto-compaction, sending the next message fails with HTTP 400:
Missing required parameter: 'messages[50].reasoning_content'. This model needs the reasoning of every earlier assistant message...
The turn is blocked. continue sometimes works for 1–2 turns, but the error recurs. Two trace IDs from the same session are included below.
Expected Behavior
The harness should replay reasoning_content for every earlier assistant message when the selected model requires it. If context compaction drops reasoning, the compacted history should replace old assistant turns with a summary entry that does not require reasoning, rather than leaving assistant entries without the field.
Actual Behavior
After compaction, the rebuilt request omits reasoning_content on older assistant messages. The provider rejects the whole request at messages[50]. No tool call or assistant response executes; the user must retry or start a new session.
Steps to reproduce the issue
- Use a model that requires
reasoning_contenton all assistant history. - Run a long session (40+ assistant turns with tool calls).
- Trigger auto-compaction (or
/compact). - Send the next user message.
- Observe HTTP 400 at
messages[N].reasoning_content.
Command Code Version
0.1.60 (desktop, macOS; bundled @commandcode/harness 0.1.0)
Operating System
macOS
Terminal/IDE
Command Code desktop app (macOS)
Shell
zsh
Session file (optional)
Not attached — the session contains project files. Trace IDs from the two occurrences:
c36659e1be4cb4330a058117255da812df284ce38687a51028ea4de40acfdd48
Fix prompt (optional)
In the harness message serializer, when rebuilding history after compaction, preserve reasoning_content on every role: assistant message that originally had it. If a message is summarized away, replace it with a system/summary entry instead of an assistant entry lacking reasoning. Add a regression test: build 60 assistant turns with reasoning, compact, serialize, assert every assistant message still has reasoning_content. Include message_index, message_role, provider, and model in the 400 error payload.
Additional context
Exact error text:
Error: 400 Missing required parameter: 'messages[50].reasoning_content'. This model needs the reasoning of every earlier assistant message: send back the 'reasoning_content' returned with that message. If r...
Type "continue" to try again. If the issue persists, contact support: https://commandcode.ai/discord
Trace ID: c36659e1be4cb4330a058117255da812
Second occurrence in the same session:
Error: 400 Missing required parameter: 'messages[50].reasoning_content'. This model needs the reasoning of every earlier assistant message: send back the 'reasoning_content' returned with that message. If r...
Type "continue" to try again. If the issue persists, contact support: https://commandcode.ai/discord
Trace ID: df284ce38687a51028ea4de40acfdd48
Suspected cause: compaction/history rebuild keeps {role, content, tool_calls} but drops reasoning_content; the provider validates every assistant message, not just the last one.
Workaround: type continue, or start a new session with a summary.
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 4.2k
- Forks
- 377
- Merge medio
- 1 d 17 min
- PR fusionados (30 d)
- 7
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 CommandCodeAI/command-code
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatibleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
CommandCodeAI/command-code#1085 ·
Los mantenedores suelen responder en 1 día
-
Feature request: auto-reconnect remote control (/rc) after restartPosiblemente ocupada @aliarain la tomó hace 20 días. Abiertop2
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
CommandCodeAI/command-code#992 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CommandCodeAI/command-code#933 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CommandCodeAI/command-code#855 ·
Los mantenedores suelen responder en 1 día
-
grep tool passes empty file type to ripgrepPosiblemente ocupada @ahmadbilaldev la tomó hace 19 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CommandCodeAI/command-code#655 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de CommandCodeAI/command-code
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
developmentwithyash/yaan#60 ·
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
-
area/billing area/config comp/tui-gateway P2 provider/openrouter type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
NousResearch/hermes-agent#153086 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
ai-generated structs tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día