Skip to content

[Bug] Kiro 与 Ampcode 的 Bash 工具参数不兼容 #210

@possible055

Description

@possible055

Is it a request payload issue?
[-] Yes, this is a request payload issue. I am using a client/cURL to send a request payload, but I received an unexpected error.
[ ] No, it's another issue.

If it's a request payload issue, you MUST know
Our team doesn't have any GODs or ORACLEs or MIND READERs. Please make sure to attach the request log or curl payload.

Describe the bug
由于 kiro api 有验证工具调用截断的机制
若指定工具必填栏位出现空值,则会直接回传错误信息
但是 ampcode 的 Bash 工具的必填栏位为 cmd,同时又不支持 _status 与 _message
导致第一次因为非 command 而触发软截断后,后续陷入无法脱离的回圈

必填限制 (./internal/translator/kiro/claude/truncation_detector.go)

var RequiredFieldsByTool = map[string][]string{
	"Write":              {"file_path", "content"},
	"write_to_file":      {"path", "content"},
	"fsWrite":            {"path", "content"},
	"create_file":        {"path", "content"},
	"edit_file":          {"path"},
	"apply_diff":         {"path", "diff"},
	"str_replace_editor": {"path", "old_str", "new_str"},
	"Bash":               {"command"}, <-------------------------- Problem
	"execute":            {"command"},
	"run_command":        {"command"},
}

软截断回传信息 (./internal/translator/kiro/claude/kiro_claude_response.go)

markerInput := map[string]interface{}{
    "_status":  "SOFT_LIMIT_REACHED",
    "_message": "Tool output was truncated. Split content into smaller chunks (max 300 lines)...",
}

CLI Type
kiro

Model Name
kiro-claude-opus-4-5

LLM Client
ampcode (latest)

Expected behavior
将 "Bash": {"command"} 改成 "Bash": {"cmd"}, 并编译 images 部署后,确认 ampcode 工作恢复正常
然而我不确定该机制是否会影响其他反代环节,以及该机制的实际意义
因此仅做通报

测试 docker image: apparition635/cli-proxy-api-plus:v6.8.9-0

OS Type
WSL-Debian (Debian 13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions