feat: preserve safe provider termination metadata - #114
Conversation
ReviewReviewed the middleware, event/storage path, tests, and cross-checked assumptions against the pinned Minor, non-blocking notes:
Test coverage is good — the adapter-level tests exercise real Google/Vertex code paths (not mocks), and the headless e2e asserts both propagation and non-leakage of fixture secrets. Docs in EVENTS.md match the implemented behavior. Reviewed SHA: 206c0e4 |
Code reviewVerdict: Do not merge — 1 blocker(s) must be fixed. · 🔴 1 · 🟠 1 · 🟡 3 · ⚪ 0 · 0/5 resolved
🤖 Fix all 5 open findings with your agent📋 Out-of-diff findings (5)
Reviewed 8 files · 0 inline · view all 5 findings ↗ aictrl · AI code review for fast-moving teams · aictrl.dev |
Review response — PR #114Verified all five findings against the pinned dependencies and actual repository codegen workflow; fixed four and rejected one false API-shape claim. Issues addressed (pushed to this PR)
Validation: 48 focused tests passed. CLI and repository-wide typechecks passed (6 tasks). The actual SDK build ran successfully, and repeated codegen left both canonical and legacy type outputs byte-identical. Prettier and diff checks passed. Pushed normally without verification bypass flags. Review claims verified false (no change needed)
Not addressed hereNone of the verified code findings are deferred. Raw request IDs and diagnostic free text are intentionally unavailable as values under the privacy policy; availability flags remain. Verdict data-layer persistence is unavailable in this session: matched 0, written 0, verified 0, failed 0, unrecorded 5. |
Code reviewVerdict: Looks good — only minor / nit comments below. · 🔴 0 · 🟠 0 · 🟡 1 · ⚪ 2 · 0/3 resolved
🤖 Fix all 3 open findings with your agent📋 Out-of-diff findings (3)
Reviewed 14 files · 0 inline · view all 3 findings ↗ aictrl · AI code review for fast-moving teams · aictrl.dev |
Review response — PR #114Verified and fixed the three new findings from the review of Issues addressed (pushed to this PR)
Validation: 51 focused tests passed. CLI, SDK, and repository-wide typechecks passed (6 tasks). The actual SDK codegen succeeded; a second generation produced byte-identical canonical and legacy type outputs. Prettier and diff checks passed. Pushed normally without verification bypass flags. Review claims verified false (no change needed)None in this review round. Not addressed hereNone in this review round. Data-layer verdict persistence is unavailable: matched 0, written 0, verified 0, failed 0, unrecorded 3. |
c1d173c to
f0cea12
Compare
Review response — PR #114Triage of all 8 aictrl-dev findings from the two completed review rounds. The branch was rebased onto current Issues addressed (pushed to this PR)
Review claims verified false (no change needed)
Not addressed here
Validation at |
Relates to #109
Intent
Normalized provider finish reasons currently lose the safe context needed to distinguish an observed raw reason from an unavailable diagnostic. This change carries bounded termination metadata through the CLI event path without collecting prompt, tool, or full response content.
Expected Impact on Users
Operators and downstream consumers can correlate normalized and available raw termination reasons with provider/model/request identity in
step_finishNDJSON events. Free-form provider diagnostic text remains suppressed by default.Expected Outcomes
Implementation
step_finish.terminationstorage, event serialization, SDK types, and availability/redaction documentation.Scope Caveat
This is the safe first slice of #109. Free-form finish-message text and broader provider coverage remain intentionally out of scope until their privacy and availability policy is approved.
Test Plan
Verification
Risks and Rollout
The new field is optional and additive. Raw chunks remain internal to middleware; no database migration or opt-in is required.