Repository navigation
fix(sessions): repick unavailable models with explicit session scope - #4979
Conversation
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Exercise the real replacement option and default single-session scope without sending or persisting a selection before confirmation. Preserve the draft and inspect isolated engine sessions and transcripts. Runtime proof is incomplete at 2efe900: the bulk preview shows zero matches instead of target and peer because the workspace uses /tmp while engine directories use /private/tmp. Keep the failing assertion and directory evidence; do not canonicalize the fixture to bypass the defect. Post-confirmation local override persistence remains unverified. Exact local E2E: OPENWORK_EVAL_ELECTRON_RESOURCES_PREPARED=1 pnpm evals:e2e session-model-repick --local --engine v1 --surface electron (mise PATH). Result: 0 passed, 1 failed, 0 skipped. Full static checks also report out-of-scope diagnostics: 1 eval type error, 52 layer violations, 4 browser diagnostics. Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Wait for the auto-opened repick dialog rather than racing its appearance with an obsolete model-name button lookup. Capture both real scope options through testkit after clean reloads, with unchanged-state assertions before confirmation. Local Electron v1 with Bun 1.4.0, Node 24.20.0 and pnpm 11.4.0: 1 passed, 0 failed, 0 skipped. Runtime proof covers scope preview, local next-send overrides across reload, unchanged engine sessions/transcripts/defaults, and excluded sentinels. Screenshots are supplemental and visually inspected; automated vision was unavailable without an Infisical login. Full static checks still report out-of-scope diagnostics: 1 eval type error, 52 layer violations, and 4 browser-check diagnostics. No production or lockfile edits. Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Signed-off-by: Guillaume Loret <[email protected]>
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Signed-off-by: Guillaume Loret <[email protected]>
Final-head local verificationHead: Passed: 40/40 testkit tests; 82/82 recorded assertions. Zero skipped tests. Commands (all exit 0 on this head): pnpm --filter @openwork/types build
pnpm typecheck
pnpm evals:typecheck
pnpm --filter openwork-server typecheck
pnpm exec node scripts/i18n-audit.mjs --ci
pnpm --dir apps/app exec bun test --isolate tests/composer-model-controls.test.ts tests/session-model-catalog.test.tsx tests/model-picker-modal.test.ts tests/control-focus-bound-composer.test.tsx
pnpm --dir apps/server exec bun test --isolate src/opencode-plugins/openwork-extensions-preview.test.ts src/opencode-plugins/openwork-provider-adapters.test.ts src/cloud-provider-sync.e2e.test.ts
pnpm evals:pr specs/session-model-repick.test.ts
pnpm evals:pr specs/session-model-removal-sync.test.ts
pnpm evals:pr specs/session-model-aliases.test.ts
pnpm evals:pr specs/session-archive-deadline.test.ts
pnpm evals:pr specs/session-archive-transport.test.ts
pnpm evals:pr specs/session-archive-mailbox.test.ts
pnpm evals:pr specs/agent-ui-context-via-server.test.ts
pnpm evals:e2e session-model-repick --local --engine v1 --surface electron
pnpm evals:e2e session-archive-pinned --localApp units: 56 passed; server units/integration: 144 passed. mise pnpm 11.4.0 / Bun 1.4.0 / Node 24.20.0. Local lane expressly allowed for this mission. Pinned-archive uses the existing legacy world contract, executed locally (not skipped). Private review upload failed because the available Blob token targets a public store. No private report was uploaded publicly. This is the documented assertion-section comment fallback; original receipts remain in the isolated worktree. Reviewed synthetic screenshots are hosted via upload-photo and embedded in the PR body. Reference screenshots carry no visual pass/fail claim. Review repairs and controls
Original final-head records and assertionsRetained checkout: pinned idle sessions archive from the sidebar and mailbox without a focused session; held preflight fails promptly without a late PATCH and recoversOutcome: passed. Created: 2026-09-16T23:24:09.518Z.
unavailable composer repick defaults to this session, previews all, and saves only confirmed local scope without sendingOutcome: passed. Created: 2026-09-16T23:23:10.360Z.
the in-app agent reads renderer context through openwork-server and gets an explicit result without a windowOutcome: passed. Created: 2026-09-16T23:23:03.004Z.
mailbox registration expires after a poll gap, independently of pin or engine work; a fresh poll restores itOutcome: passed. Created: 2026-09-16T23:23:01.729Z.
finite archive and permission IPC preserve scoped requests, cancellation, no retries and external trust boundariesOutcome: passed. Created: 2026-09-16T23:22:40.273Z.
50 pass archive deadlines settle stalled reads and uncertain writes, preserve caller cancellation, and retain pin and working-session contractsOutcome: passed. Created: 2026-09-16T23:22:12.966Z.
tests/session-management-store.test.ts: 126 pass session model aliases preserve workspace scope, canonical bindings, and safe read projectionsOutcome: passed. Created: 2026-09-16T23:22:11.442Z.
removal delta ignores additions, names and unrelated identitiesOutcome: passed. Created: 2026-09-16T23:22:09.974Z.
provider/model removal impact is local, informational and retryable: pathOutcome: passed. Created: 2026-09-16T23:22:09.951Z.
provider/model removal impact is local, informational and retryable: canonical_aliasOutcome: passed. Created: 2026-09-16T23:22:09.930Z.
provider/model removal impact is local, informational and retryable: restartOutcome: passed. Created: 2026-09-16T23:22:09.909Z.
provider/model removal impact is local, informational and retryable: inventoryOutcome: passed. Created: 2026-09-16T23:22:09.883Z.
provider/model removal impact is local, informational and retryable: after_configOutcome: passed. Created: 2026-09-16T23:22:09.857Z.
provider/model removal impact is local, informational and retryable: noneOutcome: passed. Created: 2026-09-16T23:22:09.812Z.
suggested replacements prefer the same provider family then available workspace default, never silently picking another modelOutcome: passed. Created: 2026-09-16T23:22:08.348Z.
same-id effort changes and bulk selections publish model/variant atomicallyOutcome: passed. Created: 2026-09-16T23:22:08.329Z.
canonical workspace aliases allow single and bulk repick but never admit neighboring directoriesOutcome: passed. Created: 2026-09-16T23:22:08.311Z.
effective picker selection and slash commands honor engine binding, local repick and effortOutcome: passed. Created: 2026-09-16T23:22:08.291Z.
queue catalog checks use renderer identity, not a remote runtime's colliding workspace idOutcome: passed. Created: 2026-09-16T23:22:08.274Z.
confirmed pending choices survive ordinary selections beyond the old 200-entry capOutcome: passed. Created: 2026-09-16T23:22:08.248Z.
status waits recheck local holds and selections before single and bulk persistenceOutcome: passed. Created: 2026-09-16T23:22:08.231Z.
authoritative idle and omitted-idle maps permit local-only single and bulk repicksOutcome: passed. Created: 2026-09-16T23:22:08.212Z.
unreadable and malformed authoritative statuses cannot authorize any local model saveOutcome: passed. Created: 2026-09-16T23:22:08.192Z.
authoritative busy and retry states reject repicks even when local activity is emptyOutcome: passed. Created: 2026-09-16T23:22:08.174Z.
activity starting during the final read prevents single and atomic bulk repicksOutcome: passed. Created: 2026-09-16T23:22:08.157Z.
repick uses one absolute budget and checks elapsed time even before timers runOutcome: passed. Created: 2026-09-16T23:22:08.141Z.
direct repick handlers retain their four-second bound and abandoned reads never save laterOutcome: passed. Created: 2026-09-16T23:22:08.122Z.
queued repicks keep a monotonic remaining budget across wall-clock rollbackOutcome: passed. Created: 2026-09-16T23:22:08.104Z.
near-expiry queued repicks time out on the remaining budget and late reads cannot saveOutcome: passed. Created: 2026-09-16T23:22:08.086Z.
invalid and future internal timestamps fail closed for single and bulk repicksOutcome: passed. Created: 2026-09-16T23:22:08.069Z.
exhausted queued repicks reject before reads even when args claim a fresh timestampOutcome: passed. Created: 2026-09-16T23:22:08.051Z.
catalog waits cannot race an archive, hold or newer local selection into a repickOutcome: passed. Created: 2026-09-16T23:22:08.033Z.
exact workspace repick bypasses unrelated offline inventories and rejects foreign targetsOutcome: passed. Created: 2026-09-16T23:22:08.014Z.
healthy fresh sessions preserve model-free sending, never substituting defaults for stale bindingsOutcome: passed. Created: 2026-09-16T23:22:07.984Z.
bulk matching uses exact provider and model ids, not labelsOutcome: passed. Created: 2026-09-16T23:22:07.965Z.
bulk repick rejects a source restored to the current catalog after previewOutcome: passed. Created: 2026-09-16T23:22:07.945Z.
bulk mutations fail closed without confirmation while dry-runs remain read-onlyOutcome: passed. Created: 2026-09-16T23:22:07.923Z.
invalid targets, changed previews and unavailable replacements cannot partially saveOutcome: passed. Created: 2026-09-16T23:22:07.903Z.
headless stale sends write zero prompts; an explicit repick applies canonical ids and variant on next sendOutcome: passed. Created: 2026-09-16T23:22:07.835Z.
repick previews effective bindings, saves only confirmed scope, and preserves engine/default identitiesOutcome: passed. Created: 2026-09-16T23:22:07.797Z.
What this does: explicit this-session or confirmed matching-unarchived-session local repick, UI/headless, with stale-send preflight. |
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Warden review summary — ClearNative findings: 3. 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 (336760 ms), confidentiality-review (407857 ms), spec-provenance-review (636473 ms), desktop-den-sync-review (691867 ms), design-spec-review (1027354 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (f13c71903fe7a4c38d05099c83fefb171245e29b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Human-grade review (agent-assisted)Verdict: Passed for Final-head evidence: 40 testkit tests, 82 recorded assertions. App/server units: 200 passed. Root/app, evals, server typechecks and i18n audit: exit 0. All claimed tests ran locally with zero failures/skips. The PR body has four final-head isolated Electron screenshots covering unavailable state, both scope choices and the confirmed result after reload.
Defects found and repaired during this review
Warden follow-up incorporatedWarden correctly identified that the earlier composer journey previewed two matches but did not actually save two in one bulk action. The final journey now independently proves single-session persistence, resets the synthetic local fixture, clicks All 2 → Save for 2 sessions, and asserts both overrides change while sentinels, engine records, defaults and the draft remain unchanged. The separate reviewer checked this follow-up and found no must-fix. The close action is now explicitly Close; pre-confirmation detail is a compact state/reversibility label rather than explanatory paragraphs. The final-head run passes. Revert-fails controlBefore committing the review repair, the archived exclusion in pnpm --filter @openwork/types build
pnpm evals:pr specs/session-model-repick.test.ts -t "repick previews effective bindings"It exited 1: the scope contained Archive evidence on this exact head
The archive test harness's missing Scope caveats: the broader layer-lint check during review reported 54 violations on both the review tree and clean |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (83a2093e0c2b51526c498c92f49cb3570f8a13f6). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Signed-off-by: Guillaume Loret <[email protected]>
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (c21fc368b2f2072f50772993bc658bdd51c63c47). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Re-pick an unavailable model for this session or a confirmed set of all matching idle, unarchived sessions in the workspace, from the composer UI or headlessly through
session.set_model/session.rebind_model. Choices persist locally for the next send; stale headless sends fail before writing a prompt. Bulk changes require the exact confirmed preview IDs, and single-session repair remains usable when bulk inventory is unavailable.This does not automatically re-bind sessions in
cloud-provider-sync, change global defaults, send prompts, or immediately rewrite engine bindings. It does not restore an unavailable original binding or lock the engine against another actor. The migration root cause remains open: durable old-to-new model identity/provenance mapping and automatic migration remain separate follow-up work.Context
Originally stacked on #4955; now based on
devafter its squash merge. The merge preserves #5014/#5063 archive verification and transport behavior plus the regenerated SDK. Headless means no navigation or focus change; model selection still requires the existing renderer host.Review-driven repairs bound model mutations using the mailbox request age, require authoritative engine-idle verification and final local checks, enforce same-unavailable-model bulk scope, and remove misleading undo claims. Existing server-wide collaborator/owner authority is preserved; this does not introduce per-session creator ownership. English count-aware strings use the existing locale fallback policy.
The integration also preserves legacy empty sync result/ownership shapes, retains nonempty removal work for retry, and exports built affordance JavaScript to packaged Node runtimes. Archive regression fixtures now provide their unrelated model-catalog context; archive production behavior is unchanged. Design: P1/P2 compact state and title-only dialog, P5 shared controls, C7 structured model/provider options, P10 screenshots. Explicit bulk confirmation follows the requested scope-safety contract.
Screenshots
All four images are from the isolated testkit Electron v1 run at
c21fc368b2f2072f50772993bc658bdd51c63c47, using synthetic sessions, normal UI controls and fresh reloads. No capture of the operator's running app. These reference images explain assertion-backed behavior; they do not decide pass/fail.Session composer — before replacement: unavailable model, preserved draft, disabled send.

Re-pick dialog — default “This session only” scope, with the matching-session alternative visible.

Re-pick dialog — explicit all-affected scope previews the two matching unarchived sessions before saving.

Session composer — after this-session confirmation and reload: replacement selected, draft preserved, no prompt sent.

Verification — local
Final head:
c21fc368b2f2072f50772993bc658bdd51c63c47. Inspect all 40 testkit records and 82 passed assertions.pnpm exec node scripts/i18n-audit.mjs --ci: exit 0.session-model-repick.test.ts: 26 passed; removal-sync: 7; aliases: 1.All final-head commands and assertion details are in the evidence comment. Zero failures/skips in these runs. Toolchain: mise pnpm 11.4.0, Bun 1.4.0, Node 24.20.0. Local lane explicitly allowed. Assertion evidence uses the documented PR-comment fallback: private review upload was unavailable because the available token targets a public Blob store. Only the reviewed synthetic screenshots above were uploaded publicly via upload-photo.