refactor(coding-agent): improve settings storage semantics and error handling

This commit is contained in:
Mario Zechner 2026-02-17 00:08:32 +01:00
parent 5133697bc4
commit de2736bad0
7 changed files with 386 additions and 152 deletions

View file

@ -700,6 +700,13 @@ Settings load from two locations and merge:
Project overrides global. Nested objects merge keys. Setters modify global settings by default.
**Persistence and error handling semantics:**
- Settings getters/setters are synchronous for in-memory state.
- Setters enqueue persistence writes asynchronously.
- Call `await settingsManager.flush()` when you need a durability boundary (for example, before process exit or before asserting file contents in tests).
- `SettingsManager` does not print settings I/O errors. Use `settingsManager.drainErrors()` and report them in your app layer.
> See [examples/sdk/10-settings.ts](../examples/sdk/10-settings.ts)
## ResourceLoader