Repository navigation
Description
Context & Rationale
95ed4cc (#675), the #656 fix, made repair_json_string parse the whole reply before its fenced blocks. It accepts any non-empty list that whole-text parse returns (ai/response_repair.py:73-81).
json-repair turns bracketed prose into list items. Prose that cites [OWASP A03](https://…) or items[0] before the ```json block, or request.args["id"] after it, therefore comes back as a list such as `[["OWASP A03"], {"findings": [...]}]`. `parse_review_response` (`ai/review_schema.py:1339`) can't read that list and returns None. The persona reply then counts as unparsed, and all of its findings are dropped.
The agent loop takes the same path for every structured output (ai/agents/agent.py:899-905). Each reply below holds the same three findings:
| Reply | 1ad24ac | 07a52ef |
|---|---|---|
| Prose, then a ```json block | 3 findings | 3 findings |
[OWASP A03](https://…) in the prose, then the block |
3 findings | None |
`items[0]` in the prose, then the block |
3 findings | None |
The block, then `request.args["id"]` |
3 findings | None |
The fallback fence pattern (ai/response_repair.py:48) still closes on any line that starts with ```, which #656 asked to anchor. Tool-call extraction uses a separate path and is unaffected. tests/test_batch_2_review_defects.py covers only bare or bracket-free replies, so nothing caught this.
Scope & Deliverables
- Deliverable:
- A reply whose prose contains brackets parses to the same structured output as one without them.
- A fenced block keeps any fences nested in its string values.
- Tests cover each row of the table, nested fences inside a string value, a json block followed by a python example block, and a fenced
write_filetool call.
- Constraint: this is a critical fix: a P0 regression whose introducing commit (95ed4cc, fix(review): remediate response repair, review pipeline and verifier defects (#656, #657, #658, #659, #660, #664) #675, shipped in v0.2.23) is cited, so it joins the current release.
Strategic Alignment
- Milestone: v0.2.24
- Design: none
- Depends on: none
Generated by Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(ai): keep a reply's structured output when its prose contains bra…
dan-petty commentedon Oct 1, 2026
Closed by #802, merged into
release/v0.2.24.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.24 (#905)