AltimateAI / AltimateAI/altimate-code

config: harden config-load failure handling after Zod→Effect Schema migration

Offen
#995 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
811
Forks
134
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
50

Beschreibung

Found during v0.9.1 release review (Chaos-Gremlin + others). Two inconsistent, risky failure modes when a pre-existing config trips the new strict Effect Schema (`topLevelExtraKeys` throws on any unrecognized top-level key):

- **Global config** (`packages/opencode/src/config/config.ts:~389`): `loadGlobal().pipe(Effect.orElseSucceed(() => ({})))` — a parse failure silently resets the ENTIRE global config (providers, models, permissions, agents, MCP) to `{}`, with only an `Effect.logError` most users never see. Silent config loss on upgrade.
- **Project-local config** (`config.ts:~757`): `loadInstanceState(...).pipe(Effect.orDie)` — hard crash on a stale/removed top-level key, killing session start in that directory.

Fix: (1) surface a user-visible warning when global config falls back to defaults; (2) reconcile the asymmetry so both name the offending key and fail gracefully (ignore only the malformed source, don't nuke all config or crash). Low probability (fork shipped 0.9.0-beta.2 on this code) but high impact when it fires.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.