ci: harden cto-review.yml severity KeyError (v0.18.3)
QA (seq 43) identified a content-triggered KeyError in the CTO-Review
postprocessor: when a model returns a concerns[] item without a 'severity'
key, line 454 crashed with KeyError instead of degrading.
sev = c[severity].upper() # before — hard KeyError
sev = c.get("severity", "UNKNOWN").upper() # after — degrades gracefully
The JSON schema marks severity as required but the postprocessor does not
enforce it — a model deviating on a large diff (91K bytes for f10e177 vs
41K for 02e9aab) triggered the crash. The fix surfaces UNKNOWN-severity
concerns rather than killing the check.
No other workflow changes.
Agent-Session: prab-v0183-20260612
This commit is contained in:
2
.github/workflows/cto-review.yml
vendored
2
.github/workflows/cto-review.yml
vendored
@@ -451,7 +451,7 @@ jobs:
|
|||||||
if rev.get("concerns"):
|
if rev.get("concerns"):
|
||||||
lines.append("**Concerns:**")
|
lines.append("**Concerns:**")
|
||||||
for c in rev["concerns"]:
|
for c in rev["concerns"]:
|
||||||
sev = c["severity"].upper()
|
sev = c.get("severity", "UNKNOWN").upper()
|
||||||
f = f"`{c['file']}`" if c.get("file") else ""
|
f = f"`{c['file']}`" if c.get("file") else ""
|
||||||
lines.append(f"- **{sev}** {f} — {c['issue']}")
|
lines.append(f"- **{sev}** {f} — {c['issue']}")
|
||||||
lines.append("")
|
lines.append("")
|
||||||
|
|||||||
Reference in New Issue
Block a user