feat(terminal): shade tool output and show a spinner while waiting - #15
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two terminal UX improvements to how tool activity is presented:
[bash]$ ...,[read] ...) now sit on a lighter background shade (256-color gray 238) than their output (gray 236), so the command and what it printed read apart at a glance.print_toolis split intoprint_tool_use/print_tool_outputover a shared_print_shadedhelper.NO_COLORis set, andstop()is idempotent. TheAgent>prompt is now printed only when the reply actually streams text, so tool-only turns no longer leave an empty prompt line.Changes
src/nanopycodeagent/terminal.py— two shading shades,Spinnerclass (context manager, background thread).src/nanopycodeagent/agent.py— use the split print helpers; wrap the model stream and bash runs in spinners; defer theAgent>prompt until the first streamed token.tests/test_terminal.py— cover both shades and the spinner (TTY/non-TTY, idempotent stop, erase-on-stop).docs/changelogs/0.6.x.md— new 0.6.x series file with the[Unreleased]entry (Added: spinner; Changed: two-tone shading), since these are features and the next release is a minor bump per SemVer.docs/dev_notes/zh-CN/0.6.x.md+docs/dev_notes/en/0.6.x.md— new 0.6.x dev notes (Chinese source, generated English version).Test plan
uv run pytest— 58 passed.