claude-code - 💡(How to fix) Fix [Bug] Excessive token consumption rate with single agent at max_requests=5 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49209Fetched 2026-04-17 08:47:47
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1subscribed ×1

Error Message

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (631 -> 631 messages). Message structure: [0] user; [1] assistant(id=msg_01Kt9M6fMeFFBNqKpajzzVZb, tool_uses=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [2] user(tool_results=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [3] assistant(id=msg_01Wc6rqe7ERZDCwtxR98MWc3, tool_uses=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [4] user(tool_results=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [5] assistant(id=msg_019f7G92KNcuod8TBvL1P4fm, tool_uses=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [6] user(tool_results=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [7] assistant(id=msg_01FEPJs468ELuiLo5ZDq5s9D, tool_uses=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [8] user(tool_results=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [9] assistant(id=msg_01Nw2w9xujthF6cYjJ7F9P7Y, tool_uses=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [10] user(tool_results=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [11] assistant(id=msg_01UNdjUWGKkqR28z9BCF8dSe, tool_uses=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [12] user(tool_results=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [13] assistant(id=msg_01NizGCtbZyEYyHu2LeRFsvW, tool_uses=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [14] user(tool_results=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [15] assistant(id=msg_01Ncx3F9Yet3vDekQcvt2RMQ, tool_uses=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [16] user(tool_results=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [17] assistant(id=msg_0188JpgsGWCwPTwjDUkhHSLQ, tool_uses=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [18] user(tool_results=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [19] assistant(id=msg_01MEe4jpYYUpTiPW4ref9489, tool_uses=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [20] user(tool_results=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [21] assistant(id=msg_01EHswKxYPq9RbdBijCksKUq, tool_uses=[toolu_01Rzv624b4TsqSXDu847ufQb]); [22] user(tool_results=[toolu_01Rzv624b4TsqSXDu847ufQb]); [23] assistant(id=msg_01QYXAuHjQ5HmUgMohwvVp4y, tool_uses=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [24] user(tool_results=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [25] assistant(id=msg_01G9DYqF4UFmuw3ShdQTQVdA, tool_uses=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [26] user(tool_results=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [27] assistant(id=msg_01RG8cWhGR5EyyENvgDQVM4g, tool_uses=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [28] user(tool_results=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [29] assistant(id=msg_01RxLoCXgPrXzEKNgupQRWbn, tool_uses=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [30] user(tool_results=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [31] assistant(id=msg_01HCuSQFBUE8NfN5Hw1V7jCM, tool_uses=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [32] user(tool_results=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [33] assistant(id=msg_01HZEiCXQ3722fAUBiGsUZmh, tool_uses=[toolu_01BW9ZseqafVotJZGFoE9biv]); [34] user(tool_results=[toolu_01BW9ZseqafVotJZGFoE9biv]); [35] assistant(id=msg_017X29V2EGeLBvNhWMPpH6FW, tool_uses=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [36] user(tool_results=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [37] assistant(id=msg_017nSXi8AFgqKAMVTRPubM7G, tool_uses=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [38] user(tool_results=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [39] assistant(id=msg_016Bqxrzvvx7nkvv7G5jtkK9, tool_uses=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [40] user(tool_results=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [41] assistant(id=msg_01FWU6eejKYireq6tV8CqmQJ, tool_uses=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [42] user(tool_results=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [43] assistant(id=msg_01R9t2meQDTTQAsDRhcyjzKP, tool_uses=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [44] user(tool_results=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [45] assistant(id=msg_018S5G49dwQFmmKpt1gggn9e, tool_uses=[toolu_01KisLcTaqwaBGXTKBKBehue]); [46] user(tool_results=[toolu_01KisLcTaqwaBGXTKBKBehue]); [47] assistant(id=msg_01Lu69xTxNBus2GtmnWpuwnt, tool_uses=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [48] user(tool_results=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [49] assistant(id=msg_01AYxT5HGsQk8ZHt11RhEmWn, tool_uses=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [50] user(tool_results=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [51] assistant(id=msg_01KyZ3GGYRw8NLykMNhSKKta, tool_uses=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [52] user(tool_results=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [53] assistant(id=msg_011a8PtJPiNNvWUBuby6GFNr, tool_uses=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [54] user(tool_results=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [55] assistant(id=msg_019MYVQzg7fcdQC9YW4KppC…

Code Example

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (631 -> 631 messages). Message structure: [0] user; [1] assistant(id=msg_01Kt9M6fMeFFBNqKpajzzVZb, tool_uses=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [2] user(tool_results=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [3] assistant(id=msg_01Wc6rqe7ERZDCwtxR98MWc3, tool_uses=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [4] user(tool_results=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [5] assistant(id=msg_019f7G92KNcuod8TBvL1P4fm, tool_uses=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [6] user(tool_results=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [7] assistant(id=msg_01FEPJs468ELuiLo5ZDq5s9D, tool_uses=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [8] user(tool_results=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [9] assistant(id=msg_01Nw2w9xujthF6cYjJ7F9P7Y, tool_uses=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [10] user(tool_results=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [11] assistant(id=msg_01UNdjUWGKkqR28z9BCF8dSe, tool_uses=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [12] user(tool_results=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [13] assistant(id=msg_01NizGCtbZyEYyHu2LeRFsvW, tool_uses=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [14] user(tool_results=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [15] assistant(id=msg_01Ncx3F9Yet3vDekQcvt2RMQ, tool_uses=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [16] user(tool_results=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [17] assistant(id=msg_0188JpgsGWCwPTwjDUkhHSLQ, tool_uses=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [18] user(tool_results=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [19] assistant(id=msg_01MEe4jpYYUpTiPW4ref9489, tool_uses=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [20] user(tool_results=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [21] assistant(id=msg_01EHswKxYPq9RbdBijCksKUq, tool_uses=[toolu_01Rzv624b4TsqSXDu847ufQb]); [22] user(tool_results=[toolu_01Rzv624b4TsqSXDu847ufQb]); [23] assistant(id=msg_01QYXAuHjQ5HmUgMohwvVp4y, tool_uses=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [24] user(tool_results=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [25] assistant(id=msg_01G9DYqF4UFmuw3ShdQTQVdA, tool_uses=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [26] user(tool_results=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [27] assistant(id=msg_01RG8cWhGR5EyyENvgDQVM4g, tool_uses=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [28] user(tool_results=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [29] assistant(id=msg_01RxLoCXgPrXzEKNgupQRWbn, tool_uses=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [30] user(tool_results=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [31] assistant(id=msg_01HCuSQFBUE8NfN5Hw1V7jCM, tool_uses=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [32] user(tool_results=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [33] assistant(id=msg_01HZEiCXQ3722fAUBiGsUZmh, tool_uses=[toolu_01BW9ZseqafVotJZGFoE9biv]); [34] user(tool_results=[toolu_01BW9ZseqafVotJZGFoE9biv]); [35] assistant(id=msg_017X29V2EGeLBvNhWMPpH6FW, tool_uses=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [36] user(tool_results=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [37] assistant(id=msg_017nSXi8AFgqKAMVTRPubM7G, tool_uses=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [38] user(tool_results=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [39] assistant(id=msg_016Bqxrzvvx7nkvv7G5jtkK9, tool_uses=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [40] user(tool_results=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [41] assistant(id=msg_01FWU6eejKYireq6tV8CqmQJ, tool_uses=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [42] user(tool_results=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [43] assistant(id=msg_01R9t2meQDTTQAsDRhcyjzKP, tool_uses=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [44] user(tool_results=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [45] assistant(id=msg_018S5G49dwQFmmKpt1gggn9e, tool_uses=[toolu_01KisLcTaqwaBGXTKBKBehue]); [46] user(tool_results=[toolu_01KisLcTaqwaBGXTKBKBehue]); [47] assistant(id=msg_01Lu69xTxNBus2GtmnWpuwnt, tool_uses=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [48] user(tool_results=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [49] assistant(id=msg_01AYxT5HGsQk8ZHt11RhEmWn, tool_uses=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [50] user(tool_results=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [51] assistant(id=msg_01KyZ3GGYRw8NLykMNhSKKta, tool_uses=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [52] user(tool_results=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [53] assistant(id=msg_011a8PtJPiNNvWUBuby6GFNr, tool_uses=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [54] user(tool_results=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [55] assistant(id=msg_019MYVQzg7fcdQC9YW4KppC…
RAW_BUFFERClick to expand / collapse

Bug Description quick depletion of usage - 52 percent token usage in 12 mins on max 5 - one agent running.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.110
  • Feedback ID: d43147ac-94da-4863-bacd-9ebaa2327353

Errors

[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (631 -> 631 messages). Message structure: [0] user; [1] assistant(id=msg_01Kt9M6fMeFFBNqKpajzzVZb, tool_uses=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [2] user(tool_results=[toolu_01M7mYNjus4g49wosoQJXCqJ]); [3] assistant(id=msg_01Wc6rqe7ERZDCwtxR98MWc3, tool_uses=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [4] user(tool_results=[toolu_01V5mRLZJGrp3rfTTLQN2mDU,toolu_01FxjSbcCu9eEN3PHfG2cbNu]); [5] assistant(id=msg_019f7G92KNcuod8TBvL1P4fm, tool_uses=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [6] user(tool_results=[toolu_01YVnY8KKDWfQ1dxBo3s62Ei,toolu_01QDocA8TCszExzv5Xx3Ckrh]); [7] assistant(id=msg_01FEPJs468ELuiLo5ZDq5s9D, tool_uses=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [8] user(tool_results=[toolu_01UPbo1T7Zksn8LQ75CBRkig,toolu_01RKLise6cPREd3T8M2jm1U2,toolu_0111JXZFC5nDxThpyMzBUyAz]); [9] assistant(id=msg_01Nw2w9xujthF6cYjJ7F9P7Y, tool_uses=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [10] user(tool_results=[toolu_01RxXAhUZ5xM5rRRjtvdZTbB,toolu_01QQ7j9xiw1gPaxDZ5QLHphE,toolu_01LaSpW35Ch6n3x6GsHJ1NL7]); [11] assistant(id=msg_01UNdjUWGKkqR28z9BCF8dSe, tool_uses=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [12] user(tool_results=[toolu_015AgusYNzeLJHiTL259hM2x,toolu_01QjntsiEVPWeEgRdpi9UPK1]); [13] assistant(id=msg_01NizGCtbZyEYyHu2LeRFsvW, tool_uses=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [14] user(tool_results=[toolu_0122n9nW9RNpgfZUkGoVgBEe]); [15] assistant(id=msg_01Ncx3F9Yet3vDekQcvt2RMQ, tool_uses=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [16] user(tool_results=[toolu_01HnpCK3Cb2GycMdzpSJDVV1,toolu_017K25JfY6GDmeM99HCjBwf8]); [17] assistant(id=msg_0188JpgsGWCwPTwjDUkhHSLQ, tool_uses=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [18] user(tool_results=[toolu_018FSnMZfiKLo6TE5ekhLUnq]); [19] assistant(id=msg_01MEe4jpYYUpTiPW4ref9489, tool_uses=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [20] user(tool_results=[toolu_013i14qjR7A8BVeRpCZ9CPMM]); [21] assistant(id=msg_01EHswKxYPq9RbdBijCksKUq, tool_uses=[toolu_01Rzv624b4TsqSXDu847ufQb]); [22] user(tool_results=[toolu_01Rzv624b4TsqSXDu847ufQb]); [23] assistant(id=msg_01QYXAuHjQ5HmUgMohwvVp4y, tool_uses=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [24] user(tool_results=[toolu_01Qu7HVorKXbixYjcEPKYWyL]); [25] assistant(id=msg_01G9DYqF4UFmuw3ShdQTQVdA, tool_uses=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [26] user(tool_results=[toolu_011stz7heMxY5NnfXdLfzWWR,toolu_01FkyEbZKy4CbFLRFMJvEnhs]); [27] assistant(id=msg_01RG8cWhGR5EyyENvgDQVM4g, tool_uses=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [28] user(tool_results=[toolu_01Ccmb9VfUkrpRyscrCtHbZw,toolu_01XtWC696pDZeS3zh6C4gt3h,toolu_01QrziZXAxJnJv7mLBfE36Lm,toolu_01SAieJYVtmDYa8ubnSG9bFQ,toolu_01CfZfyrmC6kBYGLFvUJQHuL,toolu_01JN8PBGFny3YWcwTKN3W36G]); [29] assistant(id=msg_01RxLoCXgPrXzEKNgupQRWbn, tool_uses=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [30] user(tool_results=[toolu_013vmCUE2uAbAwdBinfgbzFk]); [31] assistant(id=msg_01HCuSQFBUE8NfN5Hw1V7jCM, tool_uses=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [32] user(tool_results=[toolu_01YPkEqLrenBgw43GvYBRk8D]); [33] assistant(id=msg_01HZEiCXQ3722fAUBiGsUZmh, tool_uses=[toolu_01BW9ZseqafVotJZGFoE9biv]); [34] user(tool_results=[toolu_01BW9ZseqafVotJZGFoE9biv]); [35] assistant(id=msg_017X29V2EGeLBvNhWMPpH6FW, tool_uses=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [36] user(tool_results=[toolu_01NDZhfkGMh2YnnppVBWqDeX,toolu_014oeh22TXLHb3zL7KXiV4bW]); [37] assistant(id=msg_017nSXi8AFgqKAMVTRPubM7G, tool_uses=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [38] user(tool_results=[toolu_01UaXoyA4NkN953qaZK2e1KV]); [39] assistant(id=msg_016Bqxrzvvx7nkvv7G5jtkK9, tool_uses=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [40] user(tool_results=[toolu_01T4SDVinNmkEnxZYYupiu4h]); [41] assistant(id=msg_01FWU6eejKYireq6tV8CqmQJ, tool_uses=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [42] user(tool_results=[toolu_01CqRb6dKppt1tCAy6fBE6jt]); [43] assistant(id=msg_01R9t2meQDTTQAsDRhcyjzKP, tool_uses=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [44] user(tool_results=[toolu_01TYn1jYm2xuRoKNkEvkvsrA]); [45] assistant(id=msg_018S5G49dwQFmmKpt1gggn9e, tool_uses=[toolu_01KisLcTaqwaBGXTKBKBehue]); [46] user(tool_results=[toolu_01KisLcTaqwaBGXTKBKBehue]); [47] assistant(id=msg_01Lu69xTxNBus2GtmnWpuwnt, tool_uses=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [48] user(tool_results=[toolu_013vhq9BZ3H1GcPYaBGcYMLN]); [49] assistant(id=msg_01AYxT5HGsQk8ZHt11RhEmWn, tool_uses=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [50] user(tool_results=[toolu_01TCPzabMY4vkPsL9YK9Psbe,toolu_01BJMgnbtNqVai3Qft5gY8FD]); [51] assistant(id=msg_01KyZ3GGYRw8NLykMNhSKKta, tool_uses=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [52] user(tool_results=[toolu_01M8dLkMP6XLgMzTz9hyMoE9,toolu_01BvU8ErAwshytSCL8wbVnPG,toolu_017Li3ZyDd7CcJrzbfS9Nhqb]); [53] assistant(id=msg_011a8PtJPiNNvWUBuby6GFNr, tool_uses=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [54] user(tool_results=[toolu_01MVUFt1CXgfZfstVjBoWKFS,toolu_017dgKKSoFxZCsks2whc9ByU]); [55] assistant(id=msg_019MYVQzg7fcdQC9YW4KppC…

Note: Content was truncated.

extent analysis

TL;DR

The issue is likely caused by excessive tool usage, leading to quick depletion of the token limit, and can be mitigated by optimizing tool usage or increasing the token limit.

Guidance

  • Review the provided JSON error log to identify patterns or specific tools that are being used excessively, which could be contributing to the rapid token depletion.
  • Consider optimizing the code or workflow to reduce the number of tool uses, especially for tools that are used repeatedly in a short period.
  • If possible, explore options to increase the token limit or adjust the usage limits for specific tools to accommodate the current workflow demands.
  • Analyze the error message "ensureToolResultPairing: repaired missing tool_result blocks" to understand if there are any issues with tool result pairing that could be contributing to the problem.

Example

No specific code example can be provided without more context, but optimizing tool usage might involve reorganizing the workflow to minimize repeated tool uses or implementing more efficient algorithms.

Notes

The provided information does not specify the exact nature of the tools or the workflow, making it difficult to provide a precise solution. Additionally, the content was truncated, which might limit the ability to identify all contributing factors.

Recommendation

Apply a workaround by optimizing tool usage, as the provided information suggests that excessive tool usage is a primary contributor to the issue. This approach can help mitigate the problem until a more permanent solution can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Excessive token consumption rate with single agent at max_requests=5 [1 comments, 2 participants]