Skip to content

Commit 041593f

Browse files
committed
fix: critical production hardening — retry, logging, security, error boundary, settings validation
CRITICAL FIXES: - Add retry logic with exponential backoff to provider client (3 retries, 1s/3s/8s delays) - Add structured logging framework (~/.localcode/logs/) with levels (debug/info/warn/error) - Enforce blocked commands in shell executor — prevents dangerous commands like 'rm -rf /' - Add ErrorBoundary to App.tsx — React errors no longer crash the entire terminal UI - Fix session save to be synchronous instead of fire-and-forget setTimeout HIGH PRIORITY FIXES: - Remove 14 dead dependencies (node-pty, axios, zod, opentelemetry, lodash, ws, glob, node-fetch) Reduces install size by ~10x, 0 vulnerabilities - Fix plugin loader for Windows paths using pathToFileURL instead of manual file:// URLs - Add settings validation — corrupt settings files no longer crash the app - Add settings caching (5s TTL) — avoids re-reading from disk on every getSetting call - Add sessionFiles cleanup method to prevent memory leak in tool executor - Add maxBuffer (10MB) to shell command execution MEDIUM PRIORITY FIXES: - Add logging to tool executor, plugin loader, and settings manager - Fix getSettingsSummary to handle partial settings without throwing - Add logger import to provider client for retry logging
1 parent 79c2ff8 commit 041593f

File tree

19 files changed

+439
-1156
lines changed

19 files changed

+439
-1156
lines changed

dist/bin/localcode.js

100755100644
File mode changed.

dist/providers/client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/providers/client.js

Lines changed: 35 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/providers/client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tools/executor.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,14 @@ export declare class ToolExecutor {
1919
getSessionFiles(): Record<string, string>;
2020
undoLastChange(): string | null;
2121
unifiedDiff(filePath: string): string | null;
22+
/**
23+
* Clear tracked session files to free memory.
24+
* Call this after a session is saved or compacted.
25+
*/
26+
clearSessionFiles(): void;
27+
/**
28+
* Get the number of tracked session files.
29+
*/
30+
getSessionFileCount(): number;
2231
}
2332
//# sourceMappingURL=executor.d.ts.map

dist/tools/executor.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tools/executor.js

Lines changed: 63 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)