Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
Every edit_file tool call is unparseable (position 125, missing comma between
path and contents) when the Anthropic model instance is served from AWS
Bedrock; identical calls succeed 100 % when routing lands on Google Vertex.
- Product: Cursor Agent CLI,
2026.05.28-a70ca7c(running under
--print --output-format stream-json --model claude-opus-4-7). - Deployment: headless, non-interactive, one CLI invocation per microservice.
- Model alias requested:
claude-opus-4-7 - Model as reported by CLI on
systeminit event:Opus 4.7 (Thinking) 1M Extra High - Runner OS: RHEL 8 host, container built from
bitnami/openjdk:17-debian-12
(JVM host launchescursor-agent). - Network: corporate network with HTTPS_PROXY to
api2.cursor.sh; no proxy
transformation on the tool call payloads (proxy is TLS pass-through). - Approx. workload per invocation: 30-45 minute session, 150-250 tool calls,
including 30-60edit_filecalls with 20-90 KBcontents.
Every edit_file tool call in an affected session fails with the same shape:
JSON.parse error: Expected ',' or '}' after property in object at position 125
The byte 125 sits immediately after the path field value in the tool_use
arguments, i.e. the model appears to have emitted:
{"path":"/tmp/.../output/ApiProfile.md""contents": …
^ missing comma
The CLI retries via its checkpoint mechanism (rewind to last valid state and
re-emit). Because the checkpoint restores the same model state, the same
malformed argument is re-emitted and the retry hits the same parse error at the
same byte position. After several attempts the CLI aborts with
resource_exhausted and the process exits non-zero.
What we can rule out
- Not content-driven. The identical
ApiProfile.mdcontent that fails in
one session was verified re-writable in a fresh cursor-agent session on a
different network path. - Not path-length-driven. The absolute path (~120-160 chars) writes cleanly
in isolated reproduction with the same tool schema on newer CLI builds. - Not CLI-version-driven. The 2026.05.28 CLI ships work when routing
lands on Vertex, so the binary itself is capable of parsing valid tool_use. - Not model-alias-driven. Same alias (
claude-opus-4-7) succeeds in the
Vertex-routed sessions. - Not prompt-driven. Same prompt template, same repo checkout, same
cursor-agent args between failing and succeeding sessions.
What we CAN correlate — with hard numbers
We enumerated the Anthropic tool_use.id prefix (toolu_bdrk_ vs
toolu_vrtx_) across 6 sessions in the same pipeline for the same
microservice..
100% correlation: toolu_bdrk_ sessions parse-fail every attempt; toolu_vrtx_
sessions parse-clean every attempt. No mixed-prefix session was observed —
routing is stable per invocation.
Steps to Reproduce
- Reproduction depends on routing choice, which we do not control from the CLI.
We have not been able to reproduce on a fresh account (routing there landed
on Vertex). - On the affected account, submitting a
edit_filewith any largecontents
(30+ KB) reliably hits the failure while the account is being routed to
Bedrock.
Expected Behavior
edit tool call succeeds and not fails on json parse.
Operating System
Linux
Version Information
- Product: Cursor Agent CLI,
2026.05.28-a70ca7c(running under
--print --output-format stream-json --model claude-opus-4-7). - Deployment: headless, non-interactive, one CLI invocation per microservice.
For AI issues: which model did you use?
- Model alias requested:
claude-opus-4-7 - Model as reported by CLI on
systeminit event:Opus 4.7 (Thinking) 1M Extra High
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor