You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3ea12f2
Browse filesBrowse the repository at this point in the historyBrowse files
fix(web): steering-path leftovers from the queue transition (#40 A1-A4)
Partial for #40 — section A items 1 through 4, in the order the issue's own
triage ranked them. A5/A6 and all of section B are deliberately left open.
A4 (the only wrong-outcome bug). `canSteerActiveThread` was keyed on the
composer's `selectedProvider`, which resolves through `deriveLockedProvider`
and then `resolveSelectableProvider` — whose fallback is *the first enabled
provider*. A thread whose provider instance was disabled or removed, or whose
session names a driver kind this build does not recognise, could therefore
read as `claudeAgent` in the composer while the server still routed it to
Codex: the exact case the allowlist exists to prevent. It now keys on the
thread's persisted `session.providerName` via a new pure
`steerProviderBinding`, so an absent or unrecognised binding misses the
allowlist and queues. That is what makes b9d94d9's "fail closed" promise
actually hold. `providerSupportsSteering` takes an open string now, because
the session binding is typed as a plain non-empty string and narrowing it to
the brand first would have to invent a meaning for unrecognised values that
the allowlist already answers.
A1 + A2 (one fix). The drain shipped the enqueue-time `createdAt` on all
three outgoing commands. The snapshot sorts `ORDER BY thread_id, created_at
ASC, message_id`, so a reordered queue delivered rows in the new order and
rebuilt the transcript in the old one — invisible live, permanent from the
first reload. The same stale stamp put `hasQueuedTurnStart` outside its
2-minute `QUEUED_TURN_START_GRACE_MS` window for any message that waited
longer than that (the normal case), so `canSettle` read the thread as
settleable with the anti-double-send gate already expired. Now stamped at
dispatch, which is what upstream's immediate-send path does. The queue's own
`createdAt` is untouched and still orders the queue list.
A3. `logComposerDispatch` fired at the top of `onSend`, above every guard, so
Enter on an empty composer logged `composer dispatch: steer` for a submit
that never happened — and per outboxDiagnostics.ts that line is the only
client-side evidence of whether a message steered or queued. It now fires at
each path's real dispatch point (immediately before the enqueue, and
immediately before `sendInFlightRef.current = true`). The record also gained
a `steerProvider` field beside `provider`, so the picker-vs-binding
divergence that caused A4 is visible in one line rather than inferable.
C2. `SEAMS.md`'s "Parallel paths" table had one row and did not include the
steering path, which is the more dangerous of the two — a second submit path
into a turn that is already running, gated by a hand-asserted allowlist that
no upstream change can conflict with. Registered, with the re-check
instruction. The `ChatView.tsx` row moves +186 -> +210 (deletions stay at 1,
so the additive-seam invariant holds) and the header totals are regenerated
with the ledger's own recipe: 37 files, +1994/-912. That run also surfaced a
pre-existing 13-line drift in the header, noted inline.
Verified: `vp test run apps/web/src/outbox apps/web/src/components/ChatView.logic.test.ts`
79 passed; `vp lint` clean; `tsgo --noEmit -p apps/web` 0 errors.
0 commit comments