Skip to content

Auth-session broker: nothing verifies Core→broker reachability; mint failures surface as "target login failed" #129

Description

@guohai

Observed

A session-injected job fails on the agent with:

[Daemon] Job execution error: target login failed: fetch failed
[Daemon] Failing job 31071: target login failed: fetch failed

What actually happened (not what the message says)

Tracing the chain:

  1. ensureSession (server/auth-session.ts:152) called routeToBroker("auth-session") and got a target — so a broker row was heartbeating within BROKER_OFFLINE_THRESHOLD_SECONDS and Core had its in-memory mint secret (broker-registry.ts:60-70 requires both). Otherwise the error would read no live auth-session broker registered.
  2. mintViaBroker (broker-registry.ts:85) then did fetch(target.url + "/mint") — and that call threw rather than returning a response. fetch failed is undici's transport-level error: DNS failure, connection refused, TLS failure, host unreachable.
  3. markWebSessionFailed stored that text; /api/eval-agent/jobs/:id/session returned it; the daemon prefixed it (vox-agentd.ts:546).

So this is not a credential/token problem. A wrong or expired mint secret would have produced a responsebroker mint failed: 401 via broker-registry.ts:90 — not fetch failed. Core simply could not reach the broker's advertised URL.

Likely causes: the broker container died within the offline threshold (still "live" in the registry), or it is heartbeating fine but its BROKER_ADVERTISE_URL is no longer reachable from Core (hostname/port/container-network change after a redeploy).

The gap

Heartbeats prove the wrong direction. The broker heartbeats to Core, which proves broker→Core works. The mint needs Core→broker. Nothing validates that direction, so a stale or wrong BROKER_ADVERTISE_URL registers as perfectly healthy, shows green on the Brokers page, and only fails at mint time — once per job, with a generic transport error.

Suggested:

  • Probe the advertised URL from Core at registration (reject/flag a broker Core can't reach), and periodically thereafter — surface the result on the broker row and the Brokers page.
  • Distinguish the failure classes in the stored error: unreachable broker vs. broker rejected us (401) vs. the target site actually refused the login. Right now all three read as "target login failed".

Message wording

target login failed: <reason> (vox_eval_agentd/vox-agentd.ts:541,546) reads as "the target website rejected our login" when the real cause was "Core couldn't reach its own broker". Worth splitting the prefix by failure class.

Generated with SMT smt@agora.io

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions