Skip to content

[Bug]: Stopping the CLI mid tool call: completed call shown as failed, session unresumable, checkout held #916

Open

Description

@Bai-009

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Version and environment (optional)

Astra 0.2.10 (MOI client bundle 2026.09.28.1), MOI developer mode (CLI + MOI-hosted Server, local tool execution), macOS 27.0 arm64, model deepseek-v4-flash

Actual behavior

I stopped the CLI with SIGTERM while it was executing a local bash call that takes 25 s and writes a file.

  1. The command kept running and completed. Its child shell was still running after the CLI exited, and the file was written (marker.txt contained done).
  2. The audit reports the call as failed. astra audit turns <session> shows the bash call with ok: false, duration_ms: 100381 and the error tool_call_end did not complete successfully. Nothing user-visible says the outcome is unknown, although the side effect happened.
  3. The run kept going without a runner. In the same turn, list_dir and read_file calls followed; both waited about 58 s and then failed with the same error.
  4. The session cannot be continued. astra chat --session-id <session> -m "..." fails with Error: selected Server session <session> has no authoritative restore bundle.
  5. The checkout stays held. Continuing a different, already completed session from the same directory fails with Checkout temporarily unavailable: Session <session>: an execution still holds the checkout. Wait for it to finish, or stop it with astra session cancel <session> and retry. It worked only after astra session cancel <session>.

Expected behavior

Based on docs/design/capability-provider-runtime.md ("Dispatch may have occurred → OutcomeUnknown; reconcile or request explicit decision"; "Client disconnects → Durable execution continues; reconnect replays durable bounded projections") and docs/design/durable-work-user-journey.md ("Preserve ambiguous side effects as unresolved"; "Old Session is idle in the selected checkout → Admit a fresh conversation after fenced idle-claim release"):

  • A call whose dispatch may have happened is shown as outcome-unknown in the audit and in the session, not as failed.
  • Once the CLI runner is gone, the run stops sending new calls to it and settles with a clear reason instead of waiting for each call to time out.
  • The session can be continued after reconnecting, or the CLI explains how to recover it.
  • The checkout is released when the run settles, so other sessions in the same directory are not blocked.

Steps to reproduce

  1. In a scratch directory, run:

    timeout -s TERM 20 astra chat --no-resume --permission-mode auto -m "Run this command in the current directory: sleep 25 && echo done > marker.txt, then tell me the content of marker.txt."
  2. After the CLI exits, confirm that marker.txt appears a few seconds later.

  3. Run astra audit turns <session> for the new session.

  4. Run astra chat --session-id <session> -m "What happened to the previous command?".

  5. From the same directory, continue another session with astra chat --session-id <other-session> -m "...".

Additional information

Activity

  1. added
    kind/bug
    on Sep 29, 2026
  2. XuPeng-SH commented on Oct 20, 2026

    @XuPeng-SH
    Collaborator

    PR #1051 improves bounded child-process cleanup and #1064/#1079 cover explicit SIGINT/interactive cancellation, but this report's trigger is SIGTERM. Those changes do not establish that SIGTERM stops further tool dispatch, records an honest unknown outcome, settles the run, releases checkout ownership, and leaves the Session resumable. Keep this open for a deterministic SIGTERM public-process regression across those canonical lifecycle facts; do not treat process exit or child cleanup alone as proof of settlement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions