[Bug] Anthropic API Error: Invalid cache_control TTL ordering in request
Resolved 💬 3 comments Opened Mar 24, 2026 by brentrbutcher Closed Mar 28, 2026
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","mes
sage":"messages.184.content.1.cache_control.ttl: a ttl='1h' cache_control
block must not come after a ttl='5m' cache_control block. Note that blocks
are processed in the following order: tools, system,
messages."},"request_id":"req_011CZNF4HneDEzZEVmaYG1az"}
Environment Info
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.81
- Feedback ID: 022dec0e-55f4-4099-9376-05a310dda235
Errors
[{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:26:05.109Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:26:20.477Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:27:34.306Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:27:55.819Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:29:26.116Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:32:57.259Z"},{"error":"MaxFileReadTokenExceededError: File content (23887 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at gT9 (/$bunfs/root/src/entrypoints/cli.js:4312:23670)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-03-24T15:33:37.012Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:71:14396)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:12946)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗