Skip to content

Commit d4e8748

Browse files
committed
docs(changelog): document parse/validate retry fix and tooling changes
The earlier Unreleased entry only covered the Supervisor evaluation loop feature. This adds the companion Fixed and Changed sections for the same PR: - Fixed: spurious first-call INVALID_JSON_RESPONSE failures via the new parseAgentJson extractor and runAgentWithValidation retry wrapper. - Changed: all 4 invokers now route through runAgentWithValidation; FileStore and SQLiteStore accept a storage path via constructor (default unchanged) to unblock integration tests. - Added: note about the first test suite and CI wiring.
1 parent f356fef commit d4e8748

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- `COUNCIL_EVAL_RETRIES` env var — clamped to `[0, 5]`. Set to `0` to restore pre-0.5 advisory-only behaviour. Non-integer values fall back to the default.
1313
- Retry count recorded in `session.metrics.eval_retries`, visible via `get_council_state` and in the result summary footer.
1414
- `supervisor_feedback` field added to `AgentInvokeOptions`; Executor and Aide prompts render a clearly-delimited `--- SUPERVISOR FEEDBACK ---` block when set.
15+
- First test suite for the repo — 160 tests across 15 files covering config, schemas, stores, agent invokers, the feedback formatter, the eval loop, orchestrator routing, and integration tests for FileStore and SQLiteStore against real temp dirs.
16+
- CI now runs `npm test` on every push (new `Test` job in `ci.yml`) and as part of PR validation (`pr-check.yml`).
17+
18+
### Fixed
19+
- **Spurious first-call `INVALID_JSON_RESPONSE` failures** — the claude CLI occasionally emits JSON wrapped in prose ("Here's the output: {...} Let me know!") or produces a single flaky sample (missing field, wrong enum) on the first try. A strict `JSON.parse` + schema check rejected both, surfacing as `INVALID_JSON_RESPONSE` before the Supervisor evaluation loop ever ran. Fixed with two new layers:
20+
- `parseAgentJson` extracts JSON via fence-match → balanced-brace extraction (string-aware, so braces inside JSON string values are not mis-counted) → raw trimmed, returning the first candidate that parses.
21+
- `runAgentWithValidation` wraps `runAgent` + parse + Zod validation with a one-shot retry on parse/validate failure. Transient flakiness recovers silently; CLI transport errors still propagate unchanged.
22+
23+
### Changed
24+
- All 4 agent invokers (Chancellor, Executor, Aide, Supervisor) now route through `runAgentWithValidation` — removes ~80 lines of duplicated fence-match + parse + validate boilerplate. External behaviour is unchanged on success; failures are rarer and still produce the same `CouncilError` code (`INVALID_JSON_RESPONSE` for Chancellor/Executor/Aide, `SUPERVISOR_ERROR` for Supervisor) on final give-up.
25+
- `FileStore` and `SQLiteStore` accept a storage path via constructor argument. Default is still `~/.council/sessions` and `~/.council/council.db` respectively; the parameter exists so integration tests can use temp dirs instead of polluting the user's home directory.
1526

1627
## [0.4.0] - 2026-04-20
1728

0 commit comments

Comments
 (0)