#Unhandled promise rejection

1 messages ยท Page 1 of 1 (latest)

brazen latch
#

keep getting this after updating for kimi and entering my api. using minimax as well. why is this happening?

[clawdbot] Unhandled promise rejection: Error: Unhandled API in mapOptionsForApi: undefined
at mapOptionsForApi (file:///opt/homebrew/lib/node_modules/clawdbot/node_modules/@mariozechner/pi-ai/src/stream.ts:471:10)
at streamSimple (file:///opt/homebrew/lib/node_modules/clawdbot/node_modules/@mariozechner/pi-ai/src/stream.ts:218:26)
at streamAssistantResponse (file:///opt/homebrew/lib/node_modules/clawdbot/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:233:25)
at runLoop (file:///opt/homebrew/lib/node_modules/clawdbot/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:141:20)
at file:///opt/homebrew/lib/node_modules/clawdbot/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:51:3

queen gazelleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> โœ… Mark Solution

brazen latch
#

@waxen nacelle please help.

waxen nacelleBOT
# brazen latch keep getting this after updating for kimi and entering my api. using minimax as ...

This error indicates Clawdbot received an undefined/unrecognized API type when trying to route your request. Here's how to troubleshoot:

Quick Checks

  1. Verify your config - Make sure you haven't accidentally deleted or corrupted the api section. Check for:

    • Missing closing brackets or commas
    • Extra/missing quotes around API names
    • Using old config keys from a previous version
  2. Test API keys individually - Try one provider at a time:

    clawdbot model --list
    

    This shows available models and can reveal config issues.

  3. Run a version check:

#
   clawdbot --version

Sometimes updates don't fully apply until you restart the gateway.

Common Causes

  • Kimi support was just added - your config might have an old structure that's incompatible
  • Misspelled API name in your config (e.g., "minimax" vs "MiniMax" - check case sensitivity)
  • Corrupted config file - try renaming ~/.clawdbot/config.json5 to backup and letting it regenerate with defaults, then reconfigure

Next Steps

Can you share:

  1. Your clawdbot version (clawdbot --version)
  2. Your relevant config (api section) - remove the actual API keys but show the structure
#

This will help pinpoint whether it's a config format issue or a Kimi-specific compatibility problem.

waxen nacelleBOT
# brazen latch <@1457407575476801641> please help.

Hey! ๐Ÿฆ Let me help you debug this. That error means Clawdbot is getting undefined when trying to figure out which API to use.

Immediate Steps

  1. Check your version:

    clawdbot --version
    

    If you're on an old version, run:

    clawdbot gateway update
    
  2. Test with just one API - Comment out/remove Kimi from your config and test with Minimax alone. Does it work then?

  3. Verify config structure - Here's a working example format:

#
   api: {
     kimi: {
       apiKey: "your-key-here",
       model: "moonshot-v1-8k" // or moonshot-v1-32k, moonshot-v1-128k
     },
     minimax: {
       apiKey: "your-minimax-key",
       model: "MiniMax-M2.1"
     }
   }
  1. Try resetting:
    clawdbot gateway restart
    
#

If That Doesn't Work

Run this and share the output (hide API keys):

clawdbot config.get api

This will show us exactly what Clawdbot is seeing. The "undefined" suggests either a bad config entry or a Kimi integration bug that just shipped. Which version are you on?

brazen latch
#
  1. 2026.1.24-3

where can i find my config structure

waxen nacelleBOT
#
clawdbot config.get api

Edit the config:

clawdbot config.edit

(Or open the file directly in your editor of choice)

What to Look For

Make sure your Kimi/Minimax entries look something like this:

api: {
#
  kimi: {
    apiKey: "sk-...",
    model: "moonshot-v1-8k"  // Check this matches actual Kimi model names
  },
  minimax: {
    apiKey: "...",
    model: "MiniMax-M2.1"
  }
}

Common pitfalls:

  • model value might be wrong for Kimi (it's not "kimi", it's one of: moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k)
  • Extra commas or missing quotes
  • Case sensitivity on "MiniMax" vs "minimax"
#

Run clawdbot config.get api and paste the output here (hide your API keys) and I'll spot the issue!

brazen latch
#

clawdbot config.edit
clawdbot config.get api

invalid commands

waxen nacelleBOT
#
nano ~/.clawdbot/config.json5
# or
vim ~/.clawdbot/config.json5
# or
code ~/.clawdbot/config.json5  # if you have VS Code

Check Available Commands

clawdbot --help

This will show you what commands your version supports.


#

While you do that, share:

  1. What OS are you on? (macOS/Linux?)
  2. Did you install via Homebrew (brew install clawdbot) or another way?

That'll help me get you the exact right commands. The "invalid command" suggests either the CLI is structured differently on your install, or there's a path issue.

brazen latch
#

i updated my models API key via clawdbot config. am i creating conflict?

#

@waxen nacelle

waxen nacelleBOT
#

I can't see the image content directly in this chat. Can you paste the text content of your config here? Specifically the api section.

Something like:

{
  api: {
    kimi: { ... },
    minimax: { ... }
  }
}

Or just share what you see in that file and I'll spot the issue!

waxen nacelleBOT
# brazen latch <@1457407575476801641>

Hey! I see you shared a screenshot but I can't view images in this chat interface.

Can you copy and paste the text from your config file here? Just the api section would be fine.

The error Unhandled API in mapOptionsForApi: undefined almost always means:

  • A missing comma
  • A typo in the API name
  • An unsupported model name

Paste what you have and I'll find it immediately! ๐Ÿฆ

brazen latch
#

@waxen nacelle

waxen nacelleBOT
# brazen latch <@1457407575476801641>

I see you! No worries, let's get this sorted. ๐Ÿฆ

I really need you to copy/paste the text - I can't access the screenshot.

Just run this and send me the output:

cat ~/.clawdbot/config.json5

Or if you can type it out manually, the api section should look like:

api: {
  kimi: {
    apiKey: "sk-..."
    model: "moonshot-v1-8k"
  },
#
  minimax: {
    apiKey: "..."
    model: "MiniMax-M2.1"
  }
}

The most likely culprit: Kimi model names need to be one of:

  • moonshot-v1-8k
  • moonshot-v1-32k
  • moonshot-v1-128k

Not "kimi", not "KimAI", not just any random string.

Can you paste your config and I'll find exactly what's wrong?

brazen latch
#

how do i reset my config without losing my memory?

#

@waxen nacelle

waxen nacelleBOT
# brazen latch how do i reset my config without losing my memory?

Easy! Your memory is stored separately from config.

Backup & Reset

# 1. Backup your current config
cp ~/.clawdbot/config.json5 ~/.clawdbot/config.json5.backup

# 2. Remove the config (will regenerate defaults)
rm ~/.clawdbot/config.json5

# 3. Restart clawdbot to generate new config
clawdbot gateway restart

After Restart

#
# 4. Check the new default config structure
cat ~/.clawdbot/config.json5

Then just add your API keys back:

api: {
  kimi: {
    apiKey: "sk-your-key-here",
    model: "moonshot-v1-8k"
  },
  minimax: {
    apiKey: "your-minimax-key",
    model: "MiniMax-M2.1"
  }
#
}

Verify Memory is Safe

Your memories are in ~/.clawdbot/memory/ - that folder stays untouched.

ls ~/.clawdbot/memory/

Good to go! Let me know if you hit any issues. ๐Ÿฆ

waxen nacelleBOT
# brazen latch <@1457407575476801641>

Hey! Did the reset work, or do you need help with the commands?

If you're stuck, just paste what you have in your config now and I'll help fix it directly. No reset needed if we can spot the issue! ๐Ÿฆ

brazen latch
#

i tried kimi code it cannot be configured properly. ive set up the api key via clawdbot config and under moonshot for models

waxen nacelleBOT
# brazen latch i tried kimi code it cannot be configured properly. ive set up the api key via c...

This is a known bug tracked in GitHub issue #1695. The error happens because the api field from provider config isn't properly reaching the stream code.

Good news: There's already a fix merged in PR #3322 that should be in the next release.

Temporary workaround for now:

  1. For LM Studio users - explicitly set api in your provider config:
"models": {
  "providers": {
    "lmstudio": {
      "baseUrl": "http://127.0.0.1:1234/v1",
      "apiKey": "LMSTUDIO_KEY",
      "api": "openai-completions",
      "models": [...]
    }
#
  }
}
  1. Make sure your primary model uses the provider prefix, e.g.:
"agents": {
  "defaults": {
    "model": {
      "primary": "lmstudio/minimax-m2.1-gs32"
    }
  }
}

The issue affects any custom/OpenAI-compatible provider (LM Studio, Kimi/Moonshot, local models) when the api field isn't explicitly declared or isn't being read from config properly.

brazen latch
#

how do i reintate my memory and skills

#

{"0":"{"subsystem":"gateway/ws"}","1":{"cause":"invalid-handshake","handshake":"failed","durationMs":13,"lastFrameType":"req","lastFrameMethod":"connect","lastFrameId":"C323D20E-82B1-4286-99A1-

getting these type of errors. whats going on

waxen nacelleBOT
# brazen latch {"0":"{\"subsystem\":\"gateway/ws\"}","1":{"cause":"invalid-handshake","handshak...

That's a WebSocket handshake failure - the gateway can't establish a connection. This usually means:

  1. Gateway crashed or restarted - Run clawdbot gateway status to check
  2. Port conflict - Something else is using the gateway port
  3. Network issue - Especially if connecting remotely

Quick checks:

# Check if gateway is running
clawdbot gateway status

# If not running, start it
clawdbot gateway start

# If stuck, force restart