Fix Garmin connect race, surface tool error content, add dev start scripts

- GarminConnection now flushes Profile's pending debounced autosave before
  connecting, avoiding a race where Connect fires with stale credentials.
- client.go reads res.Content before checking IsError so tool error
  messages actually include mcp-garmin's response text.
- seedsample: update kind lookups to match current taxonomy names
  ("Easy Run" -> "Easy", "Interval" -> "Intervals").
- Add backend/start.sh and frontend/start.sh dev launch scripts, and
  check in CLAUDE.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Christophe Vila
2026-07-21 18:33:49 +02:00
parent 518bccf5ab
commit 2fab788208
8 changed files with 155 additions and 63 deletions

View File

@@ -146,15 +146,15 @@ func (c *mcpClient) callTool(ctx context.Context, name string, args map[string]a
if err != nil {
return "", fmt.Errorf("call tool %s: %w", name, err)
}
if res.IsError {
return "", fmt.Errorf("tool %s returned an error result", name)
}
var out strings.Builder
for _, content := range res.Content {
if tc, ok := content.(mcp.TextContent); ok {
out.WriteString(tc.Text)
}
}
if res.IsError {
return "", fmt.Errorf("tool %s returned an error result: %s", name, out.String())
}
return out.String(), nil
}