Skip to content

Auto-settle on merge closes Claude's wake turn about 70 ms after an awaited background task finishes, with no manual settle #39385

Closed as duplicate

Description

@mvanhorn

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

This is the follow-up #39366 asked for: the same race, from a production thread where nobody settled anything by hand.

  1. Use a long-running Claude thread on the desktop app with sidebarAutoSettleOnMerge at its default. Link the thread to a PR that has already merged and has a PR watch on it. Here, the agent had merged its own PR, in a private repo, earlier in the thread.
  2. The agent starts a Bash command with run_in_background, registers it with t3_background_wait, and ends its turn. In my thread this was a deploy poll that finished about 7 s after the turn ended.
  3. Wait for the command to exit.

I can't give a repro that fails every time. Julius's runs in #39366 saw the settle check land 0.3 to 3 s after the notification, which is after the wake attaches. In my thread it landed about 19 ms after, by the server's own clock. I don't know what makes the sweep fire that fast. The differences I can see from Julius's setup: the desktop app rather than the web app, a 54-run thread with about 1,500 items, four merged linked PRs, and an active PR watch on the merged one.

Expected behavior

Claude's wake turn runs, the agent reads the task output and continues, and the thread settles after that turn.

Actual behavior

ThreadSettlementService dispatched thread.auto-settle about 19 ms after the provider-thread write for the finished task. T3 sent query.close 71 ms after the task_notification. By then the CLI had already dequeued the notification and started its wake turn, but T3 had not seen its init. The CLI kept running for about 2.7 s and issued a Bash call to read the output, then died. The thread showed as settled and the agent never woke. When I sent a message 17 minutes later, the resumed transcript held an interrupted tool result and a synthetic "No response requested."

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Beta) 0.1.9 desktop, Claude Code 2.1.326

Environment

macOS 27.2, desktop app, Claude Agent SDK, claude-opus-5-5, GitHub PRs, sidebarAutoSettleOnMerge at default

Logs or stack traces

Provider event log (events.<thread>.log, T3's clock):

17:53:28.727Z  run 54 completes (the agent's turn ends after t3_background_wait)
17:53:36.144Z  in   system/task_updated              task b7w1f8fur status=completed
17:53:36.146Z  in   system/task_notification         task b7w1f8fur status=completed
17:53:36.147Z  in   system/background_tasks_changed  tasks=[]
17:53:36.217Z  out  query.close                      <- 71 ms after the notification, no init seen
(nothing until my next message at 18:10:49Z)

Server trace (desktop.trace.ndjson, the server's own clock, about 0.5 s behind the provider log's timestamps):

17:53:35.642  orchestrationV2.EventSink.writeIfProviderThreadOwner
17:53:35.661  orchestrationV2.dispatch.withReceipt  command_type=thread.auto-settle
17:53:35.663  orchestrationV2.dispatch.once         command_type=thread.auto-settle

Claude CLI transcript for the same session (~/.claude/projects/.../bed8423d-....jsonl):

17:53:36.142Z  queue-operation enqueue   <task-notification> b7w1f8fur
17:53:36.154Z  queue-operation dequeue                           <- the CLI's wake turn starts
17:53:36.538Z  api-request
17:53:38.890Z  assistant tool_use Bash "tail -2 .../tasks/b7w1f8fur.output"
(session ends; T3 never received any of this)
18:10:47.791Z  user tool_result: "[Tool call interrupted: the session ended before this call's result was recorded ...]"
18:10:47.791Z  assistant <synthetic> "No response requested."

The trace file has since rotated, so I only have the spans above, not the full trace.

Screenshots, recordings, or supporting files

None. I can share the full provider event log for the thread if that helps.

Workaround

Send the thread a message after the task finishes. The agent resumes and reads the output.

Activity

  1. juliusmarminge commented on Nov 19, 2026

    @juliusmarminge
    Member

    This is the same problem as #34568, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

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

    vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions