Skip to content

fix(sessions): discover model names and resolve aliases safely - #4955

Merged
yomgui merged 3 commits into
devfrom
fix/model-alias-visibility
Sep 16, 2026
Merged

yomgui merged 3 commits into
devfrom
fix/model-alias-visibility

Conversation

@yomgui

@yomgui yomgui commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Summary

What this PR does: makes model bindings visible and safe to create. Session lists show model and provider names instead of ids; a policy-filtered models.list affordance lists the models a person or agent may use; session.create accepts a model alias/display name and checks the model exists before creating the session; session.read exposes lastError, so a session stuck on a dead model is detectable instead of failing silently. Production change: 229 lines.

What this PR does not do: it does not repair sessions already bound to a retired provider, and it does not change cloud-provider-sync. The incident root cause — the desktop sync removes a retired provider without re-binding the sessions that used it — is documented in the included RCA and remains open. Manual repair (re-pick this/all sessions) is #4979, stacked on this PR. The automatic fix (re-bind or refuse to drop a provider still used by live sessions) is not implemented anywhere yet.

Context: the 2026-09-11 Den provider migration (lpr_ → ipr_/gwm_) left sessions with dead model ids and no way to see which model a session used. Report: reports/rca-model-migration-dead-ids-2026-09-12.md.

Verification

Passed locally on the final head: pnpm evals:pr specs/session-model-aliases.test.ts (1 test, 33 assertion sections, zero skips); focused server units (123/123), renderer units (9/9), app/server typechecks. Removing alias resolution or error projection independently makes the spec fail. Head-matching test evidence is published in the PR comment.

Broader archive-contract, spec-layer typecheck, and layer-lint failures reproduce identically on clean base 0bd71eb; commands/signatures are in the RCA. Daytona credentials were unavailable.

Boundaries

No OPE-48 re-pick UI or session migration. Pre-assistant/event-only run errors remain a durable-receipt follow-up; lastError is snapshot/window scoped. #4950 owns honest acceptance receipts (overlapping create function); #4937 owns tool-parts/activity. Neither duplicated. Exact incident migration time is unverified; the notification timestamp is a coalesced entry creation time.

Report: reports/rca-model-migration-dead-ids-2026-09-12.md.

@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 14, 2026 2:31pm UTC
openwork-den Ready Ready Preview Sep 14, 2026 2:31pm UTC
openwork-diagnostics Ready Ready Preview Sep 14, 2026 2:31pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
openwork-landing Skipped Skipped Sep 14, 2026 2:31pm UTC

@github-actions

github-actions Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (405921 ms), confidentiality-review (346313 ms), spec-provenance-review (438817 ms), desktop-den-sync-review (374980 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 13, 2026

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (38667ed96bace4663412815590dfc5091140bae5). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui

yomgui commented Sep 14, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit ea624cff042e6dea7430e9fef7ed0cc2f6ae6d11 · selected evidence

Open review report

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (ea624cff042e6dea7430e9fef7ed0cc2f6ae6d11). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui
yomgui merged commit c502b87 into dev Sep 16, 2026
42 of 44 checks passed
@yomgui
yomgui deleted the fix/model-alias-visibility branch September 16, 2026 20:44
@yomgui
yomgui restored the fix/model-alias-visibility branch September 16, 2026 20:45
@yomgui
yomgui deleted the fix/model-alias-visibility branch September 16, 2026 20:47
@yomgui

yomgui commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

Screenshots (added after merge)

No authentic before/after screenshot pair for the requested sidebar/session-name or error-control change is available: this PR changes agent-facing control results, not those visual surfaces. The summary phrase “Session lists show model and provider names instead of ids” refers to the session.list_sessions tool result. More precisely, names are added alongside canonical IDs when the catalog can resolve them; IDs are not replaced.

Compared exact adjacent commits:

  • Before: 61d57ac190e5ba588a2a10bdd420f476b0fae3c8
  • After (merge): c502b878980ec565fdccbbeb8be6bbf1fcb6e4f7

What actually changed

  • session.list_sessions decorates returned model metadata with optional displayName and providerName. Its production caller is the registered control query, not a sidebar row renderer: inventory projection, query registration.
  • models.list exposes a workspace-scoped, policy/sign-in-filtered connected catalog; session.create resolves explicit aliases/display names to canonical IDs before writes and fails closed when selection cannot be resolved. This is an agent selection contract, not a new model-picker screen.
  • The visible model picker already used model.name || id and provider.name before this merge: before picker. Photographing that existing control would not demonstrate an ID-only → names UI change from this PR.
  • session.read.lastError is a sanitized tool-result field, computed from the latest assistant snapshot in the loaded transcript window. No new visible error banner/control consumes this field in the diff. A later error-free assistant clears it; null is not proof of successful inference, and event-only/pre-assistant failures remain outside its coverage: error projection and read metadata.

Verification and limits

  • git rev-parse HEAD^ in the after worktree matched the exact before SHA above.
  • git diff --name-status <before> <after> identified 10 changed files. No sidebar, composer, picker, session-route, or transcript-rendering component changed.
  • git diff --exit-code <before> <after> -- apps/app/src/react-app/domains/session/sidebar apps/app/src/react-app/domains/session/surface apps/app/src/react-app/domains/session/sync apps/app/src/react-app/shell/session-route.tsx exited 0, with no differences.
  • git diff --check <before> <after> exited 0.
  • Inspected the existing testkit spec: its 33 cases exercise synthetic HTTP witnesses and control projections, not an Electron screen. The renderer unit fixture registers actions and returns null; it does not render the claimed list. Existing PR test evidence remains separate; no tests, typechecks, or lint were rerun in this screenshot-only audit, and this comment claims no new runtime pass.

Images: none captured or uploaded. DOM/pixel/vision screenshot checks were not applicable because no matching new visual state was identified. Raw tool output displayed in chat would demonstrate the data contract, not a newly changed sidebar or error control; no mock UI, edited pixels, or unrelated screenshots are substituted.

Cleanup: both task-owned detached worktrees were clean and removed. No Electron instance was launched, no running user app was accessed, no temporary harness was created, no secrets were fetched, and no source changes or commits were made. Existing retired-provider bindings and durable event-only error capture are not repaired by this PR.

This branch was successfully deployed

3 active and 1 inactive deployments
Preview – openwork-app — ea624cff Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-den — ea624cff Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-diagnostics — ea624cff Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-landing — ea624cff Deployed Sep 14, 2026 by vercel[bot]
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.

1 participant