Skip to content

fix(acp): show why an agent's turn produced no answer - #446

Merged
Waishnav merged 1 commit into
mainfrom
fix/acp-error-detail
Oct 30, 2026
Merged

Waishnav merged 1 commit into
mainfrom
fix/acp-error-detail

Conversation

@Waishnav

Copy link
Copy Markdown
Owner

During QA, Grok failed with acp ACP did not return a final assistant response. and nothing else. The real cause was a 401: Grok wasn't signed in. Two things hid it. Every ACP error message used the driver kind (acp) instead of the agent, and when a turn ended without assistant text the error's only cause was the bare prompt response, which DevSpace's error detail can't render.

Reproducing the exact failure (Grok's full config without its auth.json) showed why the 401 never surfaced: Grok sends nothing over ACP but { "stopReason": "error" }, with no message, no session updates, and only model listings on stderr. The 401 exists only in Grok's own log, ~/.grok/logs/unified.jsonl, as a turn.terminal_failure entry for the session.

ACP error messages now name the agent (grok ACP, cursor ACP, copilot ACP, or ACP agent). A turn without assistant text reports the stop reason, the update kinds received, and the tail of the agent's stderr. For Grok it also reads the session's terminal failure from the end of its log: a bounded, best-effort read keyed by session ID. If the entry isn't found, it falls back to a hint pointing at the log and the login. Secrets in the detail still go through the existing redaction.

Verified against the real Grok CLI in the reproduced signed-out state: the error is now grok ACP did not return a final assistant response. with detail Unauthorized (401) … Invalid or expired credentials …; stop reason: error; …, with the token value redacted. A signed-in Grok run still completes normally. Unit tests cover the detail summary and the log lookup, including other sessions' entries and a missing log.

Stacked on #445.

🤖 Generated with Claude Code

When an ACP agent ended a turn without assistant text, DevSpace said
"acp ACP did not return a final assistant response" with no detail:
the label was the driver kind, and the cause was only the bare prompt
response. Grok in particular reports a failed turn only as
stopReason "error" and writes the cause, such as a 401 for an expired
login, to its own log.

The error now names the agent (grok ACP, cursor ACP), and its detail
carries the stop reason, the update kinds received, the agent's recent
stderr, and for Grok the session's terminal failure read from the end
of ~/.grok/logs/unified.jsonl, with a login hint when none is found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-acp-error-detail-devspace-site.waishnav.workers.dev (commit 44cae76)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://014b71af-devspace-site.waishnav.workers.dev 44cae76 2026-10-30T11:55:13.296Z Visit the dashboard ↗

@Waishnav
Waishnav changed the base branch from fix/acp-model-base-names to main October 30, 2026 12:07
@Waishnav
Waishnav merged commit 6baff94 into main Oct 30, 2026
4 of 5 checks passed
@Waishnav
Waishnav deleted the fix/acp-error-detail branch October 30, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant