hermes: clarify provider history and archive probes

This commit is contained in:
jenkins 2026-08-13 01:28:43 -03:00
parent 42d4b34557
commit 3a3da95dca
3 changed files with 27 additions and 17 deletions

View File

@ -67,7 +67,7 @@
) : null,
h("div", { className: "provider-status-stats" },
h(Stat, { label: "Completed", value: number(item.calls) }),
h(Stat, { label: "Errors", value: number(item.errors) }),
h(Stat, { label: "Historical errors", value: number(item.errors) }),
h(Stat, { label: "Tokens", value: number(item.total_tokens) }),
h(Stat, { label: "Avg latency", value: item.avg_latency_ms ? number(item.avg_latency_ms) + " ms" : "—" })
),
@ -84,11 +84,11 @@
})
) : null,
item.models && item.models.length ? h("div", { className: "provider-status-models" },
h("strong", null, "Observed routes"),
h("strong", null, "Observed routes (history)"),
item.models.map(function (model) {
return h("div", { className: "provider-status-model", key: model.id },
h("code", null, model.id),
h("span", null, number(model.calls) + " completed · " + number(model.errors) + " errors · " + number(model.total_tokens) + " tokens")
h("span", null, number(model.calls) + " completed · " + number(model.errors) + " historical errors · " + number(model.total_tokens) + " tokens")
);
})
) : h("p", { className: "provider-status-empty" }, "No calls observed in this router window.")
@ -142,11 +142,11 @@
),
h("div", { className: "provider-status-stats" },
h(Stat, { label: "Requests", value: number(router.total_requests) }),
h(Stat, { label: "Errors", value: number(router.total_errors) }),
h(Stat, { label: "Historical errors", value: number(router.total_errors) }),
h(Stat, { label: "Tokens", value: number(router.total_tokens) }),
h(Stat, { label: "Fallbacks", value: number(Object.values(router.fallbacks || {}).reduce(function (a, b) { return a + Number(b || 0); }, 0)) }),
h(Stat, { label: "Classifier calls", value: number(router.classifier_calls) }),
h(Stat, { label: "Classifier errors", value: number(router.classifier_errors) })
h(Stat, { label: "Historical classifier errors", value: number(router.classifier_errors) })
)
)
) : null,

View File

@ -24,6 +24,10 @@ LEGACY_CASSANDRA_WORKERS = {
}
LEGACY_ORPHANED_SMOKE_SESSIONS = {
"e17f2d888689": "Archived agent workspace smoke test",
"api-cff2ed44d3b0ab61": "Archived operator Codex packing probe",
"run_efce779230534721b6e0a3115782fae6": "Archived model availability probe",
"run_aab885acce7e4daca65e935cc684ffc6": "Archived Vault path probe",
"run_e689e61419a842219c5fdcc789e27c2f": "Archived secret isolation probe",
}
TRIAGE_PARENT = "automated-triage"
TRIAGE_PARENT_TITLE = "Automated triage"

View File

@ -1025,14 +1025,13 @@ def test_legacy_api_sessions_are_nested_idempotently(tmp_path: Path):
"VALUES (?, 'api_server', NULL, 'old', 'keep-me')",
(worker_id,),
)
orphan_id = next(iter(module.LEGACY_ORPHANED_SMOKE_SESSIONS))
connection.execute(
connection.executemany(
"INSERT INTO sessions (id, source, parent_session_id, title, transcript) "
"VALUES (?, 'api_server', NULL, 'old smoke', 'keep-smoke')",
(orphan_id,),
((orphan_id,) for orphan_id in module.LEGACY_ORPHANED_SMOKE_SESSIONS),
)
assert module.migrate(database) == 2
assert module.migrate(database) == 1 + len(module.LEGACY_ORPHANED_SMOKE_SESSIONS)
assert module.migrate(database) == 0
with sqlite3.connect(database) as connection:
row = connection.execute(
@ -1045,14 +1044,21 @@ def test_legacy_api_sessions_are_nested_idempotently(tmp_path: Path):
"keep-me",
)
with sqlite3.connect(database) as connection:
orphan = connection.execute(
"SELECT archived, title, transcript FROM sessions WHERE id = ?",
(orphan_id,),
).fetchone()
assert orphan == (
1,
module.LEGACY_ORPHANED_SMOKE_SESSIONS[orphan_id],
"keep-smoke",
orphans = connection.execute(
"SELECT id, archived, title, transcript FROM sessions "
"WHERE id IN ({}) ORDER BY id".format(
",".join("?" for _ in module.LEGACY_ORPHANED_SMOKE_SESSIONS)
),
tuple(module.LEGACY_ORPHANED_SMOKE_SESSIONS),
).fetchall()
assert orphans == sorted(
(
orphan_id,
1,
module.LEGACY_ORPHANED_SMOKE_SESSIONS[orphan_id],
"keep-smoke",
)
for orphan_id in module.LEGACY_ORPHANED_SMOKE_SESSIONS
)