claude-code - 💡(How to fix) Fix [Bug] Agent stuck in operation loop unable to proceed or route around task

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…

Error Message

[{"error":"AxiosError: Request failed with status code 401\n at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.941Z"},{"error":"AxiosError: Request failed with status code 401\n at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.986Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gworley/worktrees/permit_tools/placeholder-files.\n at call (/$bunfs/root/src/entrypoints/cli.js:4732:7630)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:20:39.527Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"ImageResizeError: Unable to compress image (392.2KB) to fit within 146.5KB. Please use a smaller image.\n at IK9 (/$bunfs/root/src/entrypoints/cli.js:567:7138)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Error: Could not load the "sharp" module using the darwin-arm64 runtime\nPossible solutions:\n- Ensure optional dependencies can be installed:\n npm install --include=optional sharp\n- Ensure your package manager supports multi-platform installation:\n See https://sharp.pixelplumbing.com/install#cross-platform\n- Add platform-specific dependencies:\n npm install --os=darwin --cpu=arm64 sharp\n- Consult the installation documentation:\n See https://sharp.pixelplumbing.com/install\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:536:2606)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:540:61)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:567:13)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4727:3761)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.274Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"},"request_id":"req_011CaFaz3cGTZ4JD24v39ksz"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:05.429Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"},"request_id":"req_011CaFbx2z8K43qdqutin5FZ"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:49:45.005Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"},"request_id":"req_011CaFcgYzLPVpKE5J1fsTw4"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:59:21.725Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Could not process image"},"request_id":"req_011CaFchc5eRxPnm2sX2FSB6"}\n at…

Code Example

[{"error":"AxiosError: Request failed with status code 401\n    at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n    at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.941Z"},{"error":"AxiosError: Request failed with status code 401\n    at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n    at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.986Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gworley/worktrees/permit_tools/placeholder-files.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4732:7630)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:20:39.527Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"ImageResizeError: Unable to compress image (392.2KB) to fit within 146.5KB. Please use a smaller image.\n    at IK9 (/$bunfs/root/src/entrypoints/cli.js:567:7138)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Error: Could not load the \"sharp\" module using the darwin-arm64 runtime\nPossible solutions:\n- Ensure optional dependencies can be installed:\n    npm install --include=optional sharp\n- Ensure your package manager supports multi-platform installation:\n    See https://sharp.pixelplumbing.com/install#cross-platform\n- Add platform-specific dependencies:\n    npm install --os=darwin --cpu=arm64 sharp\n- Consult the installation documentation:\n    See https://sharp.pixelplumbing.com/install\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:536:2606)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:540:61)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:567:13)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4727:3761)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.274Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFaz3cGTZ4JD24v39ksz\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:05.429Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFbx2z8K43qdqutin5FZ\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:49:45.005Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFcgYzLPVpKE5J1fsTw4\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:59:21.725Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFchc5eRxPnm2sX2FSB6\"}\n    at…
RAW_BUFFERClick to expand / collapse

Bug Description agent is stuck trying to perform an operation and i can't seem to get it to route around it or move on. was trying to have it work on generating some placeholder images, and got stuck here.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.114
  • Feedback ID: b5623735-8306-4bfb-b99d-421ee00e1243

Errors

[{"error":"AxiosError: Request failed with status code 401\n    at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n    at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.941Z"},{"error":"AxiosError: Request failed with status code 401\n    at CU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12744)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async kn1 (/$bunfs/root/src/entrypoints/cli.js:3089:14374)\n    at async z_7 (/$bunfs/root/src/entrypoints/cli.js:3089:14913)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T18:49:45.986Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/gworley/worktrees/permit_tools/placeholder-files.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4732:7630)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:20:39.527Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Failed to decode image: The image format Gif is not supported","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"ImageResizeError: Unable to compress image (392.2KB) to fit within 146.5KB. Please use a smaller image.\n    at IK9 (/$bunfs/root/src/entrypoints/cli.js:567:7138)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.269Z"},{"error":"Error: Could not load the \"sharp\" module using the darwin-arm64 runtime\nPossible solutions:\n- Ensure optional dependencies can be installed:\n    npm install --include=optional sharp\n- Ensure your package manager supports multi-platform installation:\n    See https://sharp.pixelplumbing.com/install#cross-platform\n- Add platform-specific dependencies:\n    npm install --os=darwin --cpu=arm64 sharp\n- Consult the installation documentation:\n    See https://sharp.pixelplumbing.com/install\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:536:2606)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:540:61)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:567:13)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:11:1047)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:4727:3761)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:03.274Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFaz3cGTZ4JD24v39ksz\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:37:05.429Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFbx2z8K43qdqutin5FZ\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:49:45.005Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFcgYzLPVpKE5J1fsTw4\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53158)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T19:59:21.725Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Could not process image\"},\"request_id\":\"req_011CaFchc5eRxPnm2sX2FSB6\"}\n    at…

Note: Content was truncated.

extent analysis

TL;DR

The agent is likely stuck due to a combination of authentication issues (401 errors), unsupported image formats (Gif), and potential dependency problems with the "sharp" module.

Guidance

  1. Address authentication issues: Investigate and resolve the 401 errors by checking authentication credentials and ensuring they are correctly configured.
  2. Check image formats: Verify that the image formats being used are supported by the system, and consider converting or removing unsupported formats like Gif.
  3. Install optional dependencies: Run npm install --include=optional sharp to ensure the "sharp" module is properly installed, as suggested in one of the error messages.
  4. Verify platform-specific dependencies: Consider adding platform-specific dependencies with npm install --os=darwin --cpu=arm64 sharp if the issue persists.

Example

No specific code snippet can be provided without more context, but ensuring the "sharp" module is correctly installed and configured is crucial.

Notes

The provided error log is truncated, which might limit the ability to identify all potential issues. Additionally, the combination of different error types (authentication, image format, dependency) suggests a complex problem that may require a multifaceted solution.

Recommendation

Apply the workaround by addressing the authentication issues, checking image formats, and ensuring the "sharp" module is correctly installed. This approach is recommended because it directly targets the errors mentioned in the log and may resolve the issue without requiring an upgrade to a fixed version, which is not explicitly mentioned as an option.

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] Agent stuck in operation loop unable to proceed or route around task