fix: gateway-sign auto-redacted responses - #992
Conversation
7bce550 to
7567819
Compare
Review:
|
7567819 to
bb50741
Compare
think-in-universe
left a comment
There was a problem hiding this comment.
Found one stream-cancellation cleanup issue.
|
@ironloopai review |
Review · Status🟩 CompletedIronLoop completed the review and posted it to GitHub. ResultRun detailsManual command by think-in-universe · attempt 1 of 3 · completed in 5m 37s |
There was a problem hiding this comment.
Review · Summary
One low-severity performance regression found.
Findings: 🟡 Low 1
Code-specific findings are attached to the diff.
Validation
- ✅ Static inspection — Traced the changed gateway-signature and provider-signature handoff across streaming and non-streaming chat completions.
- ✅ Captured CI — The supplied PR evidence reports passing lint, unit, integration, end-to-end, release-build, and dependency-security checks.
Review details
- Run:
044c4399-c647-4d0e-91d6-29cf250a9284 - Attempts: 1
| ); | ||
| None | ||
| } | ||
| let model_attestation_supported = match app_state.models_service.get_models_with_pricing().await |
There was a problem hiding this comment.
🟡 Low · Avoid cloning the full model catalog on every chat request
This lookup now runs for every chat completion before knowing whether the request streams or actually redacts PII. get_models_with_pricing() deep-clones the cached model list, so ordinary non-streaming requests incur an O(catalog-size) allocation/copy only to discard it. Restrict this lookup to signing-relevant requests or use a cached single-model lookup.
think-in-universe
left a comment
There was a problem hiding this comment.
Approved.
Please resolve the pending comments before merge.
Summary
#892 was reported for streams. The same auto-redact response rewrite exists for non-streaming completions, so this PR fixes both paths.
Testing
cargo test -p api --libcargo test -p services 'completions::' --libcargo test -p api --test e2e_all --no-runFixes #892