Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The composer is no longer disabled mid-turn. Submissions go into a pending queue; run_turn is the sole consumer and loops until drained, popping one queued message per turn so user/assistant alternation stays clean.
All interaction with the `ai` library now lives in `chat_loop(app)` at the top of the file. TauApp owns public state (model, agent, messages, pending) that chat_loop reads. run_turn shrinks to a thin worker wrapper around the busy flag.
Streaming deltas only call scroll_end when the transcript was already at the bottom — scroll up to read earlier output and the stream keeps writing offscreen. The scrollbar itself is hidden (scrollbar-size: 0 0) because its per-chunk thumb motion was visually noisy; arrow keys, pageup/pagedown, and mouse wheel still scroll.
tools.py mirrors pi's built-in surface: read, write, edit, bash, grep, find, ls. Same schema shapes and continuation/truncation behavior: - read: 1-indexed offset/limit; head truncation at 2000 lines or 50KB with a 'use offset=N to continue' hint; first-line-too-big escape pointing at sed | head -c. - write/edit/bash: require_approval=True so the agent's default loop gates them behind a ToolApproval hook. - edit: exact-match, must-be-unique str_replace; multiple disjoint edits per call, applied right-to-left against the original file. - bash: tail truncation (errors live at the end), exit-code footer. - grep/find: skip .git/node_modules/etc; respect limit/byte caps. chat_loop now handles ToolEnd, ToolCallResult, and HookEvent — tool calls and their results render as 'tool' bubbles below the streaming text, and pending approvals turn the composer placeholder into a [y/n] prompt. Non-y/n input during an approval falls through to the message queue without resolving the hook.
Replaces the y/n-in-the-composer approval flow with a HookPrompt widget that mounts above the composer when a tool fires its approval hook. Yellow rounded border, shows the tool name + args; single-key shortcuts (y/a approve, n/d deny) resolve the hook. Focus shifts to the prompt automatically and returns to the composer on resolution. Tab cycles between prompt and composer if the user wants to look something up before deciding \u2014 the hook stays pending until y/n. Drops the parallel y/n branch from on_composer_submitted; the prompt owns the decision now.
Only bash still requires approval. File mutations through write/edit are fine — they're targeted, reversible, and the approval prompt became friction more than safety once both fired several times per turn.
… messages When TAU_ADVERTISE=1 is set, appends an instruction to the system prompt asking the model to include a Co-authored-by trailer in any commit messages it writes or suggests. Co-authored-by: anthropic/claude-sonnet-4.6, via tau
Co-authored-by: anthropic/claude-opus-4.6, via tau
Add ruff as a dev dependency with the same lint rules as the top-level project. Fix import sorting, timezone.utc → UTC alias, and line length issues. Co-authored-by: anthropic/claude-opus-4.6, via tau
Add a Static widget below the composer that displays running totals for input, output, cache-read, and cache-write tokens. Updated on each turn and when restoring a session. Co-authored-by: anthropic/claude-opus-4.6, via tau
Derive context estimate from the last assistant turn's input + output tokens and display it as 'ctx: ~N' in the footer bar. Co-authored-by: anthropic/claude-opus-4.6, via tau
Pass providerOptions.gateway.caching=auto as params to agent.run(). Update the usage footer to show uncached input as 'in' and cache-read tokens separately as 'cached'. Co-authored-by: anthropic/claude-opus-4.6, via tau
Co-authored-by: anthropic/claude-opus-4.6, via tau
Bash approval prompts now offer four options: [y] approve once, [n] deny, [!] always approve this exact command, [a] always approve all commands for the rest of the session. Co-authored-by: anthropic/claude-opus-4.6, via tau
File I/O tools (read, grep, find, ls, write, edit) now fire approval hooks. Paths under the working directory are auto-approved. External paths prompt with [y] yes, [n] no, [d] allow dir, [a] always all. Read and write directories are tracked as separate categories. Co-authored-by: anthropic/claude-opus-4.6, via tau
Co-authored-by: anthropic/claude-opus-4.6, via tau
Co-authored-by: anthropic/claude-opus-4.6, via tau
ESC cancels the active worker and dismisses any pending approval prompt. Partial messages are saved before the stream is closed so context isn't lost. Co-authored-by: anthropic/claude-opus-4.6, via tau
Co-authored-by: anthropic/claude-opus-4.6, via tau
Check at_bottom once per event before any mutation. Tool calls, tool results, and new bubbles all respect the follow state now, so scrolled-up users aren't yanked down. Co-authored-by: anthropic/claude-opus-4.6, via tau
Bash now yields output lines as they arrive from the subprocess, emitting PartialToolCallResult events. The ConcatAggregator concatenates all chunks into the final tool result for the model. tau.py doesn't handle the streaming events yet. Co-authored-by: anthropic/claude-opus-4.6, via tau
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.
tau, a crappy coding agent using Textual.
(Even though I don't really like alternate screen coding agents, but.)