Expose queued and active processing state for project sessions
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Shell
- Estrellas
- 11.2k
- Forks
- 1.9k
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 6
Descripción
Describe the feature or problem you'd like to solve
Project-session coordination APIs do not expose whether a child session is actively processing or still has queued user messages. A parent can receive a completion handoff and see static branch/diff metadata from get_session, yet remain unable to prove the child is drained before merging its pull request.
This creates a cross-session merge race: if the parent previously sent a follow-up that is still queued, the child can wake after the parent merges, process that message, and push a trailing commit to the already-merged branch.
Proposed solution
Expose explicit processing and queue state in get_session and list_sessions_and_chats, for example:
is_processing: booleanqueued_messages_count: number- the current/last processed message identifier or a monotonic drain generation
Provide a native way for a coordinator to establish a merge barrier: wait until the child reports no active turn and no queued messages, then send a final stop/ready request and verify its acknowledgment belongs to the latest queue generation.
This would make project-session orchestration safe without relying only on conversational conventions or guessing from updated_at.
Example prompts or workflows
- A parent asks a child to implement a PR, sends two review fixes, then checks
is_processing == falseandqueued_messages_count == 0before merging. - A parent sends “Make no further changes; reply READY_FOR_MERGE,” then verifies the reply drained the latest queue generation before running
gh pr merge. - An orchestration dashboard shows which child sessions are idle, actively processing, or waiting on queued input.
- A parent avoids archiving a child that still has pending messages even though its latest task handoff is complete.
Additional context
Observed workflow: a child reported a validated PR head; the parent independently reviewed and merged it. A previously queued follow-up then woke the child, which produced and pushed a test-only commit after merge. The child detected the race and stopped, but the parent had no API field that could have prevented it.
Related queue/session-state reports do not expose a coordinator merge barrier:
- Messages submitted while background subagents are running get stranded in the Queued UI region
- Queued user messages and system notifications delivered out of send order
- Project sessions hide context-exhausted and interrupted turn causes
- Plan approval in autopilot+fleet mode triggers a dispatch ordering mismatch
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.
Línea de trabajo
Comienza siguiendo las rutas de API get_session y list_sessions_and_chats, y después lee los informes relacionados sobre la cola y el estado de la sesión enlazados en el issue. Define la semántica de estado y generación que necesita un coordinator para verificar que un child no tenga trabajo activo ni en cola antes de hacer el merge, y documenta qué reconocimiento hace que la barrera se complete.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Área
- api, backend-api-design, cli
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100