This commit is contained in:
seb
2026-09-22 21:40:13 +02:00
parent ab2f953e06
commit 73e7f7e7f8
6 changed files with 246 additions and 35 deletions

View File

@@ -28,7 +28,7 @@ import { markedTerminal } from 'marked-terminal';
import { LLMOrbiter, OpenRouterProvider } from 'llmorbiter';
import { API_KEY, MODEL, UNDO_FILE, SUSPEND_FILE, ROOT_DIR } from './config.js';
import { API_KEY, MODEL, UNDO_FILE, SUSPEND_DIR, ROOT_DIR } from './config.js';
import { listDir } from './dir-listing.js';
import { loadUndoLog, getUndoLog } from './undo.js';
import { loadSuspends, addSuspend, getSuspends } from './suspend.js';
@@ -36,6 +36,7 @@ import { tools, toolCallNotifications, toolResultNotifications } from './tools/i
import { printToolCall, emitGenericToolResult } from './tools/notify.js';
import { autocompleteInput } from './autocomplete-input.js';
import { COMMANDS, findCommand } from './slash-commands.js';
import { compactPatchToolCalls } from './compact.js';
// ─── Markdown → console renderer ───────────────────────────────────────────────
@@ -141,7 +142,7 @@ function printBanner() {
console.log(chalk.dim(` Workspace: ${ROOT_DIR}`));
console.log(chalk.dim(` Model: ${MODEL}`));
console.log(chalk.dim(` Undo log: ${path.resolve(ROOT_DIR, UNDO_FILE)}`));
console.log(chalk.dim(` Suspends: ${path.resolve(ROOT_DIR, SUSPEND_FILE)}`));
console.log(chalk.dim(` Suspends: ${path.resolve(ROOT_DIR, SUSPEND_DIR)}`));
console.log('');
}
@@ -391,7 +392,7 @@ async function main() {
addSuspend(description, messages);
const count = getSuspends().length;
console.log(chalk.green(`\n ⏸ Suspended: ${description}`));
console.log(chalk.dim(` ${count} snapshot${count === 1 ? '' : 's'} in ${SUSPEND_FILE}\n`));
console.log(chalk.dim(` ${count} snapshot${count === 1 ? '' : 's'} in ${SUSPEND_DIR}\n`));
continue;
}
@@ -446,6 +447,10 @@ async function main() {
// Update conversation history for next turn
messages = result.messages;
// Token savings: the patch tool's arguments carry whole file bodies
// (search/replace). Once applied they are dead weight, so shrink each
// patch tool call in the transcript to a head/tail excerpt.
compactPatchToolCalls(messages);
printAssistant(result.content);
} catch (err) {