Skip to content

queue: per-task session binding history + model timeline (#9046) - #9050

Merged
developing-today[bot] merged 1 commit into
mainfrom
feat/8176-model-timeline
Nov 12, 2026
Merged

developing-today[bot] merged 1 commit into
mainfrom
feat/8176-model-timeline

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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_attempt join on session_id + window (task 14440: stamp said opencode-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_id additive column (SCHEMA + ensure_schema + TASK_COLS) — the row's claim_* set is now the complete latest stamp.
  • stamp_claim_model also appends a model_stamp event (session_id, provider, model, variant, trigger).
  • Pick and by-id claims that name a session now bind it in progress.session_id (by-id learns the session parameter) and write session_bound; transfer already bound, now also records. on_binding_cleared writes session_unbound beside the legacy kind; verb_complete/verb_cancel close the window (record-only — the binding stays on the row as the execution record).
  • /bind accepts the session's model and stamps it (trigger bind) — the claimant's collect → launch → bind flow now produces stamp + binding where the session becomes known.
  • New /events-list read verb; rich list gains claimed_at.

Client — client.rs (live via the ~/.local/bin/fleet swap, the #9025 pattern):

  • Claim/bind/release/park/fail/cancel/complete mirror the same records through the existing /events-append verb against the pre-switch broker. Claim appends are keyed on the claim_session_id capability 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).
  • bind gains --model-* flags; without them the stamp derives from the session record, as on claim.
  • complete computes the close-out dominant_model (route_attempt call count over [claimed_at, now] for the bound session) into the result JSON — fail-soft, caller's explicit value wins.
  • New repo-queue timeline <task-id>: renders binding windows + stamps in order and joins the exact route_attempt model 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.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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
developing-today Bot requested review from a team and dezren39 as code owners November 12, 2026 22:02
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0592f64b-6eec-41ae-b7b8-09037d4e2cc9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

0 participants