Skip to content

docs(gaps): register LV-26 — an upstream 401 reaches the caller as 502 - #140

Merged
beyondnetPeru merged 2 commits into
developfrom
docs/register-lv-26
Aug 4, 2026
Merged

docs(gaps): register LV-26 — an upstream 401 reaches the caller as 502#140
beyondnetPeru merged 2 commits into
developfrom
docs/register-lv-26

Conversation

@beyondnetPeru

@beyondnetPeru beyondnetPeru commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The defect

AgentRuntimeGateway throws AgentRuntimeGatewayException(code, statusCode: <upstream>). AgentRuntimeTurnExecutor catches it and flattens it to a string so the failed turn is still recorded — that intent is right. But the status does not survive the flattening: AssistantEndpoints.Translate re-derives one from the string, matches no case, and falls through:

_ => ("AgentRuntime.Failed", 502),

Two things are lost at once — the upstream status (401) and the specific code, rewritten from AgentRuntime.HttpError to the generic AgentRuntime.Failed.

Why it matters

A credential problem is reported as an availability problem. 502 Bad Gateway sends the operator to check whether the runtime is up. It was up, and answering 401 in 88 ms.

The endpoint's own comment already recognises that collapsing to an HTTP code erases the story and that the trace keeps it — but the caller has no trace, and the caller is who has to act.

Observed

On 2026-08-04 the core-integration robot reported POST /assistant/converse → 502 against a live two-cluster stack. The cause was AGENT_RUNTIME_API_KEY differing between the Tracker's tracker-runtime-auth secret and the runtime's own. Only the tracker-api log carried the 401. Aligning the key turned the step green, so the diagnosis is confirmed and the mis-mapping is what cost the time.

Registered P2/XS, with the fix scoped to the erasure, not the number: 502 is arguably right (the caller's own auth succeeded; the failure is upstream). What is wrong is that the body cannot tell an auth failure from an unreachable runtime.

Context

Found running core-integration against a live stack for the first time — it is excluded from the default RoboSoft runner. The same run found a real Core defect (beyondnetcode/evolith_arch32#425, the MCP chart's runAsUser) and one defect in the robot itself (#139). One of three was the product; two were the instruments.

Pre-existing, untouched, and worth flagging

The board's declared counters are stale by five rows. Before this change the header said 174 done / 17 pending while the table held 179 DONE / 12 PENDING; the same offset holds after. This row follows the existing convention (total and pending both +1) rather than silently re-baselining numbers it has not reconciled row-by-row.

Worth its own pass. Correction to an earlier draft of this description: this repo DOES have a Gap registry coherence check, and it passes on this PR — so the guard exists; what it does not validate is the declared counters in the header. The Core repo's 08-validate-tracking fails on exactly that drift.

🤖 Generated with Claude Code

beyondnetPeru and others added 2 commits August 4, 2026 10:47
… Core

Step 5 reported "no gates" against a Core that had evaluated six of them.
The Core was right; the assertion was wrong.

The canonical `EvaluationResult` nests per-kind results under `results`
(`gate`, `artifact`, `compliance`). It is the TRACKER's own DTO that
flattens them to `gates`, and this robot reaches the Core THROUGH the
gateway, so it receives the canonical shape and never the flattened one.

A second defect sat in the same helper and would have survived the first
fix: `summarizeVerdict` compared each verdict against `'failed'` while the
Core emits `FAIL`. Even given the right array it would have reported zero
failures on a run where all six gates failed — a green-looking summary
over a red result, which is worse than no summary at all.

Verified against a captured REST response rather than argued, and run
against the UNFIXED helper first so the change is known to matter:

    before  gates=0 · failed=0   (and the check said "no gates")
    after   gates=6 · failed=6

Checked for the same shape elsewhere in robosoft/: no other robot reads
`.gates` or compares against a lowercase verdict.

Found while running this robot against a live two-cluster stack for the
first time — it is excluded from the default runner and had never
executed. The same run found a real product defect (the MCP chart's
runAsUser, fixed in evolith#425); this one was the instrument.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`AgentRuntimeGateway` throws with the upstream status. The executor
flattens it to a string so the failed turn is still recorded — that
intent is right — but the status does not survive: `Translate` re-derives
one from the string, matches no case, and falls through to
`_ => ("AgentRuntime.Failed", 502)`. Two things are lost at once: the
upstream 401, and the specific code, rewritten to the generic one.

A CREDENTIAL problem is therefore reported as an AVAILABILITY problem.
502 sends the operator to check whether the runtime is up; it was up, and
answering 401 in 88ms. The endpoint's own comment already recognises that
collapsing to an HTTP code erases the story and that the trace keeps it —
but the caller has no trace, and the caller is who acts.

Observed on 2026-08-04: `core-integration` reported
`POST /assistant/converse → 502` against a live two-cluster stack. The
cause was AGENT_RUNTIME_API_KEY differing between the Tracker's secret and
the runtime's. Only the tracker-api log carried the 401. Aligning the key
turned the step green, so the diagnosis is confirmed and the mis-mapping
is what cost the time.

Registered P2/XS with the fix scoped to the ERASURE, not the number: 502
is arguably right (the caller's own auth succeeded, the failure is
upstream) — what is wrong is that the body cannot tell an auth failure
from an unreachable runtime.

Found running this robot against a live stack for the FIRST time; it is
excluded from the default runner. The same run found a real Core defect
(evolith_arch32#425) and one in the robot itself (#139).

NOTE, pre-existing and untouched: the board's declared counters are stale
by five rows. Before this change the header said 174 done / 17 pending
while the table held 179 DONE / 12 PENDING; the same offset holds after.
This row follows the existing convention (total and pending both +1)
rather than silently re-baselining numbers it has not reconciled
row-by-row. Worth its own pass — the Core repo has a guard for exactly
this and this board has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@beyondnetPeru
beyondnetPeru merged commit 53590a0 into develop Aug 4, 2026
6 checks passed
@beyondnetPeru
beyondnetPeru deleted the docs/register-lv-26 branch August 4, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant