Skip to content

The Copilot CLI will hang after 35 minutes #824

@showpune

Description

@showpune

Hi team,

I found that my application using the Copilot SDK hangs after 35 minutes.

If I use my application to run a long-running job (not idle, like in #212) for more than 35 minutes, I get an error saying the session is idle and has been cleaned up, even though it edited some files several seconds ago.

The below is the sample log

2026-03-13T04:36:55.632Z [DEBUG] Received session.create request: {"model":"claude-sonnet-4.6","sessionId":"7bfbb4ba-73bc-4814-8661-c85d9fa5038c","requestPermission":true,"..."]}
...
2026-03-13T05:11:48.095Z [DEBUG] edit: /testbed/filenamea
...
2026-03-13T05:11:55.597Z [WARNING] Session 7bfbb4ba-73bc-4814-8661-c85d9fa5038c has been idle for 2100s, cleaning up
...
2026-03-13T06:35:59.979Z [DEBUG] Cleaned up event forwarding for session 7bfbb4ba-73bc-4814-8661-c85d9fa5038c
2026-03-13T06:35:59.980Z [INFO] Closing session 7bfbb4ba-73bc-4814-8661-c85d9fa5038c
2026-03-13T06:35:59.980Z [DEBUG] Sending telemetry event: copilot-cli/cli.telemetry (kind: session_shutdown)
2026-03-13T06:35:59.981Z [DEBUG] Sending telemetry event: copilot-cli/cli.telemetry (kind: memory_usage)
2026-03-13T06:35:59.981Z [DEBUG] Flushed 1 events to session 7bfbb4ba-73bc-4814-8661-c85d9fa5038c
2026-03-13T06:35:59.981Z [DEBUG] Flushed 1 events to session 7bfbb4ba-73bc-4814-8661-c85d9fa5038c
2026-03-13T06:35:59.982Z [INFO] Cleaned up stale session: 7bfbb4ba-73bc-4814-8661-c85d9fa5038c

Even I abort the session and resend the continue, it will repot the error session is not exsit as below

2026-03-13T05:17:53.613Z [DEBUG] Received session.abort request: 7bfbb4ba-73bc-4814-8661-c85d9fa5038c
2026-03-13T05:17:53.613Z [ERROR] Session not found or not currently active: 7bfbb4ba-73bc-4814-8661-c85d9fa5038c

Is this a bug or by design in the SDK?

When running the job in Copilot CLI, it can execute for more than 35 minutes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions