GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(session): surface route_usage.lastServing on the session record (#2696) by dezren39 · Pull Request #2754 · developing-today-forks/opencode

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026

Copy link
Copy Markdown

Implements the prepared slice recorded on #2696 (Lane NC's premise verification + plan, adopted by Lane ZB under Drew's 2026-11-23 batch approval of the former flag holds).

What changes

  • packages/schema/src/session.ts: Session.RouteUsage struct mirroring ModelUsage.LastServing, plus an optional route_usage field on Session.Info — the literal snake_case key the fleet-queue claim path reads — following the costAuthoritative optional-field pattern.
  • packages/core/src/session/info.ts: fromRow gains an optional serving parameter mirroring authoritative; route_usage is set only when a last-serving leaf exists.
  • packages/core/src/session/store.ts: get also fetches ModelRouteLog.sessionAttempts(db, row.id, 50) and derives ModelUsage.lastServing(rows) at read time, so the record names the leaf serving at read time and updates as the serving leaf changes.

Contract (from the consumer, developing-today/code session_model_stamp): a present-but-unparseable readout stamps nothing, so the field is absent — never null/partial — until the session has a real serving leaf. Scope is the single-session GET, the exact surface the claim path reads; list-page attachment is a named follow-on, not this slice.

Test: packages/core/test/session-route-usage.test.ts — a session whose last turn failed over from one leaf to another carries route_usage.lastServing naming the serving leaf + variant (and the attempted leaf / failover fields); a session with no attempts carries no route_usage key in the schema-encoded record.

Verification (laptop route; GitHub Actions is disabled on this fork):

  • New suite: 2 pass / 0 fail.
  • model-usage + route-usage-tool + model-route-log: 81 pass / 0 fail.
  • session-compaction + session-context-vars + session-execution + new suite: 98 pass / 0 fail.
  • packages/schema typecheck: clean (141 files). packages/core typecheck: clean (2,284 files).

Not in this PR: packages/protocol/openapi.json regeneration. The checked-in spec is already stale on main (regenerating produces a ~1,600-line diff, almost all pre-existing drift — e.g. the /api/route/attempts endpoints from #2497 are missing from it); only 3 of those lines are this change. The resync belongs in its own pass.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T14:37:21Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
repo-worker-openchamber
feat(session): surface route_usage.lastServing on the session record (#…
3fa3ac9
…2696)

The route_usage tool (#1891) already computes the serving leaf from the
route_attempt ledger, but the readout was only reachable through the tool.
Session records carried no route_usage field, so record consumers — the
fleet-queue claim path, whose stamp derivation prefers
route_usage.lastServing when present — could not name the serving leaf and
deliberately stamped nothing for routed sessions.

- schema: Session.RouteUsage struct mirroring ModelUsage.LastServing, and
  an optional route_usage field on Session.Info (the literal snake_case key
  the claim path reads), following the costAuthoritative pattern. The field
  is absent — never null or partial — until the session has a recorded
  attempt, because a present-but-unparseable readout stamps nothing.
- core: SessionStore.get also fetches the session's recent attempts and
  derives ModelUsage.lastServing at read time, so the readout names the
  leaf serving at read time and updates as the serving leaf changes.
  fromRow gains an optional serving parameter mirroring authoritative.
  Scope is the single-session GET, the exact surface the claim path reads;
  list-page attachment is a named follow-on.
- test: a session whose last turn failed over carries
  route_usage.lastServing naming the serving leaf and variant; a session
  with no attempts carries no route_usage key in the encoded record.

Verification (laptop; Actions is disabled on this fork): new suite 2/2;
model-usage + route-usage-tool + model-route-log 81/81; session-compaction
+ session-context-vars + session-execution 98/98 with the new suite;
schema and core typechecks clean.
@dezren39
dezren39 merged commit 3ad091f into main Nov 23, 2026
@dezren39
dezren39 deleted the lane-zb-2696 branch November 23, 2026 14:37
This was referenced Nov 23, 2026
session record carries no route_usage: claim stamps cannot name the serving leaf (server-side remainder of #1891) #2696
Closed
Meta-reviewer: grade the reviewers, score model/effort choices, and evolve the reviewer guidelines developing-today/code#1340
Open
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.