Skip to content

fix(tui): rank slash command prefixes#28

Merged
code-yeongyu merged 1 commit into
mainfrom
codex/fix-sessions-enter
May 26, 2026
Merged

fix(tui): rank slash command prefixes#28
code-yeongyu merged 1 commit into
mainfrom
codex/fix-sessions-enter

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented May 26, 2026

Summary

  • rank ambiguous slash-command prefix matches so /sessio selects /sessions before /session
  • keep exact /session matching ahead of longer commands
  • move slash-command autocomplete ranking into a small TUI module with regression coverage

Root Cause

The editor autocomplete list showed both session and sessions, but the fuzzy result order highlighted session for /sessio. Pressing Enter accepted and submitted the highlighted singular command, so users saw session stats instead of opening the sessions HUD.

Validation

  • red: node --test --import tsx test/autocomplete-slash.test.ts failed with actual: [ session, sessions ]
  • green: node --test --import tsx test/autocomplete-slash.test.ts
  • package coverage: node --test --import tsx test/autocomplete.test.ts test/autocomplete-slash.test.ts
  • full check: npm run check
  • build: npm --prefix packages/tui run build && npm --prefix packages/coding-agent run build
  • manual tmux QA: typed /sessio; autocomplete selected sessions; Enter invoked session-observer instead of /session

Summary by cubic

Fixes slash-command autocomplete ranking in packages/tui so typing /sessio selects sessions before session. Exact /session still ranks first.

  • Bug Fixes

    • Rank longer prefix matches ahead of shorter commands when the prefix is ambiguous.
    • Preserve exact match priority.
  • Refactors

    • Extracted ranking into packages/tui/src/slash-command-autocomplete.ts and wired into src/autocomplete.ts.
    • Added regression tests in packages/tui/test/autocomplete-slash.test.ts.

Written for commit 4ce014c. Summary will update on new commits. Review in cubic

@code-yeongyu code-yeongyu merged commit a84acc2 into main May 26, 2026
3 checks passed
@code-yeongyu code-yeongyu deleted the codex/fix-sessions-enter branch May 26, 2026 08:08
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