claude-code - 💡(How to fix) Fix [Bug] Task/Agent tool returns missing result when plan-implementer subagent completes work

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":"Error: NON-FATAL: Lock acquisition failed for /Users/willclark/.local/share/claude/versions/2.1.114 (expected in multi-process scenarios)\n at sd_ (/$bunfs/root/src/entrypoints/cli.js:2751:2177)\n at WH8 (/$bunfs/root/src/entrypoints/cli.js:2751:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:15:01.534Z"},{"error":"McpToolCallError: Discrepancy between issue team and state, cycle or project - Discrepancy between issue team and state, cycle or project.\n at CJ7 (/$bunfs/root/src/entrypoints/cli.js:4759:63)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:30:40.714Z"},{"error":"MaxFileReadTokenExceededError: File content (480713 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 nj7 (/$bunfs/root/src/entrypoints/cli.js:4723:12550)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T23:18:28.116Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (31 -> 31 messages). Message structure: [0] user; [1] assistant(id=msg_01RLCJmCfuBkKHCMaTPs9THn, tool_uses=[toolu_011zUFp31dzuneUHZwPTuiDj]); [2] user(tool_results=[toolu_011zUFp31dzuneUHZwPTuiDj]); [3] assistant(id=msg_01JSYmjc5eUT9JFryVDdhUXB, tool_uses=[toolu_016j3QQWBYLXR5LFawq61sHu]); [4] user(tool_results=[toolu_016j3QQWBYLXR5LFawq61sHu]); [5] assistant(id=msg_01Mc1Efw4Vib98KoVE8tsz4G, tool_uses=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [6] user(tool_results=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [7] assistant(id=msg_015vzXEPN6t5rrrLPfZec6qk, tool_uses=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [8] user(tool_results=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [9] assistant(id=msg_01J2bq3DydW3gvrDDSZio4XQ, tool_uses=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [10] user(tool_results=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [11] assistant(id=msg_01KzmK5NnCZ1DtnB1m9ZZ5AH, tool_uses=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [12] user(tool_results=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [13] assistant(id=msg_01CysnDghARwv6LpuKTBCEf2, tool_uses=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [14] user(tool_results=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [15] assistant(id=msg_018a5Fs2Y69vkff1uyU8woV1, tool_uses=[]); [16] user; [17] assistant(id=msg_01WTV2KQcb8QvrCnCpmz3Mqi, tool_uses=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [18] user(tool_results=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [19] assistant(id=msg_01EtP1kEDRGHisWkbzTWM1DN, tool_uses=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [20] user(tool_results=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [21] assistant(id=msg_01LZE8CNYdth6yKVmBmuxLqL, tool_uses=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [22] user(tool_results=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [23] assistant(id=msg_018rAGY7wsG6kFy1zp7zQ77v, tool_uses=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [24] user(tool_results=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [25] assistant(id=msg_01HZSXyrKBmx8USc9Md8UjKx, tool_uses=[toolu_012We6rh7AfG4N5JDac3vmCc]); [26] user(tool_results=[toolu_012We6rh7AfG4N5JDac3vmCc]); [27] assistant(id=msg_016DVVr92LbVGs6toJk9bcCb, tool_uses=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [28] user(tool_results=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [29] assistant(id=msg_016Y46rfcRo1PWNfgCthRSit, tool_uses=[toolu_01Bn4XPEBBenwjNatqvDaebm]); [30] user\n at yX7 (/$bunfs/root/src/entrypoints/cli.js:5225:10250)\n at Hc7 (/$bunfs/root/src/entrypoints/cli.js:8064:15579)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T02:37:33.817Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (95 -> 95 messages). Message structure: [0] user; [1] assistant(id=msg_019a1XmeJcKa4AUXp6TPx66r,…

Root Cause

Not clear whether the root cause is a subagent-side crash, a large response payload exceeding a limit, a transport/timeout issue, or something else — there's no error message surfaced beyond the generic "internal error" line.

Fix Action

Fix / Workaround

It's happened twice in the same session: - Phase 5 (System tests → Capybara): subagent dispatched, no report returned. Had to recover by checking git status — found uncommitted WIP from the prior run, then had a second subagent finish/commit it (landed as 1c5b119). - Phase 6 (Controller/command over-mocking cleanup): same failure mode. Subagent dispatched, tool result came back as an internal error, no report.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/willclark/.local/share/claude/versions/2.1.114 (expected in multi-process scenarios)\n    at sd_ (/$bunfs/root/src/entrypoints/cli.js:2751:2177)\n    at WH8 (/$bunfs/root/src/entrypoints/cli.js:2751:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:15:01.534Z"},{"error":"McpToolCallError: Discrepancy between issue team and state, cycle or project - Discrepancy between issue team and state, cycle or project.\n    at CJ7 (/$bunfs/root/src/entrypoints/cli.js:4759:63)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:30:40.714Z"},{"error":"MaxFileReadTokenExceededError: File content (480713 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 nj7 (/$bunfs/root/src/entrypoints/cli.js:4723:12550)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T23:18:28.116Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (31 -> 31 messages). Message structure: [0] user; [1] assistant(id=msg_01RLCJmCfuBkKHCMaTPs9THn, tool_uses=[toolu_011zUFp31dzuneUHZwPTuiDj]); [2] user(tool_results=[toolu_011zUFp31dzuneUHZwPTuiDj]); [3] assistant(id=msg_01JSYmjc5eUT9JFryVDdhUXB, tool_uses=[toolu_016j3QQWBYLXR5LFawq61sHu]); [4] user(tool_results=[toolu_016j3QQWBYLXR5LFawq61sHu]); [5] assistant(id=msg_01Mc1Efw4Vib98KoVE8tsz4G, tool_uses=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [6] user(tool_results=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [7] assistant(id=msg_015vzXEPN6t5rrrLPfZec6qk, tool_uses=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [8] user(tool_results=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [9] assistant(id=msg_01J2bq3DydW3gvrDDSZio4XQ, tool_uses=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [10] user(tool_results=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [11] assistant(id=msg_01KzmK5NnCZ1DtnB1m9ZZ5AH, tool_uses=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [12] user(tool_results=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [13] assistant(id=msg_01CysnDghARwv6LpuKTBCEf2, tool_uses=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [14] user(tool_results=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [15] assistant(id=msg_018a5Fs2Y69vkff1uyU8woV1, tool_uses=[]); [16] user; [17] assistant(id=msg_01WTV2KQcb8QvrCnCpmz3Mqi, tool_uses=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [18] user(tool_results=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [19] assistant(id=msg_01EtP1kEDRGHisWkbzTWM1DN, tool_uses=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [20] user(tool_results=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [21] assistant(id=msg_01LZE8CNYdth6yKVmBmuxLqL, tool_uses=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [22] user(tool_results=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [23] assistant(id=msg_018rAGY7wsG6kFy1zp7zQ77v, tool_uses=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [24] user(tool_results=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [25] assistant(id=msg_01HZSXyrKBmx8USc9Md8UjKx, tool_uses=[toolu_012We6rh7AfG4N5JDac3vmCc]); [26] user(tool_results=[toolu_012We6rh7AfG4N5JDac3vmCc]); [27] assistant(id=msg_016DVVr92LbVGs6toJk9bcCb, tool_uses=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [28] user(tool_results=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [29] assistant(id=msg_016Y46rfcRo1PWNfgCthRSit, tool_uses=[toolu_01Bn4XPEBBenwjNatqvDaebm]); [30] user\n    at yX7 (/$bunfs/root/src/entrypoints/cli.js:5225:10250)\n    at Hc7 (/$bunfs/root/src/entrypoints/cli.js:8064:15579)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T02:37:33.817Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (95 -> 95 messages). Message structure: [0] user; [1] assistant(id=msg_019a1XmeJcKa4AUXp6TPx66r,
RAW_BUFFERClick to expand / collapse

Bug Description The recurring issue is "Tool result missing due to internal error" when delegating phases to the plan-implementer subagent via the Task/Agent tool.

It's happened twice in the same session:
- Phase 5 (System tests → Capybara): subagent dispatched, no report returned. Had to recover by checking git status — found uncommitted WIP from the
prior run, then had a second subagent finish/commit it (landed as 1c5b119).
- Phase 6 (Controller/command over-mocking cleanup): same failure mode. Subagent dispatched, tool result came back as an internal error, no report.

The failure mode looks like the subagent is doing work (modifying files) but the response channel back to the orchestrator is failing, so we lose
visibility into what was done. Recovery path both times is the same: git log --oneline + git status on the feature branch to see what actually landed,
 then either re-delegate a "review and finish WIP" task or accept the state and move on.

Not clear whether the root cause is a subagent-side crash, a large response payload exceeding a limit, a transport/timeout issue, or something else —
there's no error message surfaced beyond the generic "internal error" line.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.114
  • Feedback ID: f43ac759-8116-4b70-bc45-853343401e22

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/willclark/.local/share/claude/versions/2.1.114 (expected in multi-process scenarios)\n    at sd_ (/$bunfs/root/src/entrypoints/cli.js:2751:2177)\n    at WH8 (/$bunfs/root/src/entrypoints/cli.js:2751:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:15:01.534Z"},{"error":"McpToolCallError: Discrepancy between issue team and state, cycle or project - Discrepancy between issue team and state, cycle or project.\n    at CJ7 (/$bunfs/root/src/entrypoints/cli.js:4759:63)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T22:30:40.714Z"},{"error":"MaxFileReadTokenExceededError: File content (480713 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 nj7 (/$bunfs/root/src/entrypoints/cli.js:4723:12550)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T23:18:28.116Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (31 -> 31 messages). Message structure: [0] user; [1] assistant(id=msg_01RLCJmCfuBkKHCMaTPs9THn, tool_uses=[toolu_011zUFp31dzuneUHZwPTuiDj]); [2] user(tool_results=[toolu_011zUFp31dzuneUHZwPTuiDj]); [3] assistant(id=msg_01JSYmjc5eUT9JFryVDdhUXB, tool_uses=[toolu_016j3QQWBYLXR5LFawq61sHu]); [4] user(tool_results=[toolu_016j3QQWBYLXR5LFawq61sHu]); [5] assistant(id=msg_01Mc1Efw4Vib98KoVE8tsz4G, tool_uses=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [6] user(tool_results=[toolu_01B1nBpTEpS3ruD2nxkvvM8c]); [7] assistant(id=msg_015vzXEPN6t5rrrLPfZec6qk, tool_uses=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [8] user(tool_results=[toolu_01QakF3oYuw8mkxYJf491Tm9]); [9] assistant(id=msg_01J2bq3DydW3gvrDDSZio4XQ, tool_uses=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [10] user(tool_results=[toolu_01VPQxBkfZyK8Ar6U3FoBAAH]); [11] assistant(id=msg_01KzmK5NnCZ1DtnB1m9ZZ5AH, tool_uses=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [12] user(tool_results=[toolu_01Ky94jdJb5ADwWiP2wLEStU]); [13] assistant(id=msg_01CysnDghARwv6LpuKTBCEf2, tool_uses=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [14] user(tool_results=[toolu_019KdciWm4jPkXKbHHdpkkwc]); [15] assistant(id=msg_018a5Fs2Y69vkff1uyU8woV1, tool_uses=[]); [16] user; [17] assistant(id=msg_01WTV2KQcb8QvrCnCpmz3Mqi, tool_uses=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [18] user(tool_results=[toolu_01RnfW9Y3kM5EvEXQfBDNdMQ,toolu_01LtrTMaX3A3tVeB5opMXWtB]); [19] assistant(id=msg_01EtP1kEDRGHisWkbzTWM1DN, tool_uses=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [20] user(tool_results=[toolu_0161V7Cx4Fk4vrbkmfAzLHDH]); [21] assistant(id=msg_01LZE8CNYdth6yKVmBmuxLqL, tool_uses=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [22] user(tool_results=[toolu_01LKN4gXZW9D4x4zZnXQKDAV]); [23] assistant(id=msg_018rAGY7wsG6kFy1zp7zQ77v, tool_uses=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [24] user(tool_results=[toolu_01F6CQ4MxvSdBc2RMuyzpq7g]); [25] assistant(id=msg_01HZSXyrKBmx8USc9Md8UjKx, tool_uses=[toolu_012We6rh7AfG4N5JDac3vmCc]); [26] user(tool_results=[toolu_012We6rh7AfG4N5JDac3vmCc]); [27] assistant(id=msg_016DVVr92LbVGs6toJk9bcCb, tool_uses=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [28] user(tool_results=[toolu_01ARoKaXYaAq3Rcy5S4wHRWg]); [29] assistant(id=msg_016Y46rfcRo1PWNfgCthRSit, tool_uses=[toolu_01Bn4XPEBBenwjNatqvDaebm]); [30] user\n    at yX7 (/$bunfs/root/src/entrypoints/cli.js:5225:10250)\n    at Hc7 (/$bunfs/root/src/entrypoints/cli.js:8064:15579)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T02:37:33.817Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (95 -> 95 messages). Message structure: [0] user; [1] assistant(id=msg_019a1XmeJcKa4AUXp6TPx66r,

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix is to address the "MaxFileReadTokenExceededError" by implementing pagination or limiting the file content read, as the current approach exceeds the maximum allowed tokens.

Guidance

  • Investigate the "MaxFileReadTokenExceededError" and consider using offset and limit parameters to read specific portions of the file, as suggested in the error message.
  • Review the message structure in the "ensureToolResultPairing" error to understand the pairing of tool results and identify potential issues.
  • Check the file content and tool result handling to prevent exceeding the maximum allowed tokens.
  • Consider implementing error handling for "Lock acquisition failed" and "McpToolCallError" to prevent crashes and discrepancies.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The issue content is truncated, which may limit the ability to provide a comprehensive solution. The provided errors and guidance are based on the available information.

Recommendation

Apply a workaround by addressing the "MaxFileReadTokenExceededError" and implementing pagination or limiting the file content read, as this is the most explicit error with a suggested solution in the provided issue content.

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] Task/Agent tool returns missing result when plan-implementer subagent completes work