Skip to content

feat: saved sessions, plus queue and swap reliability fixes - #29

Merged
rubenperezrial merged 9 commits into
mainfrom
feat/saved-sessions
Oct 5, 2026
Merged

rubenperezrial merged 9 commits into
mainfrom
feat/saved-sessions

Conversation

@rubenperezrial

Copy link
Copy Markdown

Stacked on #28 (which itself is stacked on #27).

Saved sessions (⭐ Sessions)

New reply-keyboard button next to the project swap, with a menu that:

  • bookmarks / unbookmarks the current session (📍 / ✖️);
  • lists every bookmarked session of the project: ▶️ n. title to open it, 🗑 to drop it.

Bookmarks are stored per project in settings.json. Opening one attaches it exactly like /sessions does (adopts the session's agent and model, refreshes the pinned message and the keyboard). A bookmark whose session no longer exists is reported and removed from the list.

Prompt queue fixes

  • The per-message queue menu (stop current / send now / delete) was unreachable while the session was busy: the interaction guard blocked its callbacks. Callbacks of the active queue menu are now allowed through.
  • A dispatch skipped because the session was re-marked busy right after the idle event (late SSE burst) is retried with backoff instead of leaving the queue stranded until /abort.
  • /abort and the project swap now report the queued prompts they discard instead of dropping them silently.
  • The queued-prompt button icon becomes ⏳ (the previous ❌ label is still recognised, so a keyboard rendered before the change keeps working).

Project swap fixes

  • After the switch the bot lands on the target project's most recently updated session, or tells the user there is none / that loading it failed, instead of leaving the chat with no session and no prompt target.
  • Detaching a session now releases its local busy gate and run state, so the project left behind no longer keeps blocking commands.

Verification

bun run check (lint + build + tests): 1912 pass, 0 fail.
New tests: saved-sessions-menu, saved-sessions-callback-handler, project-session-service; updated: keyboard, message patterns, routers, settings store, queue dispatch, swap handler.

Adds a keyboard row above the agent/context grid that switches to the other project in one tap. Target: the project the last switch moved away from (settings.swapProject), falling back to the most recently active other project. The press is allowed while the session is busy: it detaches the running session instead of blocking. i18n for all locales and PRODUCT.md updated.
The project list can return entries without a name (cached session directories), which made the swap confirmation show the full worktree path.
The bottom keyboard now shows a single model button carrying the active thinking-effort variant; the separate variant button is gone. Tapping it opens the model list as before, and picking a model still opens the variant picker after the confirmation. Picking the already-active model now re-opens the variant picker with the current variant marked instead of silently resetting it to default; when the model offers no variant choice, a toast explains it. Also updated tests and PRODUCT.md.
The provider browser callback handler was defined twice with identical bodies; the second definition silently won at runtime. Keep a single copy.
- saved sessions: bottom-keyboard "Sessions" button with a menu to
  bookmark the current session (per project), open a bookmarked one, or
  drop it; bookmarks live in settings.json
- prompt queue: the per-message menu now works while the session is busy,
  a dispatch skipped by a busy re-mark is retried instead of stranding the
  queue, and abort / project switch report the prompts they discard; the
  queued-button icon becomes an hourglass
- project swap: lands on the target project's most recent session and
  releases the detached session's local busy and run state
… project swap

- adopt the session variant when present; otherwise keep the effective variant (same model) or resolve the model's configured default
- resolve the effective variant centrally (getStoredModel/getCurrentVariant share resolveVariant), also for the prompt
- drop the synthetic Default row from the variant picker; a lone real variant is still offered when it is not the active one
- tests: session adoption, resolution regressions (real config), variant menu (mocked and real-catalog chains)
- let the ⭐ button and the saved-menu callbacks through the busy guard
- bookmarking/dropping entries are local; opening another session detaches the active run (same semantics as the project swap)
- tests: busy-guard matrix with real modules and handler integration
- strip trailing commas (string-aware) before JSON.parse; warn once when the config cannot be loaded
- keeps config-based variant defaults (reasoningEffort) working with real-world opencode.jsonc files
- tests: mixed JSONC fixture, invalid-config warn-once, adversarial string/URL cases
@rubenperezrial
rubenperezrial changed the base branch from feat/unified-model-effort to main October 5, 2026 15:25
@rubenperezrial
rubenperezrial merged commit 9a64880 into main Oct 5, 2026
1 check passed
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