Skip to content

fix(providers): redact the host context in CatalogLimitsRequest Debug - #145

Merged
senamakel merged 2 commits into
mainfrom
catalog-limits-debug-redaction
Nov 3, 2026
Merged

senamakel merged 2 commits into
mainfrom
catalog-limits-debug-redaction

Conversation

@senamakel

Copy link
Copy Markdown
Member

Follow-up to #144, which merged before this fix was pushed. It addresses the two review threads there (Codex P1, CodeRabbit).

Cause: CatalogLimitsRequest<Ctx> derived Debug, so formatting it printed the host context with the host's own Debug, including any API key or session token in it. The sibling request types (CatalogRequest, EmbeddingRequest, ReadinessRequest, ChatModelRequest) already print the context as <host context>.

Fix: a hand-written Debug that prints model and redacts context, matching the siblings.

Regression test: catalog_limits_request_debug_redacts_the_host_context in tests/provider_overrides.rs. It failed before the fix and passes after.

Public API: Debug output of CatalogLimitsRequest changes. Nothing else.

Validation: cargo fmt --all -- --check ok; cargo clippy --all-targets --all-features -- -D warnings ok; cargo test -p tinyinference-llm --test provider_overrides: 4 passed.

senamakel and others added 2 commits November 3, 2026 15:38
…tput

Add a test asserting that formatting a catalog limits request for debugging keeps the model name but replaces the host context with a placeholder, so secrets are not leaked into logs.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
… output

Replace the derived Debug implementation on CatalogLimitsRequest with a
manual one that prints the model name but masks the host context, so
debug logging no longer leaks caller-supplied context values.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

Or wait 51 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2aa07044-9958-4dc7-bbc6-3674ed6bf63f
Commits

Reviewing files that changed from the base of the PR and between 569e2ef and 8123856.

Files selected for processing: 2
  • crates/tinyinference-llm/src/providers/overrides.rs
  • crates/tinyinference-llm/tests/provider_overrides.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@tinysweeper

tinysweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 8123856a2279b361f41bd3739ab2104182153ea5

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 2 of 2 files.
Pull request purpose (title): fix(providers): reda…

Diagnostics and supporting details

Full summary

Pull request purpose (title): fix(providers): redact the host context in CatalogLimitsRequest Debug. This pull request, titled "fix(providers): redact the host context in CatalogLimitsRequest Debug", is a follow-up to a prior change that merged before this fix was pushed, and it addresses two review threads from that work. Its stated purpose is to stop `CatalogLimitsRequest<Ctx>` from printing the host context via a derived `Debug`, which could expose an API key or session token held in that context. The PR replaces the derive with a hand-written `Debug` that prints `model` and a fixed `<host context>` placeholder, matching the existing behavior of the sibling request types, and adds a regression test in the integration test file. The only intended public API change is the `Debug` output of `CatalogLimitsRequest`. No trusted base-to-head diff was available, so the latest push delta is unavailable and nothing is characterized as a push delta.

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

`CatalogLimitsRequest<Ctx>` in `crates/tinyinference-llm/src/providers/overrides.rs` no longer derives `Debug`; a manual `std::fmt::Debug` impl prints the `model` field and renders `context` as the literal `"<host context>"`, so a host context containing credentials is not emitted by `{:?}`. Because the impl no longer requires `Ctx: Debug`, `Debug` becomes available for more `Ctx` types, which the critique and tests lanes characterize as a relaxation rather than a break. The description lane notes this mirrors the four sibling request types. A new integration test, `catalog_limits_request_debug_redacts_the_host_context` in `crates/tinyinference-llm/tests/provider_overrides.rs`, builds a request with a synthetic secret in `context` and asserts the model is printed, the placeholder is printed, and the secret is absent.

Features

  • Modified — Redacting Debug implementation for CatalogLimitsRequest: Formatting a `CatalogLimitsRequest` with `{:?}` now prints the model name and substitutes `<host context>` for the context value, so credentials held in the host context can no longer leak through debug output. Dropping the derived `Ctx: Debug` bound only widens which context types can be formatted. The observable public API change is the `Debug` output of `CatalogLimitsRequest`. (crates/tinyinference-llm/src/providers/overrides.rs)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The critique lane (answered, no findings) reports that the manual impl mirrors the existing `CatalogRequest` impl and that removing the `Ctx: Debug` bound is a relaxation rather than a break; the fixture secret in the test is an assertion of redaction, not a defect. The lane notes the code index is behind this pull request.
  • Lane summary: The change replaces the derived `Debug` on `CatalogLimitsRequest<Ctx>` with a manual impl that prints the model and a fixed `"<host context>"` placeholder, mirroring the existing `CatalogRequest` impl, and adds an integration test asserting the secret is not printed. The manual impl also removes the previous `Ctx: Debug` bound, which is a relaxation, not a break. The test's `context: "sk-live-secret"` is a fixture asserting redaction, so it is not a finding. No defects found. _The code index is behind this pull request (indexed at `e283e7fd1d3b`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane (answered, no findings) reports that the host context is redacted from `Debug` output, that no untrusted input reaches a sink, and that removing the derive bound only makes `Debug` available for more `Ctx` types with no behavioral regression. The lane notes the code index is behind this pull request.
  • Lane summary: The change replaces a derived `Debug` on `CatalogLimitsRequest` with a manual implementation that prints the model name but redacts the host context, and adds an integration test asserting the synthetic secret in `context` never appears in the output. No untrusted input reaches a sink, no behaviour regresses (the removed derive bound only makes `Debug` available for more `Ctx` types), and no repository rule is broken. _The code index is behind this pull request (indexed at `e283e7fd1d3b`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane (answered, no findings) reports that the new test asserts the model, the placeholder, and the absence of the secret, so it fails if the redaction regresses, and that the existing callers are unaffected. The lane notes the code index is behind this pull request.
  • Lane summary: The change replaces a derived `Debug` on `CatalogLimitsRequest<Ctx>` with a hand-written one that prints the model and a fixed `<host context>` placeholder, so a host context holding credentials can no longer leak through `{:?}`. The new test in `tests/provider_overrides.rs` pins exactly that: it asserts the model is printed, the placeholder is printed, and the secret string is absent, so it fails if the redaction regresses. The `Ctx` bound is dropped, which only widens applicability, and the existing callers at lines 153 and 276 are unaffected. No defects found. _The code index is behind this pull request (indexed at `e283e7fd1d3b`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane (answered, no findings) reports no sensitive content in committed files. The lane notes the code index is behind this pull request.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `e283e7fd1d3b`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane (answered, no findings) reports that the stated fix and regression test match the diff exactly and that the test is placed in `tests/` as repository rules require. The lane notes the code index is behind this pull request.
  • Lane summary: The change replaces the derived `Debug` on `CatalogLimitsRequest` with a hand-written impl that prints `model` and redacts `context` as `<host context>`, matching the four sibling request types, and adds a regression test in the integration test file. The description matches the diff exactly, and the test is placed in `tests/` as the repository rules require. No defects found. _The code index is behind this pull request (indexed at `e283e7fd1d3b`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.001753
  • Tokens: 106868 input · 7221 output · 29184 cached · 98 embedding
  • Updated: 2026-11-03T15:40:45Z
Head State Pass summary
8123856a2279 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-03T15:40:45Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T15:41:09.759277Z 8123856 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0018

@senamakel
senamakel merged commit eed817b into main Nov 3, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant