Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(grok): stop Working after 10 minutes of silence #7215

Closedgb1095(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7215/headopened View on GitHub

Fixes #7210.

A Grok turn sat on Working for 74 minutes after the last tool finished. The stream died mid-reasoning. No turn_ended. The UI never gave up.

After ten minutes with no tokens, tools, or terminal events, the turn now fails and Working stops. The timer does not run during tools, approvals, or user input. Existing threads and other clients already share that turn state.

Most of the diff is the watchdog plus tests.

Validation: vp test run apps/server/src/provider/Layers/GrokAdapter.test.ts (25 passed).

Created with GPT-5.6 Luna via Codex CLI, reviewed and finalized in the T3 Code Codex harness.

Note

Fix stalled ACP turns in GrokAdapter by adding a liveness watchdog

  • Adds a liveness watchdog to GrokAdapter.ts that monitors turn activity and fails stalled turns after an inactivity deadline, but only after ACP has emitted observable progress (content, plan update, tool activity, or user input resolution).
  • Pauses the watchdog during pending approvals and user-input requests, and resumes it on resolution; refreshes the liveness window on steering turns and plan updates.
  • Uses a longer inactivity timeout while tool calls are in progress, tracked via an active tool call set.
  • Extends acp-mock-agent.ts with env-controlled stall modes to simulate hangs after content, plan updates, active tools, or ask_user_question responses for testing.
  • Behavioral Change: turns that stall after emitting any progress will now be failed with a turn completion event after the inactivity deadline; turns silent before any ACP progress are not timed out.
Macroscope summarized fa5736c.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: 0b8fdbae-3b9b-414d-9f51-8addc2aed5ba

      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
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR adds a watchdog mechanism that terminates stalled Grok ACP turns after configurable timeouts. While well-tested, it introduces significant runtime behavior changes to core session management and is authored by someone new to this file.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 26f6529523843f873eac818d12406a5739641e43. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. gb1095(GitHub profile, opens in a new tab) changed the title

    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      I am closing this because #8358 has landed in main and covers the same Grok stalled-turn watchdog behavior. I checked the current implementation and did not find any remaining change from this PR that we still need to merge.

      Thank you for putting this together. The closure is only because the work is now covered elsewhere, not because there was a problem with your contribution.

Sign in to join this conversation.