Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Two bugs fixed:

1. Thinking slider didn't remember for Ctrl+Shift+T

Root Cause:

  • Slider only updated thinkingLevel:{workspaceId} storage
  • Ctrl+Shift+T toggle reads/writes lastThinkingByModel:{modelName}
  • Slider changes weren't visible to the toggle

Fix:

  • Added handleThinkingLevelChange that updates both storage locations
  • Only saves active levels ("low"/"medium"/"high"), not "off"
  • Matches the logic in useAIViewKeybinds.ts

2. Auto-resume didn't work after app restart during slow models

Root Cause:

  • Models can take 30-60 seconds before first token
  • If app restarts during this time:
    • History has user message but no assistant response
    • hasInterruptedStream() returned false (no partial/error messages)
    • Auto-resume didn't trigger

Fix:

  • Updated hasInterruptedStream() to return true when last message is a user message
  • Rationale: History never ends with user message in normal flow
    • Either assistant is responding (active stream, checked separately)
    • Or assistant has responded (completed message in history)
  • If history ends with user message → incomplete conversation → needs resume
  • Respects user preference: autoRetry flag is checked separately and persists across restarts

Changes

src/components/ThinkingSlider.tsx           |  16 ++- (thinking slider fix)
src/utils/messages/retryEligibility.test.ts | 176 +++ (comprehensive tests)
src/utils/messages/retryEligibility.ts      |   8 +++ (auto-resume fix)
3 files changed, 198 insertions(+), 2 deletions(-)

Testing

  • ✅ 669 unit tests pass
  • ✅ 8 new tests for retry eligibility logic
  • ✅ Type checking clean
  • ✅ Integration tests pass

Generated with cmux

Two bugs fixed:

1. Thinking slider didn't remember for Ctrl+Shift+T
   - Slider now saves to lastThinkingByModel storage on change
   - Ensures toggle keybind remembers manual slider adjustments

2. Auto-resume didn't work after app restart during slow models
   - hasInterruptedStream() now returns true when last message is user message
   - Handles case where model takes 30-60s to first token and app restarts
   - History ending with user message indicates incomplete conversation

Added comprehensive test coverage for retry eligibility logic.
All tests pass (669 unit + integration tests).
@ammario ammario added this pull request to the merge queue Oct 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 20, 2025
@ammario ammario merged commit 4e65577 into main Oct 20, 2025
8 checks passed
@ammario ammario deleted the resume-bug branch October 20, 2025 00:30
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.

2 participants