Skip to content

feat: detect IBKR "Invalid username or password" credential-rejection modal - #18

Merged
code-hustler-ft3d merged 1 commit into
mainfrom
feat/detect-bad-credentials-modal
Jun 14, 2026
Merged

feat: detect IBKR "Invalid username or password" credential-rejection modal#18
code-hustler-ft3d merged 1 commit into
mainfrom
feat/detect-bad-credentials-modal

Conversation

@code-hustler-ft3d

Copy link
Copy Markdown
Owner

What

handle_post_login_dialogs previously left IBKR's "Invalid username or password" credential-rejection modal unhandled — a wrong-credentials login fell through to the "unrecognized modal, leave in place" branch at the initial-login stage, so no ALERT_LOGIN_FAILED fired there.

This adds:

  • _detect_bad_credentials() — a regex detector for the credential-rejection modal wording (including the two-word "user name" spelling some IBKR builds use), mirroring the existing _detect_password_expiry style.
  • A recognized branch in handle_post_login_dialogs that emits the existing ALERT_LOGIN_FAILED reason="bad-credentials" grep-contract token, dismisses the modal, and lets the normal CCP-backoff retry proceed. Detection is a signal, not a corrective action — no return False/sys.exit, consistent with the documented Non-goal in CHANGELOG.
  • In-JVM relogin path (attempt_inplace_relogin) recognizes the same wording too (purely additive).
  • Reuses the byte-identical suggested_action string (no monitor/grep-contract drift); docs/OBSERVABILITY.md updated (two paths → three); CHANGELOG entry.

Testing

  • 9 new unit tests for _detect_bad_credentials (canonical modal + variants + negatives); full suite passes (246, up from 237).
  • Unit-validated only — not yet live-validated against a running Gateway. Fail-safe by design: if the live modal text differs from the regex, behavior degrades to today's "leave unrecognized" (no regression, no bad exit).

Credit

Gap spotted via @efJerryYang's fork. Implemented independently.

… modal

handle_post_login_dialogs previously left the credential-rejection modal
unhandled, so a wrong-credentials login fell through unrecognized at the
initial-login stage. Add a _detect_bad_credentials() detector and a
recognized branch that emits the existing ALERT_LOGIN_FAILED
reason="bad-credentials" grep-contract token and dismisses the modal,
then lets the normal CCP-backoff retry proceed — detection is a signal,
not a corrective abort (no return False / sys.exit). The in-JVM relogin
path recognizes the same wording too.

Reuses the byte-identical suggested_action string (no monitor drift);
updates OBSERVABILITY.md (two paths -> three) and CHANGELOG. Unit-tested
(9 cases); not yet live-validated against a running Gateway.

Gap spotted via @efJerryYang's fork; implemented independently.
@code-hustler-ft3d
code-hustler-ft3d merged commit 6f09b94 into main Jun 14, 2026
1 check passed
@code-hustler-ft3d
code-hustler-ft3d deleted the feat/detect-bad-credentials-modal branch June 14, 2026 22:05
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