Repository navigation
queue: per-task session binding history + model timeline (#9046) - #9050
Merged
Merged
Conversation
Extends the #8176 claim stamp into a timeline, per Drew 2026-11-12: the session link is the product — exact models resolve from the raw route_attempt data joined on session_id + the task's bound window, not from stamp guesswork. Broker (activates at the coordinated switch; no broker restart taken): tasks.claim_session_id (additive column) completes the latest-stamp columns; stamp_claim_model also appends a model_stamp event; pick and by-id claims that name a session now bind it in progress (previously only transfer + /bind did) and write session_bound; on_binding_cleared writes session_unbound beside the legacy kind; /bind accepts the session model and stamps it; verb_complete/verb_cancel close the binding window; new /events-list read verb; rich list gains claimed_at. Client (live on the CLI swap): claim/bind/release/park/fail/cancel/complete mirror binding + stamp records through /events-append on a pre-switch broker (claim appends keyed on the claim_session_id capability signal); bind derives the stamp from the session record like claim does; complete computes the dominant model from route_attempt over the claim window into the result (fail-soft); new repo-queue timeline command renders windows + stamps and joins route_attempt segments per window, collapsing duplicate two-surface writes.
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 12, 2026 22:02
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #9046 (Drew, 2026-11-12), extending the #8176 claim stamp into a per-task timeline. Design record is on #9046; the load-bearing finding: the task↔session binding existed only on the /bind + transfer paths (599/6,087 ledger rows; 11 of 43,621 claimed events named a session), and exact models resolve from the
route_attemptjoin on session_id + window (task 14440: stamp saidopencode-route/workhorse; its session actually served_openai/gpt-6.1-terra#low×27).Broker —
turso_queue.rs(activates at the coordinated switch; NO broker restart taken, per the standing #8548+#8561 boundary):tasks.claim_session_idadditive column (SCHEMA + ensure_schema + TASK_COLS) — the row's claim_* set is now the complete latest stamp.stamp_claim_modelalso appends amodel_stampevent (session_id, provider, model, variant, trigger).progress.session_id(by-id learns the session parameter) and writesession_bound; transfer already bound, now also records.on_binding_clearedwritessession_unboundbeside the legacy kind; verb_complete/verb_cancel close the window (record-only — the binding stays on the row as the execution record)./bindaccepts the session's model and stamps it (triggerbind) — the claimant's collect → launch → bind flow now produces stamp + binding where the session becomes known./events-listread verb; rich list gainsclaimed_at.Client —
client.rs(live via the ~/.local/bin/fleet swap, the #9025 pattern):/events-appendverb against the pre-switch broker. Claim appends are keyed on theclaim_session_idcapability signal (post-switch broker rows carry the key → CLI stays silent, no doubles). The timeline reader collapses any remaining two-surface duplicates (same kind/session/leaf/trigger within 120 s).bindgains--model-*flags; without them the stamp derives from the session record, as on claim.completecomputes the close-outdominant_model(route_attempt call count over [claimed_at, now] for the bound session) into the result JSON — fail-soft, caller's explicit value wins.repo-queue timeline <task-id>: renders binding windows + stamps in order and joins the exactroute_attemptmodel segments per window. On a pre-switch broker it prints the interim SQL instead (exit 3).Tests: fleet-queue lib, all features: 301 passed, 0 failed — including new oracles
model_stamp_detail_9046…,timeline_wiring_9046,collapse_timeline_9046…,binding_windows_9046…,valid_session_id_9046….Refs #9046, #8176.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.