Skip to content

feat: send the recap and repost the last assistant message when opening a session - #30

Merged
rubenperezrial merged 10 commits into
mainfrom
feat/session-select-last-response
Oct 5, 2026
Merged

rubenperezrial merged 10 commits into
mainfrom
feat/session-select-last-response

Conversation

@rubenperezrial

Copy link
Copy Markdown

What

Opening a session now sends, after the confirmation message: (1) the existing recent-messages recap and (2) the full rendered last assistant response, so it never has to be requested again.

Covered paths: /sessions menu, saved-sessions menu (⭐ Sessions), and the quick project swap when it lands on the target project's most recent session.

How

  • New src/bot/services/session-recap-service.ts: shared pipeline (sendSessionRecapAndLatestResponse, sendLatestAssistantResponse) extracted from session-callback-handler.ts with no behavior change.
  • Background-notification flow keeps its behavior (full last message only, no recap).
  • attachSessionById / attachLatestProjectSession now return SessionInfo | null (both consumers adapted) so the swap knows which session it attached to.

Verification

  • bun run check green (lint + build + 1972 pass / 3 skip / 0 fail).
  • Focused suites updated/added; independent verification with mutation checks on the ordering/condition asserts.

Note: stacked PR on feat/saved-sessions (this repo's CI only runs with base main), so no checks are expected here until the stack lands.

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/saved-sessions to main October 5, 2026 15:31
@rubenperezrial
rubenperezrial merged commit 2637920 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