-
-
Notifications
You must be signed in to change notification settings - Fork 69.3k
Isolated session tools schema serialization fails with kimi-coding provider #38669
Copy link
Copy link
Closed
Closed
Copy link
Description
Bug Report: Isolated session tools schema serialization fails with kimi-coding provider
Summary
When using kimi-coding/k2p5 provider with anthropic-messages API type, isolated sessions (e.g., cron jobs with sessionTarget: "isolated") fail to execute tools due to schema serialization error. Main/direct sessions work correctly.
Environment
- OpenClaw version: 2026.3.2
- Provider: kimi-coding
- API type: anthropic-messages
- Model: k2p5
Configuration
{
"models": {
"providers": {
"kimi-coding": {
"baseUrl": "https://api.kimi.com/coding/",
"api": "anthropic-messages",
"models": [{
"id": "k2p5",
"name": "Kimi for Coding",
"contextWindow": 262144,
"maxTokens": 32768
}]
}
}
}
}Steps to Reproduce
- Configure kimi-coding provider with anthropic-messages API type
- Create a cron job with
sessionTarget: "isolated" - Cron task attempts to use tools (e.g.,
web_search,web_fetch,read) - Error occurs immediately on first tool call
Expected Behavior
Isolated session should serialize tools schema correctly for Kimi's anthropic-messages API, just like main sessions do.
Actual Behavior
[Error: request could not be processed]
{"error":{"message":"23 validation errors:
{'type': 'missing', 'loc': ('body', 'tools', 0, 'function'), 'msg': 'Field required', 'input': {'name': 'read', 'description': '...', 'input_schema': {...}}}"
}}
Key Observations
- Main/direct sessions work fine - The same configuration works correctly for interactive chat
- Only isolated sessions fail - Cron jobs with
sessionTarget: "isolated"consistently fail - Tools schema format issue - Error suggests OpenClaw is sending:
But Kimi's anthropic-messages endpoint expects:
{"name": "read", "description": "...", "input_schema": {...}}{"type": "function", "function": {"name": "read", "description": "...", "parameters": {...}}}
Workaround
Change cron job to use sessionTarget: "main" instead of "isolated", though this risks polluting the main session context.
Related Issues
- Built-in Kimi provider template uses wrong API type, gets overwritten on upgrade/doctor #22409 - Kimi provider template uses wrong API type
- Kimi (Moonshot) local API integration unreliable — needs first-class provider support #18822 - Kimi local API integration unreliable
- [Bug]: Kimi Tool Binding Failures #29965 - Kimi Tool Binding Failures (Ollama)
Possible Root Cause
The tool schema serialization logic for isolated sessions may be using a different code path than main sessions, or may not be properly handling the anthropic-messages API format for Kimi.
Labels: bug, provider/kimi-coding, session/isolated, tools
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.