Skip to content

fix(coding-agent): sanitize side-question tool history - #909

Open
chai1any wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
chai1any:fix/886-bedrock-side-context
Open

fix(coding-agent): sanitize side-question tool history#909
chai1any wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
chai1any:fix/886-bedrock-side-context

Conversation

@chai1any

@chai1any chai1any commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • remove tool-call blocks and paired tool-result messages from side-question LLM context
  • coalesce adjacent same-role messages after filtering so the Bedrock conversation still alternates roles
  • keep /btw and /side tool-free while preserving ordinary user and assistant conversation content
  • cover mixed assistant content, tool results, role alternation, and the empty tools invariant in regression tests

Amazon Bedrock requires toolConfig whenever history contains toolUse or toolResult blocks and requires conversation roles to alternate. Side questions intentionally provide no tools, so forwarding the main thread's tool protocol history caused the request to fail after any tool use.

Verification

  • npx tsx ../../node_modules/vitest/dist/cli.js --run test/suite/regressions/4509-side-questions.test.ts test/suite/regressions/886-bedrock-side-questions.test.ts (39 tests passed)
  • npm run check

Fixes #886

Remove tool calls and tool results from the LLM context used by tool-free side questions so Bedrock does not require a toolConfig. Preserve ordinary conversational content.\n\nFixes PrimeIntellect-ai#886
@chai1any
chai1any force-pushed the fix/886-bedrock-side-context branch from 0c42d10 to 7847c5d Compare August 8, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/btw and /side fail on Bedrock provider: missing toolConfig when message history contains tool blocks

1 participant