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): Grok API errors fail the run instead of completing it empty by juliusmarminge · Pull Request #14487 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 30, 2026 •
edited by devin-ai-integration Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

When Grok's API rejected a prompt (seen with an outdated CLI: 426 Upgrade Required), the thread showed an empty reply and the run was marked completed.

Grok signals a failed prompt with stopReason: "error" and puts the API message in agentResult, and this notification arrives before the session/prompt RPC error. The xAI prompt race in XAiAcpExtension.ts accepted that completion, mapped the unknown stop reason to end_turn, and then interrupted the RPC fiber that carried the real error. The adapter finalized the turn as completed with no items.

Now a completion with stopReason: "error" fails the prompt using Grok's own message (read from both _x.ai/session/prompt_complete and turn_completed.agent_result). The run then fails with a provider_error that shows the message, just as rate_limit already failed with usage_limit.

Test: a new grok_prompt_error replay fixture, recorded from real Grok 1.0.44 through a local proxy that fails only the first model request. Its messages match the incident exactly: retry_state failed, then turn_completed with stop_reason: "error", then prompt_complete, then the RPC error. The test asserts that run 1 fails with the API message and that the follow-up run completes, so the session is still usable. The fixture fails without the fix and passes with it. All Grok replays and the xAI/Grok unit tests pass.

Done by Claude Opus 5.5 in Claude Code (via T3 Code).

🤖 Generated with Claude Code


Devin Review

Sorry, something went wrong.

Uh oh!

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

All reactions
@juliusmarminge @claude
fix(server): Grok API errors fail the run instead of completing it empty
811263a
Grok settles a failed prompt with stopReason "error" and the API message in
agentResult before its session/prompt RPC error arrives. The xAI prompt race
took that completion as end_turn and interrupted the RPC that carried the
error, so the run completed with no output. Fail the prompt with Grok's
message instead, and cover it with a replay fixture recorded from Grok 1.0.44.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 30, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Sep 30, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Sep 30, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Sep 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 8a01cc0

Macroscope's review found this PR approvable — This is a narrow Grok ACP bug fix that converts an incorrectly empty successful run into a provider error while preserving follow-up prompts. The production logic is isolated and covered by a replay fixture asserting both failure reporting and session recovery.

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.

@github-actions

github-actions Bot commented Sep 30, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.7 KiB — 29.3 KiB ✅
Claude Live turn messages — 1 — 8 ✅

Baseline: unavailable · PR result: 8a01cc0 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

All reactions

Sorry, something went wrong.

Uh oh!

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

@juliusmarminge juliusmarminge mentioned this pull request Sep 30, 2026
fix(server): Grok's reply to a finished background command opens its own run #14488
Merged
@juliusmarminge @claude
test(server): keep the Grok prompt error text local to its fixture
8a01cc0
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@macroscopeapp
macroscopeapp Bot dismissed their stale review September 30, 2026 23:11

Dismissing prior approval to re-evaluate 8a01cc0

macroscopeapp[bot]
macroscopeapp Bot approved these changes Sep 30, 2026
View reviewed changes
@juliusmarminge
juliusmarminge merged commit f82eb0f into t3code/codex-turn-mapping Sep 30, 2026
23 checks passed

Uh oh!

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

@juliusmarminge
juliusmarminge deleted the t3code/grok-prompt-error-fails-run branch September 30, 2026 23:18
@anesthetised anesthetised mentioned this pull request Oct 18, 2026
ACP v2 idle errors are discarded and failed turns are marked completed #21219
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@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

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or 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.

1 participant

@juliusmarminge
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.