#Issues with bad requests

1 messages · Page 1 of 1 (latest)

barren kettle
#

[clawdbot] Cloud Code Assist API error (400): {
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name "if" at 'request.tools[0].function_declarations[11].parameters.all_of[0]': Cannot find field.\nInvalid JSON payload received. Unknown name "then" at 'request.tools[0].function_declarations[11].parameters.all_of[0]': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "request.tools[0].function_declarations[11].param…

lofty ospreyBOT
#

That's a Google Gemini API limitation — it doesn't support JSON Schema conditional keywords like if/then/else or allOf with those constructs. The tool definitions are using advanced JSON Schema features that OpenAPI/Gemini's function calling spec doesn't understand.

If you're trying to use Gemini with tools that have complex conditional parameter schemas, you'd need to either:

  1. Simplify the schema (flatten conditionals into separate optional params)
  2. Use a different model provider that supports full JSON Schema
  3. Strip unsupported keywords before sending to Gemini

Is this from a project you're working on, or are you reporting this happening with Clawdbot itself?

barren kettle
#

How can I switch off Gemini then

lofty ospreyBOT
#

This is for your own Clawdbot instance, right? You'd edit your config file (clawdbot.json in your state directory) and either:

  1. Remove Gemini from fallbacks — if it's in agents.defaults.model.fallbacks, just take it out of that array
  2. Change primary model — if Gemini is your agents.defaults.model.primary, swap it for something like anthropic/claude-sonnet-4 or openai/gpt-4o

Example config structure:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4",
        "fallbacks": []
      }
    }
  }
#
}

After editing, restart Clawdbot or run npx clawdbot doctor to pick up the changes.

Where do you have Gemini configured — as primary or fallback?

barren kettle
#

This should be fall back also I am not asking question still in the background I am keeping these responses

lofty ospreyBOT
#

Got it — just empty out the fallbacks array in your config:

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4",
        "fallbacks": []
      }
    }
  }
}

Or if you want a fallback that actually works with the tool schemas, use another Anthropic or OpenAI model instead of Gemini:

#
"fallbacks": ["anthropic/claude-haiku-3", "openai/gpt-4o-mini"]

The issue is Gemini's function calling doesn't support full JSON Schema — so any tool with conditional params (if/then) will fail. Anthropic and OpenAI handle those fine.

barren kettle
lofty ospreyBOT
#

I can't watch videos unfortunately — can you share a screenshot or describe what you're showing? Is it your config file or the error happening in real-time?

barren kettle
lofty ospreyBOT
#

Ah, I see — those Gemini errors are being sent directly to your WhatsApp chat. That's annoying!

Yeah, remove Gemini from your fallbacks array. Your config file should be at something like ~/.clawdbot/clawdbot.json or wherever you set up your state directory. Find the fallbacks array and either empty it or replace with models that support full JSON Schema:

"fallbacks": []

or

"fallbacks": ["anthropic/claude-haiku-3"]

Then restart Clawdbot. That'll stop the Gemini attempts and those error messages flooding your chat.

barren kettle
#

Does everyone use a 200$ model pricing because with 20$ I am running out of credits very soon

lofty ospreyBOT
#

$20 can go fast depending on which model you're using:

Model Input Output
Claude Opus $15/M tokens $75/M tokens
Claude Sonnet $3/M tokens $15/M tokens
Claude Haiku $0.25/M tokens $1.25/M tokens

Tips to stretch your credits:

  1. Use Sonnet as primary — it's 5x cheaper than Opus and handles most tasks fine
  2. Use Haiku for simple stuff — great for quick questions, summarization
  3. Shorter system prompts — big AGENTS.md files eat tokens every message
  4. Disable tools you don't use — each tool definition costs input tokens

If you're burning through $20 quickly, check:

  • Are you using Opus? Switch to Sonnet
#
  • Long conversations? Start fresh sessions more often
  • Lots of tool calls? Each one adds overhead

Most people run Sonnet day-to-day and only switch to Opus for complex reasoning tasks. What's your primary model set to right now?

barren kettle
#

Seeing these very often as well

lofty ospreyBOT
#

Ah, that's a different issue — your Clawdbot can't access Bash/Read tools because it's running in a mode that depends on a Mac node connection.

Two options:

  1. Keep the Mac node connected — Open the Clawdbot companion app on your Mac and keep it running. The node provides bash/file access to the cloud-hosted bot.

  2. Run Clawdbot directly on Mac — Instead of cloud-hosted with a node, run the gateway locally:

    npx clawdbot
    

    Then it has direct access to your filesystem without needing a node connection.

The "tools broken" errors happen because the bot expects to run commands through your Mac, but the app isn't open/connected.

Quick fix: Just open the Clawdbot app on your Mac and leave it running. The node will reconnect and tools will work again.

Are you running Clawdbot cloud-hosted or locally?

barren kettle
#

Running on a Mac directly with a curl command never installed the Mac app

lofty ospreyBOT
#

If you're running directly on Mac via npx clawdbot, you shouldn't need the Mac app at all — tools should work natively.

Something's misconfigured. Check a few things:

  1. How are you starting it?

    npx clawdbot
    

    Should be all you need.

  2. Check your config for tool restrictions — look in your clawdbot.json for a tools section that might be blocking things:

    cat ~/.clawdbot/clawdbot.json | grep -A 10 '"tools"'
    
  3. Check the logs for what's actually failing:

#
   tail -100 ~/.clawdbot/logs/gateway.log
  1. Try restarting:
    # Kill existing
    pkill -f clawdbot
    # Start fresh
    npx clawdbot
    

What does your startup command look like? And what's in your tools config section (if anything)?

barren kettle
#

Also I want clawdbot to look at diff folder for config like Clawd-whatsapp where I have some memory some skills locally created

lofty ospreyBOT
#

You can set the working directory when starting Clawdbot:

# Option 1: Start from that directory
cd ~/clawd-whatsapp && npx clawdbot

# Option 2: Set CLAWD_HOME environment variable
CLAWD_HOME=~/clawd-whatsapp npx clawdbot

# Option 3: Use --cwd flag (if supported)
npx clawdbot --cwd ~/clawd-whatsapp

The bot uses its working directory for:

  • AGENTS.md, SOUL.md, USER.md, etc.
  • memory/ folder
  • Local skills in skills/
#

So just cd into your clawd-whatsapp folder before running, and it'll pick up everything there.

For the state/config (credentials, clawdbot.json), that's separate — usually in ~/.clawdbot/. If you want that elsewhere too:

CLAWDBOT_STATE=~/clawd-whatsapp/.state npx clawdbot

Try:

cd ~/clawd-whatsapp
npx clawdbot

Does that pick up your memory and skills?

barren kettle
#

Let’s say if I have my personal machine where clawdbot is running and in the same network I have my office Mac can clawdbot access both ?

lofty ospreyBOT
#

Yes! That's exactly what the node system is for.

Setup:

  1. Personal Mac (main) — runs the full gateway:

    cd ~/clawd-whatsapp && npx clawdbot
    
  2. Office Mac (remote) — runs the node/companion app that connects to your gateway:

    npx clawdbot node
    

    It'll show a pairing code. Approve it from your main instance.

Once paired, Clawdbot can:

  • Run bash commands on either machine
#
  • Access files on both
  • Take screenshots/camera snaps from either
  • You specify which node when needed

Example usage:

"Run this on my office Mac: ls ~/Projects"
"Take a screenshot of my office Mac"

The nodes connect over your network (or internet if configured) and the bot can target them by name.

To check connected nodes:
You can ask the bot "show my nodes" or it'll tell you when one connects/disconnects.

Want me to walk you through the pairing process once you've got the gateway stable on your personal Mac?

barren kettle
lofty ospreyBOT
#

What happens when you run it?

  • Does it error out?
  • Does it start but then tools don't work?
  • Does it just hang?

Share the output you're seeing:

cd ~/clawd-whatsapp
npx clawdbot 2>&1 | head -50

Or if there's an error, screenshot it — that'll help me figure out what's going wrong.

barren kettle
lofty ospreyBOT
#

You need to specify the gateway command — just npx clawdbot shows help:

npx clawdbot gateway

Or to run it as a background daemon:

npx clawdbot daemon start

That'll actually start the gateway and connect to WhatsApp/Discord/etc.

barren kettle
#

Did all that I restarted now it doesn’t respond back

lofty ospreyBOT
#

The bot's still trying Gemini and failing. You need to edit your config to remove it.

Find and edit your config:

# Find it
ls ~/.clawdbot/clawdbot.json

# Or if using a custom location
ls ~/clawd-whatsapp/.clawdbot/clawdbot.json

# Edit it
nano ~/.clawdbot/clawdbot.json

Look for the fallbacks array and empty it:

#
"model": {
  "primary": "anthropic/claude-sonnet-4",
  "fallbacks": []
}

Or run the configure wizard:

npx clawdbot configure

That'll let you pick models interactively.

After changing config, restart:

#
npx clawdbot daemon restart

Can you share what your current model config looks like? Run:

cat ~/.clawdbot/clawdbot.json | grep -A 5 '"model"'
barren kettle
lofty ospreyBOT
#

My bad — the command is nodes (plural), not node:

npx clawdbot nodes --help

That'll show you the pairing options. Likely something like:

# On the remote Mac (office)
npx clawdbot nodes pair

Or check what subcommands are available:

npx clawdbot nodes
#

What output do you get from npx clawdbot nodes --help?

barren kettle
#

I don’t see a pair command can you verify again ?

lofty ospreyBOT
#

Hey bheem1798! Could you give me a bit more context on what you're looking for? Are you asking about:

  1. Pairing a device/node with Clawdbot (like a phone or computer)?
  2. Some specific command that was mentioned earlier in a conversation I don't have context for?
  3. Something else entirely?

The thread starter shows a Google API error about if/then fields in JSON schema - is the "pair command" related to troubleshooting that, or is this a separate question?

barren kettle
#

Pairing another computer on same network

lofty ospreyBOT
#

Ah, pairing another computer! Here's how:

On the computer you want to pair:

npx clawd pair <gateway-url>

The gateway URL is your Clawdbot instance - something like https://your-clawdbot-domain.com or if it's local, could be http://192.168.x.x:3000 (whatever IP/port your main Clawdbot is running on).

Then I'll see the pairing request

Once you run that, the request will come to me and I can approve it. Let me check if there are any pending requests right now:

#

No pending requests yet - run the npx clawd pair <gateway-url> command on the other machine and I'll see it pop up here. Once it does, I'll approve it and you'll be connected! đź”—

barren kettle