feat: show routing decisions in footer status bar instead of hidden messages
This commit is contained in:
@@ -86,11 +86,7 @@ export default function (pi: ExtensionAPI) {
|
||||
// Pass-through if user locked the model manually
|
||||
if (isLocked && lockedModel) {
|
||||
pi.setModel(lockedModel);
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: `🔒 Locked → ${lockedModel.id || "unknown"}`,
|
||||
display: false,
|
||||
});
|
||||
ctx.ui.setStatus("router", `🔒 ${lockedModel.id || "unknown"}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -98,20 +94,12 @@ export default function (pi: ExtensionAPI) {
|
||||
if (prompt.trim().length < 15) {
|
||||
const model = getModel(ctx, "router-eval");
|
||||
if (model) pi.setModel(model);
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: `⚡ Short prompt → ${modelLabel("router-eval")}`,
|
||||
display: false,
|
||||
});
|
||||
ctx.ui.setStatus("router", `⚡ ${modelLabel("router-eval")}`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Show analyzing indicator
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: "🤔 Analyzing prompt intent...",
|
||||
display: false,
|
||||
});
|
||||
// Show analyzing indicator in status bar
|
||||
ctx.ui.setStatus("router", "🤔 Analyzing...");
|
||||
|
||||
try {
|
||||
const OPENROUTER_API_KEY = process.env["OPENROUTER_API_KEY"] || "";
|
||||
@@ -142,11 +130,7 @@ export default function (pi: ExtensionAPI) {
|
||||
if (!content) {
|
||||
const fallback = getModel(ctx, "free-core");
|
||||
if (fallback) pi.setModel(fallback);
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: `⚠️ Analysis failed → fallback ${modelLabel("free-core")}`,
|
||||
display: false,
|
||||
});
|
||||
ctx.ui.setStatus("router", `⚠️ fallback ${modelLabel("free-core")}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -189,22 +173,14 @@ export default function (pi: ExtensionAPI) {
|
||||
pi.setModel(model);
|
||||
}
|
||||
|
||||
// Show routing decision
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: `🎯 ${tag} (${lang}) → ${modelLabel(modelKey)}`,
|
||||
display: false,
|
||||
});
|
||||
// Show routing decision in status bar
|
||||
ctx.ui.setStatus("router", `🎯 ${tag} → ${modelLabel(modelKey)}`);
|
||||
|
||||
} catch (_error) {
|
||||
// Fallback gracefully on network drops
|
||||
const fallback = getModel(ctx, "free-core");
|
||||
if (fallback) pi.setModel(fallback);
|
||||
pi.sendMessage({
|
||||
customType: "router-status",
|
||||
content: `⚠️ Error → fallback ${modelLabel("free-core")}`,
|
||||
display: false,
|
||||
});
|
||||
ctx.ui.setStatus("router", `⚠️ fallback ${modelLabel("free-core")}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user