fix(kiro): use neutral placeholder for tool-result-only user turns

Replace the literal 'continue' placeholder on tool-result-only user turns with 'Tool results provided.' to prevent models from treating it as a new user instruction.
This commit is contained in:
Qisthi Ramadhani
2026-09-17 18:12:34 +07:00
parent f4f06f290c
commit 82b1bca42a
5 changed files with 143 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ import { ROLE, CLAUDE_BLOCK } from "../schema/index.js";
import {
canonicalizeKiroConversation,
normalizeKiroToolSpecs,
kiroEmptyUserContent,
} from "../concerns/kiroConversation.js";
/**
@@ -53,7 +54,8 @@ function convertClaudeMessagesToKiro(messages, model) {
const flushPending = () => {
if (currentRole === ROLE.USER) {
const content = pendingUserContent.join("\n\n").trim() || "continue";
const content = pendingUserContent.join("\n\n").trim()
|| kiroEmptyUserContent(pendingToolResults.length > 0);
const userMsg = { userInputMessage: { content, modelId: model } };
if (pendingImages.length > 0) {

View File

@@ -23,6 +23,7 @@ import { ROLE, OPENAI_BLOCK, CLAUDE_BLOCK } from "../schema/index.js";
import {
canonicalizeKiroConversation,
normalizeKiroToolSpecs,
kiroEmptyUserContent,
} from "../concerns/kiroConversation.js";
/**
@@ -51,7 +52,8 @@ function convertMessages(messages, model) {
const flushPending = () => {
if (currentRole === "user") {
const content = pendingUserContent.join("\n\n").trim() || "continue";
const content = pendingUserContent.join("\n\n").trim()
|| kiroEmptyUserContent(pendingToolResults.length > 0);
const userMsg = {
userInputMessage: {
content: content,