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

@@ -9,6 +9,7 @@ import {
} from "solid-js";
import { batch } from "solid-js";
import { getFiles } from "@services/file-picker/files";
import { abortCurrentOperation } from "@services/chat-tui-service";
import versionData from "@/version.json";
import {
ExitProvider,
@@ -90,7 +91,7 @@ function ErrorFallback(props: { error: Error }) {
{props.error.message}
</text>
<text fg={theme.colors.textDim} marginTop={2}>
Press Ctrl+C to exit
Press Ctrl+C twice to exit
</text>
</box>
);
@@ -157,16 +158,29 @@ function AppContent(props: AppProps) {
}
useKeyboard((evt) => {
// ESC aborts current operation
if (evt.name === "escape") {
const aborted = abortCurrentOperation();
if (aborted) {
toast.info("Operation cancelled");
evt.preventDefault();
return;
}
}
// Ctrl+C exits the application
if (evt.ctrl && evt.name === "c") {
if (app.interruptPending()) {
exit.exit(0);
} else {
app.setInterruptPending(true);
toast.warning("Press Ctrl+C again to exit");
setTimeout(() => {
app.setInterruptPending(false);
}, 2000);
evt.preventDefault();
return;
}
app.setInterruptPending(true);
toast.warning("Press Ctrl+C again to exit");
setTimeout(() => {
app.setInterruptPending(false);
}, 2000);
evt.preventDefault();
return;
}