Skip to content

Gemini using tools #461

@sergiocarracedo

Description

@sergiocarracedo

I configured gemini as provider, the test model works, but when i try to use it i got

CompletionError: ProviderError: Google Gemini API error (400 Bad Request: unknown error)

This happens when the agent (or cortex) tries to use a tool.

  • The google studio logs, only register the 200 requests on the logs, so it seems this error happens in the client

The workers' logs do not provide too much info:

=== Worker Failure Log ===
Worker ID: 13ba05b3-9d2f-4de1-98ed-c8ad4b55d9e6
Channel ID: discord:gym-ai-trainer:1480857962745692250:1480875499059286046
Timestamp: 2026-03-20T11:03:28.031192277+00:00
State: Failed

--- Task ---
Fetch Sergio's most recent completed workout from Hevy and the scheduled Full Body C routine. Check the workout titles, dates, exercises, weights, and duration. Return all data in a structured format.

--- Error ---
CompletionError: ProviderError: Google Gemini API error (400 Bad Request: unknown error)

--- History (3 messages) ---

[0] User:
  Fetch Sergio's most recent completed workout from Hevy and the scheduled Full Body C routine. Check the workout titles, dates, exercises, weights, and duration. Return all data in a structured format.

[1] Assistant:
  Tool Call: read_skill (id: 97v6wmjj)
    Args: {"name":"hevy-api"}

[2] User:
  Tool Result (id: unknown):
    {"content":"# Hevy API Skill\n\nThis skill provides full access to the Hevy fitness tracking API.\n\n## Prerequisites\n\nThis skill requires a Hevy API key stored in `.env`:\n\n```\nHEVY_API_KEY=your-api-key-here\n```\n\n### Getting an API Key\n\nIf the user doesn't
 have an API key:\n1. Ask if they have one\n2. If yes: ask them to provide it, then write to `.env`\n3. If no: suggest using the `hevy-export` skill instead (CSV export via browser)\n\n## Available Scripts\n\nAll scripts are TypeScript and should be run with `npx tsx` f
rom the project root.\n\n---\n\n### Workouts\n\n#### Fetch Workouts\n\n```bash\nnpx tsx .opencode/skills/hevy-api/scripts/fetch-workouts.ts [--days=N] [--limit=N]\n```\n\nFetches recent workouts with full exercise and set data.\n- `--days=N`: Workouts from last N days (
default: 30)\n- `--limit=N`: Max workouts to return (default: 50)\n\nSaves to `data/workouts.json` and outputs JSON array.\n\n#### Fetch Workout Count\n\n```bash\nnpx tsx .opencode/skills/hevy-api/scripts/fetch-workout-count.ts\n```\n\nReturns the total number of workou
ts on the account: `{ \"workout_count\": 42 }`.\n\n#### Fetch Workout Events\n\n```bash\nnpx tsx .opencode/skills/hevy-api/scripts/fetch-workout-events.ts [--since=<ISO8601>]\n```\n\nReturns paginated workout events (updates or deletes) since a given date.\nUse to keep 
a local cache up to date without re-fetching all workouts.\n- `--since`: ISO 8601 date (default: `1970-01-01T00:00:00Z`)\n\nReturns a JSON array of events, each with `type: \"updated\" | \"deleted\"` and either a full workout object or `{ id, deleted_at }`.\n\n---\n\n##
# Users\n\n#### Fetch User Info\n\n```bash\nnpx tsx .opencode/skills/hevy-api/scripts/fetch-user-info.ts\n```\n\nReturns the authenticated user's profile: `{ id, name, url }`.\n\n---\n\n### Routines\n\n#### Fetch Routines (all)\n\n```bash\nnpx tsx .opencode/skills/hevy-
api/scripts/fetch-routines.ts\n```\n\nFetches all user routines with full exercise and set data. Saves to `data/ro...[truncated]
  • It happens not in any agent (even the ones dont use this skill)
  • Using other provider like opencode go , i dont have this error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions