Skip to content

fix: queue completion notifications during active approval/question - #61

Closed
CodePirate7 wants to merge 1 commit into
wxtsky:mainfrom
CodePirate7:fix/queue-completion-during-interactive
Closed

CodePirate7 wants to merge 1 commit into
wxtsky:mainfrom
CodePirate7:fix/queue-completion-during-interactive

Conversation

@CodePirate7

@CodePirate7 CodePirate7 commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #57

  • Bug: When a session completes while the user is interacting with an approval or question card, the completion notification immediately replaces the interactive card, causing the pending approval/question to be lost.
  • Fix: Completion notifications are now queued when any interactive card (approval or question) is visible, and drained only after the user finishes interacting.
  • Unified scheduling: showNextPending() now handles the full priority chain: permission requests → questions → queued completions → collapse. showNextCompletionOrCollapse() delegates to it to avoid duplicated logic.

Changes

File What changed
Sources/CodeIsland/AppState.swift Added isShowingInteractive check, updated enqueueCompletion to queue during interactive cards, extended showNextPending to drain completion queue, simplified showNextCompletionOrCollapse

Test plan

  • Start a long-running session, trigger approval request, then complete another session → completion should queue, not replace the approval card
  • Answer the approval → queued completion should appear next
  • Same test with question card instead of approval card
  • Multiple completions during a single interactive card → all should drain in order after interaction
  • Normal completion flow (no interactive card active) still works immediately

…ctive

Previously, when a session completed while an approval or question card
was being displayed, the completion notification would immediately replace
the interactive card. This caused the user to lose their pending approval
or question, effectively skipping it.

Now completion notifications are queued when any interactive card (approval
or question) is visible, and drained after the user finishes interacting.
The showNextPending() method is extended to handle the full priority chain:
permission requests > questions > queued completions > collapse.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@wxtsky

wxtsky commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution! Your completion queue fix (isShowingInteractive, queue during interactive cards, showNextPending drain) was included in the combined multi-question implementation that also merges #59 and #60.

Closing in favor of the merged implementation.

@wxtsky wxtsky closed this Apr 11, 2026
@CodePirate7

Copy link
Copy Markdown
Contributor Author

Thanks for including the fix! Would you mind adding a Co-authored-by trailer to the merged commit? That way GitHub tracks the contribution properly.

Co-authored-by: CodePirate7 <[email protected]>

wxtsky added a commit that referenced this pull request Apr 11, 2026
…+ completion queue fix

Multi-question (merged #59 + #60):
- Wizard-style one-question-at-a-time UI with Back navigation
- MultiSelect checkbox support and "Other" free-text input
- AskUserQuestionState with answer key dedup (header-based, collision-safe)
- answerQuestionMulti with positional matching
- drainQuestions sends deny for AskUserQuestion-derived requests
- 7 unit tests covering multi-question, dedup, skip, disconnect

Completion queue fix (merged #61):
- Queue completion notifications when approval/question card is active
- Drain queued completions in showNextPending

Remote SSH monitoring (merged #42):
- SSH tunnel forwarding for remote Claude Code / Codex sessions
- Remote hook installer and Python bridge script
- Settings UI for remote host management
- Remote session guards (skip PID monitor, model read, persistence, terminal activation)

Co-Authored-By: CodePirate7 <[email protected]>
Co-Authored-By: lkangd <[email protected]>
Co-Authored-By: Hatiaa <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
nguyenvanduocit pushed a commit to nguyenvanduocit/CodeIsland that referenced this pull request Apr 12, 2026
PR wxtsky#59/wxtsky#60 merged (abfc3b7): multi-question AskUserQuestion wizard UI —
promote T-018 from "watch" to "implement now".

New tasks added to Todo:
- T-020: terminal activation overhaul (Warp/Alacritty/Hyper/tmux/IDE)
- T-021: configurable island width 50–150% slider
- T-022: cmux precise terminal jump (PR wxtsky#50 merged)
- T-023: hook config migration ~/.claude/hooks/ → ~/.codeisland/

PR wxtsky#61 (completion queue fix) already in our codebase — no task needed.
Remote SSH monitoring, third-party CLI, and Turkish l10n skipped.

https://claude.ai/code/session_01Gcwzjp7VguhnX64hM6tEC1
heiboy0070 pushed a commit to heiboy0070/CodeIsland that referenced this pull request Apr 13, 2026
…+ completion queue fix

Multi-question (merged wxtsky#59 + wxtsky#60):
- Wizard-style one-question-at-a-time UI with Back navigation
- MultiSelect checkbox support and "Other" free-text input
- AskUserQuestionState with answer key dedup (header-based, collision-safe)
- answerQuestionMulti with positional matching
- drainQuestions sends deny for AskUserQuestion-derived requests
- 7 unit tests covering multi-question, dedup, skip, disconnect

Completion queue fix (merged wxtsky#61):
- Queue completion notifications when approval/question card is active
- Drain queued completions in showNextPending

Remote SSH monitoring (merged wxtsky#42):
- SSH tunnel forwarding for remote Claude Code / Codex sessions
- Remote hook installer and Python bridge script
- Settings UI for remote host management
- Remote session guards (skip PID monitor, model read, persistence, terminal activation)

Co-Authored-By: CodePirate7 <[email protected]>
Co-Authored-By: lkangd <[email protected]>
Co-Authored-By: Hatiaa <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.

bug: 连续几个权限请求会覆盖,还没等点击确认,就默认拒绝了

2 participants