Skip to content

[WIP] Start on a coding agent demo#117

Draft
msullivan wants to merge 22 commits into
mainfrom
tau-agent
Draft

[WIP] Start on a coding agent demo#117
msullivan wants to merge 22 commits into
mainfrom
tau-agent

Conversation

@msullivan
Copy link
Copy Markdown
Contributor

@msullivan msullivan commented May 13, 2026

tau, a crappy coding agent using Textual.
(Even though I don't really like alternate screen coding agents, but.)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-python Ready Ready Preview, Comment May 13, 2026 6:04pm

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 13, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​anthropic@​0.101.093100100100100
Addedpypi/​vercel@​0.5.896100100100100
Addedpypi/​openai@​2.36.096100100100100
Addedpypi/​textual@​8.2.598100100100100
Addedpypi/​rich@​15.0.098100100100100
Addedpypi/​mcp@​1.27.199100100100100
Addedpypi/​pydantic@​2.13.4100100100100100
Addedpypi/​ruff@​0.15.12100100100100100

View full report

msullivan added 17 commits May 13, 2026 00:38
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
msullivan added 5 commits May 13, 2026 10:22
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
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