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:
stevef 2026-04-20 12:23:39 +02:00
parent 60e428bc89
commit 0313521b50
2 changed files with 6 additions and 6 deletions

View file

@ -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, ", ")))
}
return SilentResult(sb.String())
return UserResult(sb.String()).WithResponseHandled().WithResponseHandled()
}
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 {
@ -294,7 +294,7 @@ func (t *FreeRideTool) handleStatus() *ToolResult {
}
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 {

View file

@ -60,8 +60,8 @@ func TestFreeRideTool_List(t *testing.T) {
t.Fatalf("Expected no error, got %s", result.ForLLM)
}
if !result.Silent {
t.Errorf("Expected silent result")
if result.Silent {
t.Errorf("Expected non-silent result")
}
output := result.ForLLM