|
tui: minor correctness/perf fixes (Etap 5)
The last batch from the code review — real bugs and edge cases, not cosmetics: - tui_app._resolve_session: read session_id with .get and return None when a malformed server response omits it, instead of KeyError slipping past the api-call except (5.B3). - cli /switch: surface the original error cause (404 vs network vs server) on a non-unique prefix match instead of swallowing it into a generic "not found" (6.B2). - input_box _complete_command: a bare "/" with no hint list available no longer auto-picks the first command in the registry (3.B3). - filesystem _render_grep: when the grep ran in regex mode, highlight with the actual regex so marked spans match what the server found — a literal highlight of a regex pattern would mark nothing (2.B2). - file_refs _collect_files: filter sensitive entries out in the generator before sorted() so a huge directory is not fully materialized only to be mostly discarded (5.P1). - renderers/tool ToolResultRenderer: cap a generic tool result at 200 lines (tail + marker) so a non-filesystem tool with huge output does not flood the chat bubble — filesystem has its own renderer (2.P3). Tests: malformed-response /switch error surfacing, bare-slash no-auto-pick, grep regex highlight, sensitive-subdir skip, tool-result truncation. Full suite: 953 passed, 1 skipped. |
|---|
|
|
| clients/terminal/cli.py |
|---|
| clients/terminal/tui/file_refs.py |
|---|
| clients/terminal/tui/renderers/filesystem.py |
|---|
| clients/terminal/tui/renderers/tool.py |
|---|
| clients/terminal/tui/tui_app.py |
|---|
| clients/terminal/tui/widgets/input_box.py |
|---|
| tests/clients/test_file_refs.py |
|---|
| tests/clients/test_filesystem_renderer.py |
|---|
| tests/clients/test_input_box.py |
|---|
| tests/clients/test_terminal_client.py |
|---|
| tests/clients/test_tool_result_renderer.py 0 → 100644 |
|---|
| tests/clients/test_tui_app.py |
|---|