# Deterministic \`editToolCall\` JSON parse failure on \`cursor-agent\` when Anthropic tool\_use is served from Bedrock (Vertex path succeeds identically)

**URL:** <https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927>\
**Category:** Bug Reports\
**Tags:** cli, anthropic\
**Created:** [July 6, 2026, 3:00pm UTC](https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927 "2026-07-06T15:00:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitry\_afk](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@dmitry\_afk](https://forum.cursor.com/u/dmitry_afk)\
**Post date:** [July 6, 2026, 3:00pm UTC](https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927/1 "2026-07-06T15:00:23Z")

</div>

### 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 `system` init event:** `Opus 4.7 (Thinking) 1M Extra High`
- **Runner OS:** RHEL 8 host, container built from `bitnami/openjdk:17-debian-12`  
(JVM host launches `cursor-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-60 `edit_file` calls with 20-90 KB `contents`.

Every `edit_file` tool call in an affected session fails with the same shape:

```auto
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:

```auto
{"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.md` content 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_file` with any large `contents`  
(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 `system` init event:** `Opus 4.7 (Thinking) 1M Extra High`

### Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

---

<div class="post-metadata">

**Author:** ![Colin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/colin/32/90452_2.png) [@Colin](https://forum.cursor.com/u/Colin)\
**Post date:** [July 6, 2026, 4:18pm UTC](https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927/5 "2026-07-06T16:18:46Z")

</div>

Hey @dmitry_afk!

Thanks for the report.

Could you collect [Request IDs](https://cursor.com/help/troubleshooting/reporting-bugs#what-is-a-request-id) – one when the routing goes to Bedrock (where it fails) and one when the routing goes to Vertex, and share them here?

You can collect these from the JSON response:

```auto
{
   "type":"result",
   "subtype":"success",
   "duration_ms":3425,
   "duration_api_ms":3425,
   "is_error":false,
   "result":"Hi! I received your message but \"test\" is a bit ambiguous. What would you like me to help you with?",
   "session_id":"20073db4-dd25-4c4f-b67e-6c4fb818631f",
   "request_id":"5a71cce4-6f36-4b56-841d-e66f35e54d78", <----
   "usage":{
      "inputTokens":6,
      "outputTokens":36,
      "cacheReadTokens":0,
      "cacheWriteTokens":35829
   }

```

---

<div class="post-metadata">

**Author:** ![dmitry\_afk](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@dmitry\_afk](https://forum.cursor.com/u/dmitry_afk)\
**Post date:** [July 7, 2026, 6:20am UTC](https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927/7 "2026-07-07T06:20:25Z")

</div>

We didn’t keep request ids, I’ll will capture those in future.  
Below are the details we have (session ids and tool call ids)

(FAILED, Bedrock)  
session\_id: 91548755-4c55-4cce-ab37-d21dac8e56d9  
call\_id samples:  
toolu\_bdrk\_015S1Fx3UvZXbPAJfUf6UJy9  
toolu\_bdrk\_01Trzt11A9vWcFiEgyopihHZ  
toolu\_bdrk\_01JgDkShqpC22k3wMC94j15Y  
toolu\_bdrk\_01Vh7xSX1Urtc1zqG1bHAWmH  
toolu\_bdrk\_01KHVJAL4aeXTfWh2SoB9G3Y  
toolu\_bdrk\_01W74QBw1EpypAQ41iKtKMHk  
(FAILED, Bedrock)  
session\_id: 6fac0000-f7fe-414a-9283-470c93330249  
call\_id samples:  
toolu\_bdrk\_01NmMX9AmcQ46czrgrkkQLtY  
toolu\_bdrk\_0146qL6aktRoDTewLMp9EUHK  
toolu\_bdrk\_01TwieJ3pcMXc6Jf1XHEUzBu  
toolu\_bdrk\_016vWfSN5mCWJXHDczCbKxoy  
toolu\_bdrk\_01SJsJesJV1oKF65hPmJTCLm  
toolu\_bdrk\_012riUgRhAFMjtjayFr1KmHr  
(SUCCEEDED, Vertex)  
session\_id: 2c5e2b00-d6fc-4493-8580-3965fce1c20d  
call\_id samples:  
toolu\_vrtx\_01Bk4zYpvYJEbrNSJBfdijgc  
toolu\_vrtx\_01DttfMaCbfBnAUjAmMFMp9z  
toolu\_vrtx\_01Vu6KUexzNHycEoEpVs4LFU  
toolu\_vrtx\_014GG3ekrAof6cEG2QigxPND  
toolu\_vrtx\_01MBaZ2G393HrsPH3NMsiouF  
toolu\_vrtx\_01WDwzBQ2oGoV28ffGZNWrxM  
(SUCCEEDED, Vertex)  
session\_id: 4a96271f-9ea6-43f7-b398-4d21203f22fa  
call\_id samples:  
toolu\_vrtx\_01LD352tJs8vBGuRGfsFxDGx  
toolu\_vrtx\_01GnkbZRUF5chNhZJZ2pcP5P  
toolu\_vrtx\_01P4Lnw8w7P1oxFANkWFVSmQ  
toolu\_vrtx\_01SMRxcrpSPpCVQcpSndGxUS  
toolu\_vrtx\_01RxD9KSLh5DALD3qqSGubMi  
toolu\_vrtx\_01XGaoBB3wGzE6DhL1dhPYw5

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [August 13, 2026, 1:39pm UTC](https://forum.cursor.com/t/deterministic-edittoolcall-json-parse-failure-on-cursor-agent-when-anthropic-tool-use-is-served-from-bedrock-vertex-path-succeeds-identically/164927/9 "2026-08-13T13:39:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
