[Bug] Anthropic API Error: Premature request_too_large on Manual Compact

Resolved 💬 3 comments Opened Sep 26, 2025 by Ed-Mehrez Closed Sep 30, 2025

Bug Description
I often get "request_too_large" from manually compacting even though there is still context left. I believe it only happens when opus 4.1 is being used and there is difficulty in "handing over" to sonnet 4.

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 1.0.127
  • Feedback ID:

Errors

[{"error":"Error: C07C502C44720000:error:0A0003FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1605:SSL alert number 20\n\n    at sp.from (file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:713:39829)\n    at nK.J1 (file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:10122)\n    at nK.emit (node:events:518:28)\n    at nK.emit (node:domain:489:12)\n    at Sp1.<computed> (file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:25:1161)\n    at ClientRequest.emit (node:events:530:35)\n    at ClientRequest.emit (node:domain:489:12)\n    at emitErrorEvent (node:_http_client:104:11)\n    at TLSSocket.socketErrorListener (node:_http_client:518:5)\n    at TLSSocket.emit (node:events:518:28)\n    at jQ1.request (file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:718:2088)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async eE6 (file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1953:478)\n    at async Promise.all (index 0)\n    at async file:///home/ed/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1939:4614","timestamp":"2025-09-26T23:45:45.035Z"}]

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗