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:
parent
3b05b50b47
commit
12e3338b69
|
|
@ -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")
|
||||
|
|
|
|||
Reference in New Issue