Skip to content

Commit c0b7aee

Browse files
authored
refactor(tui): prompt deep-module PR 3 — canonical completion + async workspace index (#220)
* refactor(tui): unify prompt completion context * feat(tui): index workspace mentions asynchronously * ci(typos): allow @Caf completion-prefix test token * fix(tui): address review findings on prompt completion - Escape now dismisses the slash-argument menu (cancel_completion fallback) instead of doing nothing when there is no draft command to strip. - Strip trailing prose punctuation from unquoted @-mention highlight spans. - Rank scoped @dir/name completions by the fragment's basename so prefix priority applies to path-scoped fragments. - Drain git stdout/stderr concurrently to avoid a pipe deadlock on verbose output. - Guard the mid-session HostPath.cwd() lookup so a removed working directory no longer crashes the prompt turn. - Collapse a dead SLASH_ARGUMENT branch in the completion parser. - De-duplicate the PromptLifecycle test double, make the degraded-state test helper multi-key-safe, and re-frame the backslash-whitespace parser test to document the real (non-escape-aware) contract. * fix(tui): cancel sibling stream reader when a git reader fails The concurrent stdout/stderr drain in _run_git used asyncio.gather, which leaves the sibling _read_bounded coroutine running after the first reader raises — only the process was killed, so the other reader could keep draining a closing pipe. Move the concurrent read into _read_streams, which uses explicit tasks and cancels+awaits both readers on any failure (or cancellation) before propagating. Adds a regression test for a reader-exception path.
1 parent 30f7b17 commit c0b7aee

12 files changed

Lines changed: 1891 additions & 708 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ GitHub Releases page; `0.8.0` is the new starting line.
1616
## Unreleased
1717

1818
- Freeze the public shell prompt compatibility contract with constructor and rendering coverage.
19+
- Unify slash and file-mention completion behind one canonical completion context, adding quoted `@"path with spaces"` file mentions.
20+
- Index workspace file mentions asynchronously with a cwd-aware, generation-owned snapshot index so completion never blocks on disk or Git scans.
21+
- Harden prompt completion: Escape now dismisses the slash-argument menu (not just draft commands), file-mention highlighting no longer swallows trailing prose punctuation, scoped `@dir/name` completions rank basename-prefix matches first, workspace Git scans drain stdout/stderr concurrently to avoid a pipe deadlock, and a mid-session working-directory removal no longer crashes the prompt turn.
1922
- Keep the interactive prompt scene within the terminal height with a priority-ordered row allocator, and shut prompt background tasks/processes down with an awaited lifecycle.
2023
- Add xAI Grok OAuth login (browser loopback and device-code).
2124
- Add GitHub Copilot device-code OAuth login for individual github.com accounts.

‎pyproject.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ iterm = "iterm"
194194
informations = "informations"
195195
# Project/domain-specific names and generated IDs.
196196
reviewr = "reviewr"
197+
# ASCII prefix used in a file-completion test (@caf -> "café.md").
198+
caf = "caf"
197199
fnd = "fnd"
198200
edn = "edn"
199201
Encrypter = "Encrypter"

0 commit comments

Comments
 (0)