mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 23:01:56 +00:00
Release v0.7.16
This commit is contained in:
parent
f2b3953711
commit
6680034a64
12 changed files with 94 additions and 38 deletions
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.7.16] - 2025-11-17
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Tool Error Display**: Fixed edit tool (and all other tools) not showing error state correctly in TUI. Failed tool executions now properly display with red background and show the error message. Previously, the `isError` flag from tool execution events was not being passed to the UI component, causing all tool results to show with green (success) background regardless of whether they succeeded or failed.
|
||||
|
||||
## [0.7.15] - 2025-11-17
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mariozechner/pi-coding-agent",
|
||||
"version": "0.7.15",
|
||||
"version": "0.7.16",
|
||||
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
|
@ -21,8 +21,8 @@
|
|||
"prepublishOnly": "npm run clean && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mariozechner/pi-agent": "^0.7.15",
|
||||
"@mariozechner/pi-ai": "^0.7.15",
|
||||
"@mariozechner/pi-agent": "^0.7.16",
|
||||
"@mariozechner/pi-ai": "^0.7.16",
|
||||
"chalk": "^5.5.0",
|
||||
"diff": "^8.0.2",
|
||||
"glob": "^11.0.3"
|
||||
|
|
|
|||
|
|
@ -251,20 +251,27 @@ export class ToolExecutionComponent extends Container {
|
|||
const path = shortenPath(this.args?.file_path || this.args?.path || "");
|
||||
text = chalk.bold("edit") + " " + (path ? chalk.cyan(path) : chalk.dim("..."));
|
||||
|
||||
// Show diff if available
|
||||
if (this.result?.details?.diff) {
|
||||
// Parse the diff string and apply colors
|
||||
const diffLines = this.result.details.diff.split("\n");
|
||||
const coloredLines = diffLines.map((line: string) => {
|
||||
if (line.startsWith("+")) {
|
||||
return chalk.green(line);
|
||||
} else if (line.startsWith("-")) {
|
||||
return chalk.red(line);
|
||||
} else {
|
||||
return chalk.dim(line);
|
||||
if (this.result) {
|
||||
// Show error message if it's an error
|
||||
if (this.result.isError) {
|
||||
const errorText = this.getTextOutput();
|
||||
if (errorText) {
|
||||
text += "\n\n" + chalk.red(errorText);
|
||||
}
|
||||
});
|
||||
text += "\n\n" + coloredLines.join("\n");
|
||||
} else if (this.result.details?.diff) {
|
||||
// Show diff if available
|
||||
const diffLines = this.result.details.diff.split("\n");
|
||||
const coloredLines = diffLines.map((line: string) => {
|
||||
if (line.startsWith("+")) {
|
||||
return chalk.green(line);
|
||||
} else if (line.startsWith("-")) {
|
||||
return chalk.red(line);
|
||||
} else {
|
||||
return chalk.dim(line);
|
||||
}
|
||||
});
|
||||
text += "\n\n" + coloredLines.join("\n");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Generic tool
|
||||
|
|
|
|||
|
|
@ -376,7 +376,20 @@ export class TuiRenderer {
|
|||
// Update the existing tool component with the result
|
||||
const component = this.pendingTools.get(event.toolCallId);
|
||||
if (component) {
|
||||
component.updateResult(event.result);
|
||||
// Convert result to the format expected by updateResult
|
||||
const resultData =
|
||||
typeof event.result === "string"
|
||||
? {
|
||||
content: [{ type: "text" as const, text: event.result }],
|
||||
details: undefined,
|
||||
isError: event.isError,
|
||||
}
|
||||
: {
|
||||
content: event.result.content,
|
||||
details: event.result.details,
|
||||
isError: event.isError,
|
||||
};
|
||||
component.updateResult(resultData);
|
||||
this.pendingTools.delete(event.toolCallId);
|
||||
this.ui.requestRender();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue