fix: resolve Greptile review comments on error handling

- Remove spurious console.error in logger JSON.parse catch (expected control flow)
- Remove debug logging from hot PID cleanup loop (approved override)
- Replace unsafe `error as Error` casts with instanceof checks in ChromaSync, GeminiAgent, OpenRouterAgent
- Wrap non-Error FTS failures with new Error(String()) instead of dropping details

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-04-19 20:05:27 -07:00
parent a0dd516cd5
commit 30a0ab4ddb
6 changed files with 7 additions and 13 deletions
+1 -5
View File
@@ -154,11 +154,7 @@ class Logger {
try {
input = JSON.parse(toolInput);
} catch (_parseError: unknown) {
// [ANTI-PATTERN IGNORED]: Logger cannot log its own failures, using stderr/console as last resort
// Input is a raw string (e.g., Bash command), use as-is
if (_parseError instanceof Error) {
console.error('[logger] JSON parse failed for tool input:', _parseError);
}
// Input is a raw string (e.g., Bash command), use as-is — JSON.parse failure is expected here
input = toolInput;
}
}