[Bug] Agent enters infinite reasoning loop consuming full context window

Resolved 💬 5 comments Opened Mar 8, 2026 by isinicyn Closed May 1, 2026

Bug Description
The agent gets stuck in a loop of reasoning for an indefinite period of time and consumes the entire context window.

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 2.1.71
  • Feedback ID: da36c30c-3bed-4ea8-85fb-b3e109d9d174

Errors

[{"error":"MaxFileReadTokenExceededError: File content (25716 tokens) exceeds maximum allowed tokens (25000). 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 u8D (B:/~BUN/root/src/entrypoints/cli.js:1472:8087)\n    at async x8D (B:/~BUN/root/src/entrypoints/cli.js:1476:2486)\n    at async call (B:/~BUN/root/src/entrypoints/cli.js:1481:5677)\n    at async kfM (B:/~BUN/root/src/entrypoints/cli.js:3956:14884)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-08T21:54:52.425Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readSync (unknown)\n    at readSync (B:/~BUN/root/src/entrypoints/cli.js:12:1534)\n    at QE (B:/~BUN/root/src/entrypoints/cli.js:6815:114)\n    at Kz (B:/~BUN/root/src/entrypoints/cli.js:6817:208)\n    at GvM (B:/~BUN/root/src/entrypoints/cli.js:13432:8218)\n    at z (B:/~BUN/root/src/entrypoints/cli.js:13432:7435)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:13432:7765)\n    at Mf (B:/~BUN/root/src/entrypoints/cli.js:584:62989)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:76020)\n    at cw (B:/~BUN/root/src/entrypoints/cli.js:584:75902)","timestamp":"2026-03-08T21:55:55.418Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readFileSync (unknown)\n    at readFileSync (B:/~BUN/root/src/entrypoints/cli.js:12:1155)\n    at Kz (B:/~BUN/root/src/entrypoints/cli.js:6817:233)\n    at GvM (B:/~BUN/root/src/entrypoints/cli.js:13432:8218)\n    at z (B:/~BUN/root/src/entrypoints/cli.js:13432:7435)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:13432:7765)\n    at Mf (B:/~BUN/root/src/entrypoints/cli.js:584:62989)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:76020)\n    at cw (B:/~BUN/root/src/entrypoints/cli.js:584:75902)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:75999)","timestamp":"2026-03-08T21:55:55.420Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readSync (unknown)\n    at readSync (B:/~BUN/root/src/entrypoints/cli.js:12:1534)\n    at QE (B:/~BUN/root/src/entrypoints/cli.js:6815:114)\n    at Kz (B:/~BUN/root/src/entrypoints/cli.js:6817:208)\n    at GvM (B:/~BUN/root/src/entrypoints/cli.js:13432:8218)\n    at z (B:/~BUN/root/src/entrypoints/cli.js:13432:7435)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:13432:7765)\n    at Mf (B:/~BUN/root/src/entrypoints/cli.js:584:62989)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:76020)\n    at cw (B:/~BUN/root/src/entrypoints/cli.js:584:75902)","timestamp":"2026-03-08T21:55:57.662Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readFileSync (unknown)\n    at readFileSync (B:/~BUN/root/src/entrypoints/cli.js:12:1155)\n    at Kz (B:/~BUN/root/src/entrypoints/cli.js:6817:233)\n    at GvM (B:/~BUN/root/src/entrypoints/cli.js:13432:8218)\n    at z (B:/~BUN/root/src/entrypoints/cli.js:13432:7435)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:13432:7765)\n    at Mf (B:/~BUN/root/src/entrypoints/cli.js:584:62989)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:76020)\n    at cw (B:/~BUN/root/src/entrypoints/cli.js:584:75902)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:75999)","timestamp":"2026-03-08T21:55:57.663Z"},{"error":"Error: File does not exist. Note: your current working directory is G:\\APPS_SRC\\WpfApp1.\n    at call (B:/~BUN/root/src/entrypoints/cli.js:1481:5976)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-08T21:55:57.667Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readSync (unknown)\n    at readSync (B:/~BUN/root/src/entrypoints/cli.js:12:1534)\n    at QE (B:/~BUN/root/src/entrypoints/cli.js:6815:114)\n    at Kz (B:/~BUN/root/src/entrypoints/cli.js:6817:208)\n    at GvM (B:/~BUN/root/src/entrypoints/cli.js:13432:8218)\n    at z (B:/~BUN/root/src/entrypoints/cli.js:13432:7435)\n    at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:13432:7765)\n    at Mf (B:/~BUN/root/src/entrypoints/cli.js:584:62989)\n    at Lm (B:/~BUN/root/src/entrypoints/cli.js:584:76020)\n    at cw (B:/~BUN/root/src/entrypoints/cli.js:584:75902)","timestamp":"2026-03-08T21:55:58.915Z"},{"error":"Error: EISDIR: illegal operation on a directory, read\n    at readFileSync (unknown)\n    at readFileSync (B:/~BUN/root/src/entrypoints/cli.js:12:1155)\n   …

Note: Content was truncated.

View original on GitHub ↗

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