Improve tool execution rendering and error handling

- Show tool execution components immediately when tool calls appear in streaming
- Update components with streaming arguments as they come in
- Handle incomplete/partial arguments gracefully with optional chaining
- Fix error handling: tools now throw exceptions instead of returning error messages
- Fix bash abort handling to properly reject on abort/timeout
- Clean up error display
This commit is contained in:
Mario Zechner 2025-11-11 23:05:58 +01:00
parent 2d43b2f2e3
commit 159075cad7
10 changed files with 288 additions and 278 deletions

View file

@ -4,7 +4,6 @@ import { Container, Markdown, Spacer } from "@mariozechner/pi-tui";
* Component that renders a user message
*/
export class UserMessageComponent extends Container {
private spacer: Spacer | null = null;
private markdown: Markdown;
constructor(text: string, isFirst: boolean) {
@ -12,8 +11,7 @@ export class UserMessageComponent extends Container {
// Add spacer before user message (except first one)
if (!isFirst) {
this.spacer = new Spacer(1);
this.addChild(this.spacer);
this.addChild(new Spacer(1));
}
// User messages with dark gray background