Skip to content

Commit c866eda

Browse files
VACIncroboclaw-bot
authored andcommitted
fix(agents): read the published model catalog owner from session_status
1 parent a868258 commit c866eda

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎src/agents/openclaw-tools.session-status.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,12 @@ function createConfigModuleMock() {
205205
function createModelCatalogModuleMock() {
206206
return {
207207
loadProviderScopedThinkingCatalog: async () => [],
208-
loadPreparedModelCatalog: async () => [
208+
// A run's captured config goes stale after any Gateway config republish; the exact
209+
// loader then throws, and session_status must read the published owner instead.
210+
loadPreparedModelCatalog: async () => {
211+
throw new Error("prepared model catalog owner config was replaced during the read (/tmp)");
212+
},
213+
loadPublishedPreparedModelCatalog: async () => [
209214
{
210215
provider: "anthropic",
211216
id: "claude-sonnet-4-6",

‎src/agents/tools/session-status-tool.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import {
6868
resolveThinkingDefaultWithRuntimeCatalog,
6969
} from "../model-selection.js";
7070
import { createModelVisibilityPolicy } from "../model-visibility-policy.js";
71-
import { loadPreparedModelCatalog } from "../prepared-model-catalog.js";
71+
import { loadPublishedPreparedModelCatalog } from "../prepared-model-catalog.js";
7272
import { resolveSessionModelIdentityRef } from "../session-model-ref.js";
7373
import {
7474
describeSessionStatusTool,
@@ -502,7 +502,7 @@ async function resolveModelOverride(params: {
502502
agentId: params.agentId,
503503
defaultProvider: currentProvider,
504504
});
505-
const catalog = await loadPreparedModelCatalog({
505+
const catalog = await loadPublishedPreparedModelCatalog({
506506
config: params.cfg,
507507
agentId: params.agentId,
508508
agentDir: params.agentDir,
@@ -1130,7 +1130,7 @@ export function createSessionStatusTool(opts?: {
11301130
config: cfg,
11311131
});
11321132
// Tool status may read persisted/configured facts, but must not start provider discovery.
1133-
const thinkingCatalog = await loadPreparedModelCatalog({
1133+
const thinkingCatalog = await loadPublishedPreparedModelCatalog({
11341134
config: cfg,
11351135
agentId,
11361136
agentDir: selectedAgentDir,
@@ -1163,7 +1163,7 @@ export function createSessionStatusTool(opts?: {
11631163
provider: providerForCard,
11641164
model: defaultModelForCard,
11651165
loadRuntimeCatalog: () =>
1166-
loadPreparedModelCatalog({
1166+
loadPublishedPreparedModelCatalog({
11671167
config: cfg,
11681168
agentId,
11691169
agentDir: selectedAgentDir,

0 commit comments

Comments
 (0)