mirror of
https://github.com/jwadow/kiro-gateway.git
synced 2026-04-25 01:15:57 +03:00
[PR #23] [MERGED] fix(converters): skip thinking tag injection when toolResults present #60
Labels
No labels
bug
bug
enhancement
enhancement
fixed
fixed
invalid
needs-info
needs-testing
pull-request
question
upstream
wontfix
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/kiro-gateway-jwadow#60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jwadow/kiro-gateway/pull/23
Author: @kilhyeonjun
Created: 1/8/2026
Status: ✅ Merged
Merged: 1/8/2026
Merged by: @jwadow
Base:
main← Head:fix/skip-thinking-tags-with-tool-results📝 Commits (1)
caebe7afix(converters): skip thinking tag injection when toolResults present📊 Changes
2 files changed (+83 additions, -5 deletions)
View changed files
📝
kiro_gateway/converters.py(+11 -4)📝
tests/unit/test_converters.py(+72 -1)📄 Description
Summary
Fixes #20 - OpenCode compaction returns 400 "Improperly formed request" error.
Root Cause
When the last message contains tool results:
merge_adjacent_messagesconverts tool messages to user message withtoolResultsinject_thinking_tagsadds<thinking_mode>...tags to contenttoolResultsinuserInputMessageContextAND thinking tags in contentSolution
Check for
toolResultsbefore injecting thinking tags. Skip injection whentoolResultsare present in the current message.Changes
build_kiro_payloadto builduser_input_contextbefore thinking tag injectiontoolResultspresentTests
test_skips_thinking_tags_when_tool_results_present- verifies thinking tags are NOT injected when toolResults presenttest_injects_thinking_tags_when_no_tool_results- verifies normal messages still get thinking tagsVerification
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.