Repository navigation
fix(google): surface blocked prompts and preserve usage accounting - #116756
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 7:09 AM ET / 11:09 UTC. ClawSweeper reviewWhat this changesThe PR makes Gemini and Vertex prompt-safety blocks return typed errors and retains observed token usage and calculated cost when the provider rejects a prompt before producing a candidate. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep this PR open for human review. The patch has no concrete correctness finding from the supplied diff, but it still lacks inspectable after-fix evidence from a real blocked Google or Vertex request; its protected Priority: P2 Review scores
Verification
How this fits togetherGoogle provider requests enter either the bundled Google transport or the shared AI lifecycle, which convert streamed provider chunks into an assistant result. Prompt feedback and usage metadata must survive that conversion so callers receive a visible failure and accurate accounting. flowchart LR
A[Google or Vertex request] --> B[Streaming provider response]
B --> C[Prompt feedback and usage metadata]
C --> D[Google transport or shared lifecycle]
D --> E[Assistant result]
E --> F[Visible typed error]
E --> G[Usage and cost accounting]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +24, Tests +115. Total +139 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add a redacted terminal capture, runtime log, or linked live-output artifact showing a real Google or Vertex blocked prompt produces the typed error and retains usage/cost, then complete maintainer review of the exact head. Do we have a high-confidence way to reproduce the issue? No live current-main reproduction was provided, but the source-level path is clear: a streamed Google or Vertex response with Is this the best way to solve the issue? Yes, provisionally. Handling the condition at the shared lifecycle and direct transport boundaries addresses both provider paths while preserving the usage metadata observed in the same streamed chunk. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 718e9c882047. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
9299d92 to
5d54a36
Compare
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
Summary
PROMPT_BLOCKEDerror when Gemini returns prompt safety feedback without a response candidate or explicit block reason.Verification
Root causes fixed
1 canonical blocked-response lifecycle defect affecting Google and Vertex transports.