Repository navigation
fix: reconstruct parallel tool-call assistant message from split core messages - #1
Merged
Conversation
… messages projectMessage() splits assistant parallel tool-calls into individual core messages with id format 'entryId#callId'. coreOutToAgentMessages() was using originalById.get(core.id) which failed for split IDs (map keyed by entry.id only). This dropped all parallel tool-call messages, orphaning their tool results → 400 from LLM API on the next turn. Fix: detect '#callId' suffix, group by base entry ID, reconstruct ONE assistant message with all surviving toolCall blocks + text blocks, apply ref tag. Handles partial pruning (some tool-calls compressed, others survive). Tests: 2 new regression tests (full reconstruction + partial pruning).
This was referenced Aug 7, 2026
Zeno2019
pushed a commit
to Zeno2019/billion-context-pi
that referenced
this pull request
Aug 7, 2026
Replace standalone brand 'ACP' / 'Active Context Pruning' with 'billion-context' / 'Billion-Context' in README prose, reflecting the pai-acp -> billion-context-pi rename (v0.1.24). Kept technical identifiers as-is: /acp command + its output banner, tool names (acp_status, acp_delegate*), acp.json, ACP_* env vars, acp-kernel library. Refs ranxianglei#1.
This was referenced Aug 31, 2026
Closed
This was referenced Sep 11, 2026
HangxiangMa
pushed a commit
to HangxiangMa/billion-context-pi
that referenced
this pull request
Sep 21, 2026
Replace standalone brand 'ACP' / 'Active Context Pruning' with 'billion-context' / 'Billion-Context' in README prose, reflecting the pai-acp -> billion-context-pi rename (v0.1.24). Kept technical identifiers as-is: /acp command + its output banner, tool names (acp_status, acp_delegate*), acp.json, ACP_* env vars, acp-kernel library. Refs ranxianglei#1.
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coreOutToAgentMessages()was dropping parallel tool-call messages, causing 400 errors on the next LLM turnprojectMessage()splits assistant parallel tool-calls into core messages with identryId#callId, butoriginalByIdmap keyed byentry.idonly → lookup fails → messages dropped → orphaned tool results → 400Fix
Rewrote
coreOutToAgentMessages()to detect#callIdsuffix, group by base entry ID, and reconstruct ONE assistant message with all surviving toolCall blocks + text blocks + ref tag. Handles partial pruning (some tool-calls compressed, others survive).Tests