fix(tools): stabilize freeride tool visibility and turn completion
Changed freeride results to UserResult and added ResponseHandled: true to ensure tool output is visible in CLI/Interactive mode and prevent premature turn finalization with generic summary messages.
This commit is contained in:
parent
60e428bc89
commit
0313521b50
2 changed files with 6 additions and 6 deletions
|
|
@ -210,7 +210,7 @@ func (t *FreeRideTool) handleList(ctx context.Context, limit int) *ToolResult {
|
||||||
sb.WriteString(fmt.Sprintf(" Parameters: %s\n\n", strings.Join(m.SupportedParameters, ", ")))
|
sb.WriteString(fmt.Sprintf(" Parameters: %s\n\n", strings.Join(m.SupportedParameters, ", ")))
|
||||||
}
|
}
|
||||||
|
|
||||||
return SilentResult(sb.String())
|
return UserResult(sb.String()).WithResponseHandled().WithResponseHandled()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *FreeRideTool) handleAuto(ctx context.Context, limit int) *ToolResult {
|
func (t *FreeRideTool) handleAuto(ctx context.Context, limit int) *ToolResult {
|
||||||
|
|
@ -268,10 +268,10 @@ func (t *FreeRideTool) handleAuto(ctx context.Context, limit int) *ToolResult {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return SilentResult(msg)
|
return UserResult(msg).WithResponseHandled().WithResponseHandled()
|
||||||
}
|
}
|
||||||
|
|
||||||
return SilentResult("No new free models to add. Your configuration is up to date.")
|
return UserResult("No new free models to add. Your configuration is up to date.").WithResponseHandled().WithResponseHandled()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *FreeRideTool) handleStatus() *ToolResult {
|
func (t *FreeRideTool) handleStatus() *ToolResult {
|
||||||
|
|
@ -294,7 +294,7 @@ func (t *FreeRideTool) handleStatus() *ToolResult {
|
||||||
}
|
}
|
||||||
sb.WriteString(fmt.Sprintf("- Managed Free Models: %d\n", openRouterCount))
|
sb.WriteString(fmt.Sprintf("- Managed Free Models: %d\n", openRouterCount))
|
||||||
|
|
||||||
return SilentResult(sb.String())
|
return UserResult(sb.String()).WithResponseHandled().WithResponseHandled()
|
||||||
}
|
}
|
||||||
|
|
||||||
func modelExists(cfg *config.Config, modelName string) bool {
|
func modelExists(cfg *config.Config, modelName string) bool {
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ func TestFreeRideTool_List(t *testing.T) {
|
||||||
t.Fatalf("Expected no error, got %s", result.ForLLM)
|
t.Fatalf("Expected no error, got %s", result.ForLLM)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !result.Silent {
|
if result.Silent {
|
||||||
t.Errorf("Expected silent result")
|
t.Errorf("Expected non-silent result")
|
||||||
}
|
}
|
||||||
|
|
||||||
output := result.ForLLM
|
output := result.ForLLM
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue