Skip to content

fix(tui): 모델 로그인 취소 판정 수정 - #5

Closed
Mineru98 wants to merge 1 commit into
codex/tui-frame-qa-harnessfrom
work/model-device-login-persistence
Closed

fix(tui): 모델 로그인 취소 판정 수정#5
Mineru98 wants to merge 1 commit into
codex/tui-frame-qa-harnessfrom
work/model-device-login-persistence

Conversation

@Mineru98

@Mineru98 Mineru98 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

문제

기존 /modelcodex (ChatGPT) 로그인 플로우는 device login card가 뜬 직후, 사용자가 명시적으로 취소하지 않아도 Login cancelled.로 닫힐 수 있었습니다.

원인은 login polling 중 terminal input에 raw ESC byte가 포함되면 전부 cancel로 처리하던 조건입니다. TUI 환경에서는 실제 Escape 키뿐 아니라 arrow/ANSI/SGR mouse report도 ESC로 시작하므로, 마우스/터미널 잡음만으로 ChatGPT device 로그인 화면이 사라질 수 있었습니다.

변경

  • TuiLogin.wait_or_cancel에서 raw ESC 포함 여부 대신 기존 KeyReader.decode/1 결과로 cancel 여부를 판단합니다.
  • 명시적 취소 입력은 유지합니다.
    • Ctrl-C
    • standalone Escape
  • 다음 ESC-prefixed non-cancel 입력은 로그인 카드를 유지합니다.
    • SGR mouse report
    • CSI arrow input
    • incomplete ESC sequence
  • 위 동작을 tui_login_test.exs에 회귀 테스트로 고정했습니다.

Before / After 캡처

캡처는 device code를 마스킹한 상태로 생성했습니다.

  • Before: /model → Codex device login 중 SGR mouse input 이후 Login cancelled. 표시
  • After: 동일 입력 이후에도 Connect ChatGPT card와 auth.openai.com/codex/device가 유지됨

로컬 캡처 아티팩트:

/tmp/ourocode-pr-captures/before-after-comparison-redacted.png
/tmp/ourocode-pr-captures/before-04-after-sgr-mouse-redacted.png
/tmp/ourocode-pr-captures/after-04-after-sgr-mouse-redacted.png

검증

mix test test/ourocode/terminal/tui_login_test.exs \
  test/ourocode/terminal/tui_model_selection_test.exs \
  test/ourocode/terminal/tui_frame_test.exs

Result: 41 passed

추가 수동 QA:

  • 기준 버전: SGR mouse ESC sequence 후 Login cancelled. 재현
  • 수정 버전: 동일 sequence 후 Connect ChatGPT card 유지 확인

범위

  • OAuth protocol/token exchange 변경 없음
  • /model catalog/order 변경 없음
  • Claude login flow 변경 없음
  • binary/build artifact는 PR에 포함하지 않음

- ESC 포함 여부 대신 KeyReader 이벤트로 취소 입력을 판정
- SGR mouse/CSI arrow/incomplete ESC가 device login을 취소하지 않도록 테스트 추가
- Ctrl-C와 standalone Escape 취소 동작은 유지
@mineru-zero

Copy link
Copy Markdown

Closing because this PR was opened against the wrong repository. The target repository is Q00/ourocode.

1 similar comment
@Mineru98

Mineru98 commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Closing because this PR was opened against the wrong repository. The target repository is Q00/ourocode.

@Mineru98 Mineru98 closed this Jul 1, 2026
Mineru98 added a commit that referenced this pull request Jul 21, 2026
Three Windows-only mix test failures surfaced by windows-ci.yml, none of
which are production bugs:

- Ports (#1 StdioTest, #5 HelperPortTest): the port test helper spawned
  `elixir` (elixir.bat on Windows), whose batch shim breaks the port stdout
  pipe ("The pipe is being closed") and adds boot latency. Drive the echo/
  shell programs with `erl` directly instead, passing operations as a base64
  term (no escaping). Behaviour is identical on Linux (41 tests, 0 failures).
- Registry skill paths (#2/#3/#4): the code returns Path.expand'd skill paths
  (forward slashes, lowercased drive on Windows); tests compared against raw
  Path.join values. Wrap the expected values in Path.expand, matching the
  existing source_id assertions. Idempotent on Linux.
- Frontmatter CRLF (Ouro-labs#6): the parser already handles CRLF; the failure came
  from the .exs fixture being checked out CRLF on Windows. Add .gitattributes
  (eol=lf) so text files are LF on every platform.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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