Temp fix: don't advertise readOnlyHint to Cursor under HITL (unblocks approval banner)#40
Open
pragati-agrawal-glean wants to merge 1 commit into
Open
Temp fix: don't advertise readOnlyHint to Cursor under HITL (unblocks approval banner)#40pragati-agrawal-glean wants to merge 1 commit into
pragati-agrawal-glean wants to merge 1 commit into
Conversation
Cursor 3.12.x only renders a server-initiated elicitation on its attended tool-call lane. run_tool marked readOnlyHint:true lands on Cursor's auto-run lane, where the HITL approval elicitation is silently dropped — producing a 5-minute silent hang and a fail-closed timeout with no approval banner. Cursor also strips tool `annotations` on ingest (and has zero references to readOnlyHint in its bundle), so the hint never suppressed a native prompt there anyway. Thread the client identity into runToolAnnotations and omit readOnlyHint when the client is Cursor (clientInfo.name starts with "cursor"), keeping run_tool on the interactive lane so the banner renders. Claude Code is unaffected: it renders elicitation regardless of lane, and the hint still suppresses its native prompt. Temporary until the Cursor-side rendering regression is fixed upstream. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pragati-agrawal-glean
force-pushed
the
fix/cursor-disable-readonlyhint-hitl
branch
from
July 21, 2026 17:37
f8d8136 to
0d6750d
Compare
pragati-agrawal-glean
marked this pull request as ready for review
July 21, 2026 17:37
pragati-agrawal-glean
requested review from
eshwar-sundar-glean,
garvit-scio,
mohit-gupta-glean and
swarup-padhi-glean
as code owners
July 21, 2026 17:37
swarup-padhi-glean
approved these changes
Jul 21, 2026
swarup-padhi-glean
left a comment
Contributor
There was a problem hiding this comment.
Can we also have a demo video in the PR?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Temp fix — unblocks the Cursor HITL approval banner
Symptom: In Cursor,
requires_approvalactions viarun_toolhang ~5 minutes with no approval banner, then fail closed. Works fine in Claude Code.Root cause (investigated, evidence-backed): a Cursor client regression between 3.10.20 → 3.12.17, not a plugin or SDK change.
readOnlyHint:trueonrun_toolis git-constant since 2026-06-15; theelicitation/createpayload is byte-identical regardless of the annotation (verified with an SDK 1.29.0 in-memory harness).readOnlyHint:truerun_tool rendered and got a 16-second human decline; after auto-update to 3.12.17, the same call times out at exactly 300000ms with no UI, twice.readOnlyHint(0 references in the entire Cursor bundle;annotationsstripped on ingest) pushesrun_tooltoward the non-interactive lane.This change: thread client identity into
runToolAnnotationsand omitreadOnlyHintfor Cursor (clientInfo.namestarts withcursor) so the call stays on the interactive lane and the banner renders. Claude Code keepsreadOnlyHint:true(renders regardless of lane; hint still suppresses its native prompt). Losing the hint on Cursor costs nothing — Cursor strips tool annotations anyway.Scope: deliberately minimal, isolated from PR #39 (which chased the now-disproven empty-schema hypothesis). Temporary until the Cursor-side rendering regression is fixed upstream.
Validation
npm run typecheckclean;npx vitest run189/189, incl. a new case asserting Cursor gets noreadOnlyHint.requires_approvalaction should now show the Approve/Deny banner instead of hanging. This is also the decisive A/B for the root cause — if it renders with the hint gone and hangs with it present (same version, same machine),readOnlyHintis proven the discriminator.Known caveats / follow-ups
readOnlyHint— then this is a no-op and we pursue the run-mode angle + upstream Cursor fix.getClientCapabilities()?.elicitationtruthy, but the SDK'selicitInputrequires.elicitation.form— a bare-elicitation client would throw.🤖 Generated with Claude Code