Vision T2 escalation always dies — orchestrator passes t2Available=true while MissingT2Provider is the only T2 wired #1

Closed
opened 2026-05-12 18:57:38 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 18:57:38 +00:00 (Migrated from github.com)

Summary

AgentOrchestrator.runTurn line 321 sets t2AvailableForThisTurn = (decision.tier != .t3Cloud) — i.e. true on every local vision turn. But MissingT2Provider is the only T2 wired in production. When T1 returns low-confidence and the orchestrator escalates to T2, it hits MissingT2Provider, which throws t2ProviderUnavailable, and the turn dies silently.

"Wired but dead" shape

Same pattern as the 2026-05-12 facts.source_turn_id FK bug (commit a5999e2): code paths LOOK right in isolation; the production wiring contradicts the assumption.

  • Router tests pass t2Available: false explicitly → they pass.
  • Production passes true → real turns die.
  • The integration boundary is where the test surface stops and reality starts.

Evidence

  • packages/AgentOrchestrator/Sources/AgentOrchestrator/AgentOrchestrator.swift:321
  • AgentCore has zero image+escalation tests against production wiring — that's the structural gap that lets this bug exist.

Recommended fix

Option A (cheap, correct): change line 321 to read the actual provider availability — t2AvailableForThisTurn = (decision.tier != .t3Cloud && hasRealT2Provider). Plumb a flag through installVision that reflects whether the real T2 sidecar is wired or only MissingT2Provider.

Option B (more invasive): make evaluatePostResponse aware of the T2 provider identity, not just a boolean.

Test

Add an integration test in AgentCoreTests that exercises image input + low-confidence T1 + MissingT2Provider end-to-end and asserts the turn does NOT die.

Source

Audit .planning/audit-2026-05-12/vision-audit.md (2026-05-12)

Carry-forward

None — this is a NEW finding, not previously tracked.

## Summary `AgentOrchestrator.runTurn` line 321 sets `t2AvailableForThisTurn = (decision.tier != .t3Cloud)` — i.e. `true` on every local vision turn. But `MissingT2Provider` is the only T2 wired in production. When T1 returns low-confidence and the orchestrator escalates to T2, it hits `MissingT2Provider`, which throws `t2ProviderUnavailable`, and the turn dies silently. ## "Wired but dead" shape Same pattern as the 2026-05-12 `facts.source_turn_id` FK bug (commit `a5999e2`): code paths LOOK right in isolation; the production wiring contradicts the assumption. - Router tests pass `t2Available: false` explicitly → they pass. - Production passes `true` → real turns die. - The integration boundary is where the test surface stops and reality starts. ## Evidence - `packages/AgentOrchestrator/Sources/AgentOrchestrator/AgentOrchestrator.swift:321` - AgentCore has **zero image+escalation tests against production wiring** — that's the structural gap that lets this bug exist. ## Recommended fix Option A (cheap, correct): change line 321 to read the actual provider availability — `t2AvailableForThisTurn = (decision.tier != .t3Cloud && hasRealT2Provider)`. Plumb a flag through `installVision` that reflects whether the real T2 sidecar is wired or only `MissingT2Provider`. Option B (more invasive): make `evaluatePostResponse` aware of the T2 provider identity, not just a boolean. ## Test Add an integration test in AgentCoreTests that exercises image input + low-confidence T1 + MissingT2Provider end-to-end and asserts the turn does NOT die. ## Source Audit `.planning/audit-2026-05-12/vision-audit.md` (2026-05-12) ## Carry-forward None — this is a NEW finding, not previously tracked.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#1