AltimateAI / AltimateAI/altimate-code

Config parser crashes on malformed JSON instead of recovering gracefully

オープン
#56 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
811
フォーク
134
平均マージ
3日 2時間
マージ済み PR(30日)
50

説明

## Bug

When the config file (`~/.config/altimate-code/altimate-code.json`) contains malformed JSON, `altimate-code` crashes with a raw JSONC parse error instead of recovering gracefully.

## Steps to Reproduce

1. Have a malformed config file at `~/.config/altimate-code/altimate-code.json`:
```json
{
"$schema": "https://altimate-code.dev/config.json",
"mcp": {
}
}
}
}
```
2. Run `altimate-code -s ses_...`
3. Get a crash:
```
Error: Config file at /Users/surya/.config/altimate-code/altimate-code.json is not valid JSON(C):
--- JSONC Input ---
...
--- Errors ---
EndOfFileExpected at line 6, column 3
```

## Expected Behavior

- Warn the user about the invalid config and fall back to defaults, OR
- Provide a clear, actionable error message (e.g., "Your config file has a syntax error on line 6. Fix it or delete it to use defaults.")

## Context

This can happen when a user partially edits their config (e.g., removes an MCP server entry but leaves behind extra closing braces). The current error dump with `--- JSONC Input ---` / `--- Errors ---` formatting is developer-facing, not user-facing.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。