github / github/copilot-cli

Autopilot background-task timeout exits active parent after subagent completes

Abierto
#4,628 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

area:agents area:non-interactive
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

Describe the bug

In autopilot mode, the 600-second background-task wait timeout terminates the
entire Copilot CLI process even after the background subagent has completed and
the parent agent has resumed work.

The timeout appears to start from when the parent first becomes idle.
It is not cancelled or reset when the background task completes.

The process exits with code 0, causing automation to treat the interrupted run
as successful.

Affected version

1.0.80

Steps to reproduce the behavior
  1. Start Copilot CLI in autopilot mode.
  2. Launch a background subagent that remains active for several minutes.
  3. Allow the parent agent to become idle while awaiting that subagent.
  4. Let the subagent complete before the configured COPILOT_TASK_WAIT_TIMEOUT_SECONDS deadline.
  5. Allow the parent to resume work.
  6. Original timer still fires and exits the entire process, even though the parent is active and the subagent has finished.

Observed timeline from one run:

06:07:40 - background subagent started
06:10:52 - parent became idle while waiting
06:19:12 - subagent completed; parent resumed
06:20:48 - parent was actively streaming an edit tool call
06:20:52 - exactly 600 seconds after the parent became idle, Copilot emitted:
"Timed out after 600s waiting for background tasks to finish; exiting.
Set COPILOT_TASK_WAIT_TIMEOUT_SECONDS to change the limit."

The process then returned exitCode: 0.
The in-progress edit was never executed.

Expected behavior

When a background-task timeout is reached, Copilot CLI should:

  1. Cancel only background tasks that are still running.
  2. Return control to the parent with a timeout notification.
  3. Cancel the wait timer when all background tasks complete.
  4. Not terminate an active parent because of a stale background-task timer.

If a session-level deadline intentionally terminates the process, it should be reported as a timeout with a nonzero exit status rather than successful completion.

Additional context

copilot-cli-timeout-redacted-logs.zip

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Empieza rastreando el manejo de COPILOT_TASK_WAIT_TIMEOUT_SECONDS y el ciclo de vida de finalización de las tareas en segundo plano en autopilot mode. Reproduce el escenario de seis pasos, verifica si el temporizador de espera se cancela cuando el subagente termina y el elemento padre continúa, y comprueba que cualquier timeout de sesión intencionado informe de un estado de salida distinto de cero.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
shell
Área
cli
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.