GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): stop no longer hangs on an unresponsive Claude runtime by nhorto · Pull Request #7349 · pingdotgg/t3code

Conversation

@nhorto

@nhorto nhorto commented Aug 17, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The problem

ClaudeAdapter.interruptTurn awaited query.interrupt() with no bound. That call writes a control request to the CLI's stdin and waits for an acknowledgement, so a wedged CLI — alive, but no longer answering — makes the promise never settle.

The thread is then unrecoverable from any client. The session projection stays running with active_turn_id pinned to a turn that is already terminal, every further Stop press appends another thread.turn-interrupt-requested that cannot settle, and the only way out is finding the child PID and killing it by hand.

Two knock-on effects are worth calling out, because they make this worse than a dead Stop button:

  • The mobile outbox gates delivery on session.status === "running" (use-thread-outbox-drain.ts:317), so queued messages sit undelivered for as long as the session is stuck.
  • Archiving is refused while a session is running with an activeTurnId (useThreadActions.ts:214), so the user cannot even clear the thread away.

I hit this on a real thread: 30 interrupt events over 44 minutes, all no-ops, against a claude child that had been sleeping at 0.4% CPU with no output for over an hour. SIGTERM on that one PID let the adapter finalize the session immediately, and three queued mobile messages delivered themselves a second later.

This looks like the mechanism behind #4713 and #5587.

The fix

Bound the interrupt at 10 seconds. If the runtime does not acknowledge, tear the session down instead — the same stopSessionInternal path the process exit would have taken, which completes the turn as interrupted and frees the thread.

That teardown had a second unbounded await on the same control channel, caught by Bugbot: stopSessionInternal runs completeTurn, which probes getContextUsage with no bound, so a wedged runtime could stall the escalation in the same place the interrupt did. That probe is now bounded at one second, which covers the normal completeTurn path too. #5891 bounds the same call for the same reason.

The bounded stopTask loop directly above already guards this exact hazard for child tasks, and its comment names it: "Effect.ignore handles rejection, not non-resolution". The parent call was simply missed.

A rejected interrupt() deliberately keeps its existing behavior. Rejections can be benign, and tearing down a healthy session on one would be worse than the bug.

Relationship to #5891

#5891 supersedes this if it merges — it removes interrupt() and stopTask() from interruptTurn entirely in favor of closing the query, so there would be no unbounded await left to bound. I opened this because #5891 has been idle since Aug 9 and this bug is still live on main, but maintainers should take whichever they prefer rather than both.

The two differ in more than size: this keeps the graceful interrupt and only escalates when the runtime proves unresponsive, whereas #5891 always hard-closes. #6531 applies the same "don't block on a provider call that may hang" shape to OpenCode.

Validation

  • vp test run apps/server/src/provider/Layers/ClaudeAdapter.test.ts — 71 passed, including the new case
  • The regression test hangs both interrupt and getContextUsage, since a wedged CLI stops answering its control channel altogether rather than just one request
  • Each bound was reverted independently to confirm the test bites: either one alone leaves the test hanging until the 60s vitest timeout
  • vp lint on both files — clean apart from one pre-existing warning outside the diff
  • vp run --filter t3 typecheck — exit 0

Not audited: whether Codex, Cursor, Grok, or OpenCode share the hazard. They are structurally different (runtime-delegated, ACP, and HTTP abort respectively), and #5587 raises the same question. Worth a separate pass.

Made with Claude Opus 5 (1M context) in T3 Code through the Claude Code harness.


Note

Medium Risk
Changes session stop and teardown paths for Claude threads; mis-tuned timeouts could tear down healthy sessions, but the change replaces indefinite hangs on a known production failure mode.

Overview
Stop no longer blocks forever when the Claude CLI accepts control requests but never answers. interruptTurn still tries query.interrupt() first, but after 10 seconds without acknowledgement it logs claude.turn.interrupt.timeout and tears the session down via stopSessionInternal (turn completes as interrupted, thread unpinned). Rejected interrupts are unchanged.

Teardown was also stalling on the same channel: queryCurrentContextUsage now caps getContextUsage at 1 second so completeTurn cannot hang while escalating after a wedged interrupt.

Tests add a fake runtime that never resolves interrupt/context usage and assert Stop returns, the query closes, and turn.completed is interrupted.

Reviewed by Cursor Bugbot for commit 69b9d6e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix interruptTurn hang when Claude runtime is unresponsive

  • interruptTurn in ClaudeAdapter.ts now bounds the query.interrupt call with a 10-second timeout; on timeout it logs a warning and force-stops the session via stopSessionInternal, emitting exit events.
  • queryCurrentContextUsage now wraps getContextUsage in a 1-second timeout, returning undefined instead of hanging indefinitely.
  • Behavioral Change: sessions that previously hung forever on an unresponsive runtime will now be torn down after 10 seconds with an interrupted turn.completed event.

Macroscope summarized 69b9d6e.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nhorto @claude
fix(server): stop no longer hangs on an unresponsive Claude runtime
2e4b3b1
Claude's interruptTurn awaited query.interrupt() with no bound. A wedged
CLI never answers that control request, so Stop hung forever: the session
projection stayed `running`, every later Stop press queued another
interrupt that could not settle, queued client messages never drained,
and the thread could not even be archived. Recovery meant hunting the
child PID and killing it by hand.

The interrupt is now bounded at 10 seconds, and a runtime that will not
acknowledge is torn down instead — the same path its own process exit
takes, which completes the turn and frees the thread. The bounded
stopTask loop directly above already guarded this exact hazard for child
tasks; the parent call was missed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 958c2727-9ee9-4ea1-a1c4-c06c543ba456

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Aug 17, 2026
@nhorto nhorto mentioned this pull request Aug 17, 2026
Thread session stuck in running after turn interrupt — stop button becomes a no-op #4713
Closed
@github-actions github-actions Bot added the size:S 10-29 changed lines (additions + deletions). label Aug 17, 2026
@nhorto nhorto mentioned this pull request Aug 17, 2026
Interrupting a turn does not kill the claudeAgent child process — thread appears unstoppable #5587
Closed
cursor[bot]
cursor Bot reviewed Aug 17, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2e4b3b1. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Layers/ClaudeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Aug 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 69b9d6e

Macroscope's review found this PR approvable — This is a straightforward bug fix that adds timeouts to prevent indefinite hangs when the Claude runtime becomes unresponsive. The changes are limited in scope (two timeout additions), well-documented with comments explaining the reasoning, and include comprehensive test coverage.

You can add or adjust custom eligibility rules. Learn more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nhorto @claude
fix(server): bound the context-usage probe on the teardown path
69b9d6e
Bugbot caught that the escalation could hang where the interrupt did.
stopSessionInternal runs completeTurn, which probes getContextUsage over
the same control channel that just failed to answer, and that await was
unbounded — so a wedged runtime could stall the very teardown meant to
free the thread.

Bound it at one second. A skipped context-meter refresh is invisible
next to a stranded turn.

The regression test now hangs its getContextUsage too, since a wedged
CLI stops answering the channel altogether rather than just the
interrupt. The previous fake omitted the method, so it only ever
exercised the short-circuit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
macroscopeapp[bot]
macroscopeapp Bot approved these changes Aug 18, 2026
View reviewed changes
@t3dotgg

t3dotgg commented Aug 23, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-5.6 Sol responding on behalf of Theo

Closing this PR after an automated pass over open pull requests. The same Claude stop behavior already shipped in #5891.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Aug 23, 2026
@ImBIOS ImBIOS mentioned this pull request Aug 29, 2026
fix(remote): stop button gives immediate feedback and prevents stuck thinking on remote server #8619
Closed
@Adamulek123 Adamulek123 mentioned this pull request Oct 7, 2026
Interrupt timeouts report a terminal status for work that may still be running #16844
Closed
pechhe added a commit to pechhe/t3code that referenced this pull request Nov 10, 2026
@pechhe
feat(server): bounded browser tasks name their fault, offer candidate…
c7bae68
… targets and leave a record

One t3_browser_task tool replaces preview_task; every call is recorded in the
state database and read by `t3 browser report`.

Forge: T3-571
Build: pingdotgg#7349
pechhe added a commit to pechhe/t3code that referenced this pull request Nov 13, 2026
@pechhe
fix(server): return selectable candidates for repeated browser targets
9dcf726
Ambiguous bindings lost every candidate when names and named ancestors could not distinguish their matches.

Add an optional one-based target ordinal as a deterministic fallback, list every ambiguous match, and preserve named-ancestor targeting and ambiguity refusal. Cover the refusal and explicit retry, and add model-facing guidance and an eval case.

Model: gpt-6.1-sol; harness: Codex in T3 Code.
Forge: T3-571
Build: pingdotgg#7349

fix(server): guard browser candidate ordinals and bound replies

Build: pingdotgg#7349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@nhorto @t3dotgg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.