routing: a failed try shows what its vendor said, and the errors count opens the newest failed request (Discord: 蓝猫, Devin 502 — Agent 收到的错误 did nothing when clicked) — the trace kept each try's error word for word, but the page only told magpie's reading of it (403 · failed), so the vendor's own reason was nowhere to be seen. Now it is under that try, and clicking the errors count picks the latest request whose agent got an error. Checked in a sandbox magpie web with a fake vendor answering 403

This commit is contained in:
yetone
2026-09-29 14:08:03 +08:00
parent 17ad8f9332
commit bd71a587ef
3 changed files with 19 additions and 1 deletions
+2
View File
@@ -943,6 +943,8 @@ const I18N = {
"requests": "请求",
"rerouted": "改道",
"errors your agent saw": "Agent 收到的错误",
"It said: {error}": "原话:{error}",
"Show the latest request that failed": "查看最近一个失败的请求",
"rate limited": "限流",
"out of credit": "余额不足",
"quota used up": "额度用尽",
+3
View File
@@ -103,6 +103,9 @@
.rt-steps li.why { color: var(--fg); }
.rt-steps li.why::before { background: var(--fg); }
.rt-steps li.aside { color: var(--muted); }
.rt-steps li.said { font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.rt-stats > span.rt-errs { cursor: pointer; }
.rt-stats > span.rt-errs:hover b { color: var(--red); }
.rt-steps li.aside::before { background: none; border: 1px solid var(--muted); width: 4px; height: 4px; }
.rt-steps li.ok::before { background: var(--green); }
.rt-steps li.bad::before { background: var(--red); }
+14 -1
View File
@@ -54,6 +54,15 @@
const s = el("span"), b = el("b", "", "0");
s.append(b, el("span", "", k));
s.dataset.label = k;
if (k === "errors your agent saw") {
// the newest request whose agent got an error, to see what it got
s.classList.add("rt-errs");
s.title = t("Show the latest request that failed");
s.addEventListener("click", (e) => {
const r = listed().find((x) => x.done && x.status >= 400);
if (r) pick(r, e);
});
}
statB.push(b);
stats.append(s);
}
@@ -887,7 +896,11 @@
items.push([affWhy(r, true) || ruleWhy(r, true) || firstWhy(r), "why"]);
for (const s of nestedWhy(r)) items.push([s, "why"]);
for (const a of asides(r)) items.push([a, "aside"]);
r.tries.forEach((_, i) => items.push([tryWhy(r, i), r.tries[i].done ? (r.tries[i].status < 400 ? "ok" : "bad") : "wait"]));
r.tries.forEach((tr, i) => {
items.push([tryWhy(r, i), tr.done ? (tr.status < 400 ? "ok" : "bad") : "wait"]);
// what the vendor said, word for word: the why above is magpie's reading of it
if (tr.done && tr.status >= 400 && tr.error) items.push([t("It said: {error}", { error: tr.error.length > 600 ? tr.error.slice(0, 600) + "…" : tr.error }), "aside said"]);
});
if (r.done && !r.tries.length) items.push([t("Nothing was tried: {error}", { error: r.error || r.status }), "bad"]);
steps.replaceChildren(...items.map(([s, c]) => el("li", c, s)));
}