mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix: /status is too verbose for pinned model sessions (#95797)
* fix: compact status model override output * fix: align compact status override wording
This commit is contained in:
@@ -1470,7 +1470,7 @@ describe("buildStatusReply subagent summary", () => {
|
||||
});
|
||||
|
||||
const normalized = normalizeTestText(text);
|
||||
expect(normalized).toContain("Session selected: anthropic/claude-opus-4-7");
|
||||
expect(normalized).toContain("Model: anthropic/claude-opus-4-7");
|
||||
expect(normalized).toContain("oauth (claude-cli)");
|
||||
expect(normalized).not.toContain("api-key (env: ANTHROPIC_API_KEY)");
|
||||
expect(normalized).not.toContain("Usage:");
|
||||
|
||||
@@ -1732,7 +1732,7 @@ describe("buildStatusMessage", () => {
|
||||
});
|
||||
|
||||
const normalized = normalizeTestText(text);
|
||||
expect(normalized).toContain("Session selected: google/gemini-3.1-flash-lite");
|
||||
expect(normalized).toContain("Model: google/gemini-3.1-flash-lite");
|
||||
expect(normalized).not.toContain("Fallbacks:");
|
||||
});
|
||||
|
||||
@@ -1765,7 +1765,7 @@ describe("buildStatusMessage", () => {
|
||||
expect(normalizeTestText(text)).toContain("Model: google-antigravity/claude-sonnet-4-6");
|
||||
});
|
||||
|
||||
it("warns when the session-selected model differs from the configured default", () => {
|
||||
it("renders session-selected model overrides compactly", () => {
|
||||
const text = buildStatusMessage({
|
||||
agent: {
|
||||
model: "zhipu/glm-4.5-air",
|
||||
@@ -1785,14 +1785,14 @@ describe("buildStatusMessage", () => {
|
||||
});
|
||||
|
||||
const normalized = normalizeTestText(text);
|
||||
expect(normalized).toContain("Configured default: zhipu/glm-4.5-air");
|
||||
expect(normalized).toContain("Session selected: deepseek/deepseek-v4-flash");
|
||||
expect(normalized).toContain("Reason: session override");
|
||||
expect(normalized).toContain(
|
||||
"This session is pinned to deepseek/deepseek-v4-flash; config primary zhipu/glm-4.5-air will apply to new/unpinned sessions.",
|
||||
);
|
||||
expect(normalized).toContain("Clear with: /model default");
|
||||
expect(normalized).toContain(
|
||||
expect(normalized).toContain("Model: deepseek/deepseek-v4-flash");
|
||||
expect(normalized).toContain("pinned session; config primary zhipu/glm-4.5-air");
|
||||
expect(normalized).toContain("clear /model default");
|
||||
expect(normalized).not.toContain("Configured default:");
|
||||
expect(normalized).not.toContain("Session selected:");
|
||||
expect(normalized).not.toContain("Reason: session override");
|
||||
expect(normalized).not.toContain("This session is pinned");
|
||||
expect(normalized).not.toContain(
|
||||
"Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -60,7 +60,8 @@ describe("buildStatusMessage context window", () => {
|
||||
modelAuth: "api-key",
|
||||
});
|
||||
|
||||
expect(text).toContain("Session selected: ollama-cloud/glm-5.1");
|
||||
expect(text).toContain("Model: ollama-cloud/glm-5.1");
|
||||
expect(text).toContain("pinned session; config primary ollama-cloud/deepseek-v4-pro");
|
||||
expect(text).toContain("Context: 128k/200k");
|
||||
expect(text).not.toContain("Context: 128k/1.0m");
|
||||
});
|
||||
@@ -127,5 +128,4 @@ describe("buildStatusMessage context window", () => {
|
||||
expect(text).toContain("Context: 36k/1.0m");
|
||||
expect(text).not.toContain("Context: 36k/200k");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1070,16 +1070,12 @@ export function buildStatusMessage(args: StatusArgs): string {
|
||||
!areRuntimeModelRefsEquivalent(selectedModelLabel, configuredDefaultModelLabel, {
|
||||
config: args.config,
|
||||
});
|
||||
const modelLines = configDefaultDiffersFromSession
|
||||
? [
|
||||
`🧠 Configured default: ${configuredDefaultModelLabel}`,
|
||||
`📌 Session selected: ${selectedModelLabel}${selectedAuthLabel}${modelNote}`,
|
||||
"⚠️ Reason: session override",
|
||||
`⚠️ This session is pinned to ${selectedModelLabel}; config primary ${configuredDefaultModelLabel} will apply to new/unpinned sessions.`,
|
||||
"↩️ Clear with: /model default",
|
||||
"📖 Docs: https://docs.openclaw.ai/concepts/models#selection-source-and-fallback-behavior",
|
||||
]
|
||||
: [`🧠 Model: ${selectedModelLabel}${selectedAuthLabel}${modelNote}`];
|
||||
const overrideLabel = configDefaultDiffersFromSession
|
||||
? ` · pinned session; config primary ${configuredDefaultModelLabel} · clear /model default`
|
||||
: "";
|
||||
const modelLines = [
|
||||
`🧠 Model: ${selectedModelLabel}${selectedAuthLabel}${modelNote}${overrideLabel}`,
|
||||
];
|
||||
|
||||
// Show configured fallback models (from agent model config)
|
||||
const configuredFallbacks = (() => {
|
||||
|
||||
Reference in New Issue
Block a user