claude-code - 💡(How to fix) Fix [Bug] LLM generates duplicate consecutive response blocks [2 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#45499Fetched 2026-04-09 08:04:00
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

Error Message

[{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:01:49.212Z"},{"error":"Error: Request was aborted.\n at PV_ (/$bunfs/root/src/entrypoints/cli.js:1245:11933)\n at next (native:1:11)\n at Kb7 (/$bunfs/root/src/entrypoints/cli.js:7767:9194)\n at next (native:1:11)\n at Tb7 (/$bunfs/root/src/entrypoints/cli.js:7772:11371)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:05:58.739Z"},{"error":"MaxFileReadTokenExceededError: File content (12835 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 HT7 (/$bunfs/root/src/entrypoints/cli.js:4309:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:06:33.084Z"}]

Code Example

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:01:49.212Z"},{"error":"Error: Request was aborted.\n    at PV_ (/$bunfs/root/src/entrypoints/cli.js:1245:11933)\n    at next (native:1:11)\n    at Kb7 (/$bunfs/root/src/entrypoints/cli.js:7767:9194)\n    at next (native:1:11)\n    at Tb7 (/$bunfs/root/src/entrypoints/cli.js:7772:11371)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:05:58.739Z"},{"error":"MaxFileReadTokenExceededError: File content (12835 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 HT7 (/$bunfs/root/src/entrypoints/cli.js:4309:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:06:33.084Z"}]
RAW_BUFFERClick to expand / collapse

Has been happening repeatedly. Model writes ~90% of a response, somehow gets cut off when almost finished, then regenerates an entirely new response to the same user message. After both responses, both are in-context.

Bug Description Model double-responded

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.97
  • Feedback ID: 5daeebea-4fc2-4d05-9e00-bd0a6001b2fb

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:01:49.212Z"},{"error":"Error: Request was aborted.\n    at PV_ (/$bunfs/root/src/entrypoints/cli.js:1245:11933)\n    at next (native:1:11)\n    at Kb7 (/$bunfs/root/src/entrypoints/cli.js:7767:9194)\n    at next (native:1:11)\n    at Tb7 (/$bunfs/root/src/entrypoints/cli.js:7772:11371)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:05:58.739Z"},{"error":"MaxFileReadTokenExceededError: File content (12835 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 HT7 (/$bunfs/root/src/entrypoints/cli.js:4309:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:06:33.084Z"}]

extent analysis

TL;DR

The model's double response issue may be related to request abort errors and token limits, suggesting a need to adjust request handling or token limits.

Guidance

  • Investigate the makeRequest function in cli.js to understand why requests are being aborted, potentially due to timeouts or other limitations.
  • Consider implementing offset and limit parameters when reading file content to avoid exceeding the maximum allowed tokens (10000).
  • Review the model's response generation logic to prevent double responses, possibly by introducing a check for existing responses before generating a new one.
  • Analyze the errors and timestamps to identify any patterns or correlations that could help in pinpointing the cause.

Example

No specific code example can be provided without more context, but adjusting the token limit or implementing pagination when reading large files might look something like this:

// Pseudocode example, actual implementation depends on the specific API or library being used
const readFile = (filePath, options) => {
  const { offset = 0, limit = 10000 } = options;
  // Implement logic to read the file using offset and limit
};

Notes

The provided errors suggest issues with request aborts and token limits, but without more information about the model's implementation or the specific requirements of the cli.js entrypoints, it's challenging to provide a definitive solution.

Recommendation

Apply a workaround by adjusting token limits or request handling to mitigate the issue, as upgrading to a fixed version is not explicitly mentioned in the provided information. This approach allows for immediate mitigation of the problem while further investigation into the root cause can continue.

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