Add bash_kill, background job eviction, and configurable request timeout

Bump to 0.3.0.

- bash_kill tool lets the model terminate a still-running backgrounded
  job (Ctrl+B); all running jobs are killed on process exit so they
  don't outlive locode as orphans.
- Finished background jobs are now evicted from the registry after a
  10-minute TTL instead of accumulating for the life of the session.
- The chat completion request timeout is now configurable
  (requestTimeoutMs / LOCODE_REQUEST_TIMEOUT_MS, default 180000) so
  backends that queue requests behind a concurrency limit (e.g.
  Ollama's OLLAMA_NUM_PARALLEL) under multi-session load aren't forced
  into a hard failure at a fixed 3 minutes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kim
2026-07-08 12:48:32 +09:00
co-authored by Claude Sonnet 5
parent 2a35f40c73
commit 4652ecb87b
14 changed files with 214 additions and 12 deletions
+13 -3
View File
@@ -114,7 +114,7 @@ configCmd
configCmd
.command("set <key> <value>")
.description("Persist a config value (backend, model, baseUrl, contextWindow, maxIterations, autoCompactThreshold)")
.description("Persist a config value (backend, model, baseUrl, contextWindow, maxIterations, autoCompactThreshold, requestTimeoutMs)")
.action((key: string, value: string) => {
if (
key !== "backend" &&
@@ -122,9 +122,12 @@ configCmd
key !== "baseUrl" &&
key !== "contextWindow" &&
key !== "maxIterations" &&
key !== "autoCompactThreshold"
key !== "autoCompactThreshold" &&
key !== "requestTimeoutMs"
) {
console.error(`Unknown config key "${key}". Valid keys: backend, model, baseUrl, contextWindow, maxIterations, autoCompactThreshold`);
console.error(
`Unknown config key "${key}". Valid keys: backend, model, baseUrl, contextWindow, maxIterations, autoCompactThreshold, requestTimeoutMs`,
);
process.exit(1);
}
const stored = loadStoredConfig();
@@ -142,6 +145,13 @@ configCmd
process.exit(1);
}
stored[key] = n;
} else if (key === "requestTimeoutMs") {
const n = Number(value);
if (!Number.isFinite(n) || n < 10_000 || n > 1_800_000) {
console.error(`requestTimeoutMs must be between 10000 and 1800000, got "${value}".`);
process.exit(1);
}
stored[key] = n;
} else {
stored[key] = value;
}