spacedriveapp / spacedriveapp/spacebot

Gemini using tools

Open
#461 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.4k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a tool call through the Gemini provider and compare its client-side request handling with the working OpenCode Go provider. Inspect the agent or cortex tool-call path and the worker failure logs; done means identifying the rejected request and making Gemini tool use complete successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.