This commit is contained in:
Ayush Ojha 2026-01-30 13:18:57 +00:00 committed by GitHub
commit ee8b22373a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,8 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";
import type { OpenClawConfig } from "../config/config.js";
import {
@ -38,6 +40,13 @@ ${params.sessionContent.slice(0, 2000)}
Reply with ONLY the slug, nothing else. Examples: "vendor-pitch", "api-design", "bug-fix"`;
// Respect the user's configured default model instead of always using Opus.
const modelRef = resolveConfiguredModelRef({
cfg: params.cfg,
defaultProvider: DEFAULT_PROVIDER,
defaultModel: DEFAULT_MODEL,
});
const result = await runEmbeddedPiAgent({
sessionId: `slug-generator-${Date.now()}`,
sessionKey: "temp:slug-generator",
@ -46,6 +55,8 @@ Reply with ONLY the slug, nothing else. Examples: "vendor-pitch", "api-design",
agentDir,
config: params.cfg,
prompt,
provider: modelRef.provider,
model: modelRef.model,
timeoutMs: 15_000, // 15 second timeout
runId: `slug-gen-${Date.now()}`,
});