Skip to content

Fixed Auto Mode false-positive detection from permission-prompt tip text - #173

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/auto-mode-false-positive-detection
Sep 27, 2026
Merged

oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/auto-mode-false-positive-detection

Conversation

@oleg68

@oleg68 oleg68 commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • detectEditMode() scanned the bottom 3 non-blank screen lines for mode keywords; a Bash-command permission prompt whose tip ("Tip: auto mode handles these prompts for you...") or menu option ("2. Yes, and switch to auto mode...") merely mentions "auto mode" was misdetected as EditMode.AUTO, even though the mode had not actually changed.
  • Now only the single bottom-most non-blank line is checked (matching how the existing " esc to interrupt" fallback already worked), and AUTO detection requires the literal "auto mode on" phrase.
  • Added a "manual mode on" → DEFAULT branch for newer Claude Code versions that render it explicitly, keeping the " esc to interrupt" fallback for older versions that don't.

Test plan

  • Added regression tests in ScreenContentDetectorTest reproducing the reported false-positive (confirmed failing before the fix, passing after)
  • Added tests for "manual mode on" detection (plain + case-insensitive)
  • mvn test — full suite green
  • mvn package — full build succeeds

🤖 Generated with Claude Code

…permission prompt merely mentioned "auto mode" in its tip text or "switch to auto mode" menu option, instead of the mode actually changing

detectEditMode() now checks only the bottom-most non-blank screen line
instead of scanning the last 3 lines, so tip/menu text above the real
mode footer can no longer be mistaken for it. Also requires the literal
"auto mode on" phrase, and adds a "manual mode on" -> DEFAULT branch for
newer Claude Code versions, keeping the existing "  esc to interrupt"
fallback for older versions that don't emit that text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@oleg68
oleg68 merged commit cbb745b into nbplugins:main Sep 27, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/auto-mode-false-positive-detection branch September 27, 2026 12:56
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