Improve agent autonomy and diff view readability

Agent behavior improvements:
  - Add project context detection (tsconfig.json, pom.xml, etc.)
  - Enforce validation after changes (tsc --noEmit, mvn compile, etc.)
  - Run tests automatically - never ask "do you want me to run tests"
  - Complete full loop: create → type-check → test → confirm
  - Add command detection for direct execution (run tree, run ls)

  Diff view improvements:
  - Use darker backgrounds for added/removed lines
  - Add diffLineBgAdded, diffLineBgRemoved, diffLineText theme colors
  - Improve text visibility with white text on dark backgrounds
  - Update both React/Ink and SolidJS diff components

  Streaming fixes:
  - Fix tool call argument accumulation using OpenAI index field
  - Fix streaming content display after tool calls
  - Add consecutive error tracking to prevent token waste

  Other changes:
  - ESC to abort operations, Ctrl+C to exit
  - Fix model selection when provider changes in cascade mode
  - Add debug logging for troubleshooting
  - Move tests to root tests/ folder
  - Fix banner test GRADIENT_COLORS reference
This commit is contained in:
2026-01-29 07:33:30 -05:00
parent ad02852489
commit 187cc68304
62 changed files with 2005 additions and 2075 deletions

View File

@@ -111,10 +111,11 @@ const executeCommand = (
): Promise<ToolResult> => {
const {
command,
description,
workdir,
timeout = BASH_DEFAULTS.TIMEOUT,
} = args;
// Provide default description if not specified
const description = args.description ?? `Running: ${command.substring(0, 50)}`;
const cwd = workdir ?? ctx.workingDir;
updateRunningStatus(ctx, description);
@@ -165,7 +166,20 @@ export const executeBash = async (
args: BashParams,
ctx: ToolContext,
): Promise<ToolResult> => {
const { command, description } = args;
const { command } = args;
// Guard against undefined command (can happen with malformed tool calls)
if (!command) {
return {
success: false,
title: "Invalid command",
output: "",
error: "Command is required but was not provided",
};
}
// Provide default description if not specified
const description = args.description ?? `Running: ${command.substring(0, 50)}`;
const allowed = await checkPermission(
command,

View File

@@ -8,6 +8,7 @@ export const bashParams = z.object({
command: z.string().describe("The bash command to execute"),
description: z
.string()
.optional()
.describe("A brief description of what this command does"),
workdir: z
.string()