Repository navigation
fix: clear the question poll when it is resolved outside the bot - #32
Merged
Merged
Conversation
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
changed the base branch from
feat/session-title-fallback
to
main
October 5, 2026 15:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
With a project active, the bot stays locked behind the question flow: any command outside the allowlist replies "This command is not available until the current question flow completes" even though OpenCode has no pending question. The stale state is created when a question card is shown and is never cleared if the question is answered from another client (TUI, VS Code) or if the resolving SSE event is lost.
Cause
question.repliedandquestion.rejectedevents were only logged insummary-aggregation-manager— unlike the permission flow, which clears its state on the equivalent events. There is no callback, and no interaction expires (expiresInMsis never passed), so a resolution that never reaches the bot leaves the local poll and the interaction guard stuck forever.Fix
Two independent paths, mirroring the existing permission handling:
summary-aggregation-managernow firessetOnQuestionResolved(sessionId, requestID)for bothquestion.repliedandquestion.rejected;event-subscription-serviceclears the poll + interaction and deletes the Telegram card when therequestIDmatches the active poll (no-op otherwise, so questions from background sessions are untouched).session.idle,event-subscription-serviceverifies the active poll againstquestion.list({ directory })and clears it only if the server no longer lists the request. A failed lookup or a still-pending question leaves the state untouched (no regression). The check runs as a non-blockingsafeBackgroundTaskso an unresponsivequestion.listcan never stall idle finalization (finishRun, tool flush, footer, queue).Resolved/in-flight races are covered with the same pattern as permissions: resolved
requestIDs are remembered (markResolved/isResolved) so a latequestion.askedor an in-flight Telegram card is discarded instead of resurrecting a stale poll, and the local state is cleared before touching Telegram.Tests
Adds 11 tests to
event-subscription-service.test.ts:askedevent whose request was already resolved.Local gate:
bun run check-> 2027 pass / 3 skip / 0 fail (lint + build OK).CI
This PR is stacked on
feat/session-title-fallback(PR #31); CI only runs on PRs based onmain, so no checks are expected here. The local gate is the source of truth until the stack lands.