Summary
The session-memory internal hook's LLM slug generator fails when using non-Anthropic model providers (e.g., Kimi, OpenAI, Google) because it doesn't properly pass the agent's configured model to temporary sessions, falling back to hardcoded Anthropic defaults.
Environment
- OpenClaw version: 2026.1.30
- Node version: v22.22.0
- OS: macOS (Darwin 25.2.0)
- Configured model:
kimi-coding/k2p5 (Kimi K2.5)
Steps to Reproduce
- Configure openclaw to use a non-Anthropic model provider:
{
"agents": {
"defaults": {
"model": {
"primary": "kimi-coding/k2p5"
}
}
}
}
- Enable the session-memory hook:
{
"hooks": {
"internal": {
"enabled": true,
"entries": {
"session-memory": {
"enabled": true
}
}
}
}
}
- Run the
/new command to trigger session memory saving
Expected Behavior
The session-memory hook should use the agent's configured primary model (kimi-coding/k2p5) to generate LLM-based filename slugs.
Actual Behavior
The hook fails with authentication errors:
[diagnostic] lane task error: lane=session:temp:slug-generator durationMs=12 error="FailoverError: No API key found for provider "anthropic". Auth store: /Users/shelly/.openclaw/agents/main/agent/auth-profiles.json"
[llm-slug-generator] Failed to generate slug: FailoverError: No API key found for provider "anthropic"
The hook falls back to timestamp-based slugs instead of using LLM-generated descriptive names.
Root Cause
1. Hardcoded defaults in /dist/agents/defaults.js:
export const DEFAULT_PROVIDER = "anthropic";
export const DEFAULT_MODEL = "claude-opus-4-5";
2. Missing model parameter in /dist/hooks/llm-slug-generator.js:
The generateSlugViaLLM() function calls runEmbeddedPiAgent() without passing the model parameters:
const result = await runEmbeddedPiAgent({
sessionId: `slug-generator-${Date.now()}`,
sessionKey: "temp:slug-generator",
sessionFile: tempSessionFile,
workspaceDir,
agentDir,
config: params.cfg, // ← Config is passed but model not extracted
prompt,
timeoutMs: 15_000,
runId: `slug-gen-${Date.now()}`,
});
When no provider and model parameters are provided, runEmbeddedPiAgent() uses the hardcoded DEFAULT_PROVIDER and DEFAULT_MODEL from defaults.js.
Suggested Fix
Modify /dist/hooks/llm-slug-generator.js to extract and pass the configured model:
// Add import
import { parseModelRef } from "../agents/model-selection.js";
// In generateSlugViaLLM function, before calling runEmbeddedPiAgent:
const primaryModel = params.cfg?.agents?.defaults?.model?.primary;
const parsedModel = primaryModel ? parseModelRef(primaryModel) : null;
const result = await runEmbeddedPiAgent({
sessionId: `slug-generator-${Date.now()}`,
sessionKey: "temp:slug-generator",
sessionFile: tempSessionFile,
workspaceDir,
agentDir,
config: params.cfg,
provider: parsedModel?.provider, // ← Add this
model: parsedModel?.model, // ← Add this
prompt,
timeoutMs: 15_000,
runId: `slug-gen-${Date.now()}`,
});
Impact
- Users with non-Anthropic model providers cannot use the session-memory hook's LLM slug generation feature
- Error messages clutter logs even though the feature gracefully falls back to timestamps
- Reduces the utility of session memory feature for users not using Anthropic models
Additional Context
This appears to be a broader issue where temporary/embedded sessions don't properly inherit the agent's model configuration. Other features that use runEmbeddedPiAgent() for temporary sessions might have similar issues.
Workaround
Temporarily patch /opt/homebrew/lib/node_modules/openclaw/dist/hooks/llm-slug-generator.js with the suggested fix above, or disable the session-memory hook.
Summary
The
session-memoryinternal hook's LLM slug generator fails when using non-Anthropic model providers (e.g., Kimi, OpenAI, Google) because it doesn't properly pass the agent's configured model to temporary sessions, falling back to hardcoded Anthropic defaults.Environment
kimi-coding/k2p5(Kimi K2.5)Steps to Reproduce
{ "agents": { "defaults": { "model": { "primary": "kimi-coding/k2p5" } } } }{ "hooks": { "internal": { "enabled": true, "entries": { "session-memory": { "enabled": true } } } } }/newcommand to trigger session memory savingExpected Behavior
The session-memory hook should use the agent's configured primary model (
kimi-coding/k2p5) to generate LLM-based filename slugs.Actual Behavior
The hook fails with authentication errors:
The hook falls back to timestamp-based slugs instead of using LLM-generated descriptive names.
Root Cause
1. Hardcoded defaults in
/dist/agents/defaults.js:2. Missing model parameter in
/dist/hooks/llm-slug-generator.js:The
generateSlugViaLLM()function callsrunEmbeddedPiAgent()without passing the model parameters:When no
providerandmodelparameters are provided,runEmbeddedPiAgent()uses the hardcodedDEFAULT_PROVIDERandDEFAULT_MODELfromdefaults.js.Suggested Fix
Modify
/dist/hooks/llm-slug-generator.jsto extract and pass the configured model:Impact
Additional Context
This appears to be a broader issue where temporary/embedded sessions don't properly inherit the agent's model configuration. Other features that use
runEmbeddedPiAgent()for temporary sessions might have similar issues.Workaround
Temporarily patch
/opt/homebrew/lib/node_modules/openclaw/dist/hooks/llm-slug-generator.jswith the suggested fix above, or disable the session-memory hook.