Skip to content

fix(review): parse fenced findings, run the metered model, ship the review image - #762

Merged
atimics merged 2 commits into
mainfrom
fix/review-model-and-image
Oct 23, 2026
Merged

atimics merged 2 commits into
mainfrom
fix/review-model-and-image

Conversation

@atimics

@atimics atimics commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Every automated review since 2026-09-10 ended in review:error with exit code 4. CloudWatch for task_mvkh3yby_ah82dd (#760) shows Codex completed and the model approved the PR, but glm-5.2 does not honor --output-schema through OpenRouter and wrapped its JSON in a ```json fence. jq rejected the file and set -e aborted the review.

  • Parse fenced findings. Strip a leading/trailing Markdown fence when the findings are not already JSON; fail with an explicit message when they still are not.
  • Run the model the Lambda metered. review-entrypoint.sh hardcoded z-ai/glm-5.2 and ignored MODEL, so reviews were reserved at Haiku's 4 credits but ran on glm-5.2. It now reads MODEL (fallback glm-5.2).
  • Valid review model ID. anthropic/claude-haiku-4-5 is not an OpenRouter ID (OpenRouter uses dots). Default is now anthropic/claude-haiku-5.5, whose 1M context matches the shared Codex model_context_window.
  • Ship the review image. deploy.yml never built Dockerfile.review, so github-agent-review:latest has been frozen since 2026-08-29. Closes adr: deploy.yml does not build review agent image — known gap, not a conscious decision #707.

The main task default stays z-ai/glm-5.2, per AGENTS.md.

Test plan

  • cd infra && npm run build && npx jest: 23 suites, 347 tests pass, including new assertions for each change.
  • Ran the new parsing block against the real fenced output from Fix issue #759 #760's review (reads approved), plain JSON, and non-JSON (explicit error).

🤖 Generated with Claude Code

atimics and others added 2 commits October 23, 2026 10:47
The review script hardcoded z-ai/glm-5.2 and ignored the MODEL the Lambda
passes, so reviews were reserved at Haiku's 4 credits but ran on glm-5.2.
Read MODEL, keeping glm-5.2 as the fallback when it is absent.

The Lambda's default anthropic/claude-haiku-4-5 is not an OpenRouter model
ID (OpenRouter uses dotted IDs). Use anthropic/claude-haiku-5.5, whose 1M
context matches the model_context_window in the shared Codex config.

deploy.yml never built Dockerfile.review, so the github-agent-review:latest
image has been frozen since 2026-08-29 (#707). Build and push it on every
deploy alongside the agent image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every automated review since 2026-09-10 ended in review:error with exit
code 4. Codex completed and the model wrote a decision, but glm-5.2 does
not honor --output-schema through OpenRouter and fenced its JSON in
```json. jq rejected the fenced file and set -e aborted the review
(CloudWatch, task_mvkh3yby_ah82dd on #760).

Strip a leading/trailing fence when the findings are not already JSON,
and fail with an explicit message when they still are not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cenetex cenetex Bot added the review:human-required Manual human review is required before merge label Oct 23, 2026
@cenetex

cenetex Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

🛡️ Protected files detected

This PR modifies files that require human review:

  • .github/workflows/deploy.yml

This PR will not be auto-merged and needs manual review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:human-required Manual human review is required before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adr: deploy.yml does not build review agent image — known gap, not a conscious decision

1 participant