The agent passed None for on_update, so tools (e.g. shell) never forwarded
their incremental output — the UI only saw the final result. Now:
- EventSink: Send + Sync (the forwarding closure must satisfy ToolUpdateSink)
- ToolUpdateSink becomes lifetime-parameterized (bare trait-object aliases
default to 'static, which forbade borrowing the caller's sink); all tool
impls updated to &ToolUpdateSink<'_>
- Agent::execute_single forwards each tool update as a ToolExecutionUpdate
event (Mutex provides interior mutability inside the Fn closure)
- TUI: running tools show the tail of the output live (newest lines), done
tools show the head + remaining-line hint
regression test: a streaming tool's on_update texts appear as agent events in
order.
Per AGENTS.md §5.1 every test must live under crates/<name>/tests/, so the
inline #[cfg(test)] modules in harness/tools/providers/transport are gone:
- harness: session_tests / compaction_tests / prompt_tests (days_to_ymd made pub)
- tools: read / write / edit / shell tests (Tool trait imported explicitly)
- providers: config_tests; request-body and stop-reason coverage folded into
integration tests via mock-recorded requests and SSE events (private builders
no longer tested directly)
- transport: ChunkedDecoder made pub (with Default), decoder tests moved into
transport_tests.rs
The only #[cfg(test)] left in src/ is the test-only TLS infra in tls.rs.
- read: line-range reads, binary detection
- write: overwrite with parent-dir creation
- edit: pi-style exact oldString/newString replacement with occurrence
- shell: bash on Linux, PowerShell (cmd fallback) on Windows; streaming
line updates via ToolUpdateSink, kill-on-timeout
- sync std I/O consistent with the core Tool trait; no tokio needed