Bug Description
The session-memory hook (which saves session context when /new command is triggered) uses a hardcoded Anthropic Claude model for generating the session slug, instead of respecting the user's configured default model.
Root Cause
In dist/hooks/llm-slug-generator.js, the generateSlugViaLLM() function calls runEmbeddedPiAgent() without specifying the provider and model parameters:
const result = await runEmbeddedPiAgent({
sessionId: `slug-generator-${Date.now()}`,
// ... other params
// provider is NOT specified
// model is NOT specified
});
When these parameters are missing, pi-embedded-runner/run.js falls back to hardcoded defaults:
const provider = (params.provider ?? DEFAULT_PROVIDER).trim() || DEFAULT_PROVIDER; // "anthropic"
const modelId = (params.model ?? DEFAULT_MODEL).trim() || DEFAULT_MODEL; // "claude-opus-4-5"
Error Impact
Users who have configured a non-Anthropic default model (e.g., Kimi, GLM, etc.) but don't have an Anthropic API key will see this error when running /new:
FailoverError: No API key found for provider "anthropic".
This causes the session slug generation to fail, falling back to a timestamp-based slug instead of a descriptive one.
Proposed Fix
Modify dist/hooks/llm-slug-generator.js to resolve and use the user's configured default model:
import { resolveDefaultModelForAgent } from "../agents/model-selection.js";
export async function generateSlugViaLLM(params) {
// ...
const agentId = resolveDefaultAgentId(params.cfg);
// Resolve the user's configured default model
const defaultModel = resolveDefaultModelForAgent({ cfg: params.cfg, agentId });
const result = await runEmbeddedPiAgent({
// ...
provider: defaultModel.provider, // Use configured provider
model: defaultModel.model, // Use configured model
// ...
});
// ...
}
Environment
- OpenClaw version: 2026.1.30
- Configured default model:
kimi-coding/k2p5
- Error:
FailoverError: No API key found for provider "anthropic"
Workaround
Until this is fixed, users can either:
- Disable the session-memory hook:
openclaw hooks disable session-memory
- Configure an Anthropic API key:
openclaw agents add anthropic
Thanks for the great work on OpenClaw! 🦞
Bug Description
The
session-memoryhook (which saves session context when/newcommand is triggered) uses a hardcoded Anthropic Claude model for generating the session slug, instead of respecting the user's configured default model.Root Cause
In
dist/hooks/llm-slug-generator.js, thegenerateSlugViaLLM()function callsrunEmbeddedPiAgent()without specifying theproviderandmodelparameters:When these parameters are missing,
pi-embedded-runner/run.jsfalls back to hardcoded defaults:Error Impact
Users who have configured a non-Anthropic default model (e.g., Kimi, GLM, etc.) but don't have an Anthropic API key will see this error when running
/new:This causes the session slug generation to fail, falling back to a timestamp-based slug instead of a descriptive one.
Proposed Fix
Modify
dist/hooks/llm-slug-generator.jsto resolve and use the user's configured default model:Environment
kimi-coding/k2p5FailoverError: No API key found for provider "anthropic"Workaround
Until this is fixed, users can either:
openclaw hooks disable session-memoryopenclaw agents add anthropicThanks for the great work on OpenClaw! 🦞