tools: handle string 'true' for elevated flag

Kiro's bridge sends elevated as a string rather than a boolean.
Use a type switch to handle both cases.
This commit is contained in:
Levi Neely 2026-07-29 09:14:55 +02:00
parent 3b05b50b47
commit 12e3338b69
1 changed files with 5 additions and 2 deletions

View File

@ -287,8 +287,11 @@ func (e *Server) callPromotedTool(ctx context.Context, tool string, args json.Ra
var argMap map[string]interface{}
if err := json.Unmarshal(args, &argMap); err == nil {
if e, ok := argMap["elevated"]; ok {
if b, ok := e.(bool); ok {
elevated = b
switch v := e.(type) {
case bool:
elevated = v
case string:
elevated = v == "true" || v == "1"
}
// Remove elevated from the args passed to the tool.
delete(argMap, "elevated")