set up tools for variant statistics view#7235
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb33c7438b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b2ed763. Configure here.
b2ed763 to
a2b2fdd
Compare
`autopilot-tools` depends on `durable-tools` with `ts-bindings` always enabled, so the `ToolMetadata` trait unconditionally requires `llm_params_ts_bundle` / `output_ts_bundle` and friends. Gating the impls behind `#[cfg(feature = "ts-bindings")]` (which refers to `autopilot-tools`'s own feature) caused `E0046` when building the gateway without that feature (e.g. `cargo build -p gateway --features e2e_tests`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The `disallowed-types` clippy lint (added in #7252) bans `SwappableAppStateData` outside of router/gateway construction and the config-apply handler. This handler doesn't need it — it just extracts `AppState`, same as the other internal endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Note
Medium Risk
Adds a new internal HTTP endpoint and cross-database query path (ClickHouse + Postgres) for aggregated variant statistics, including new parameter parsing and query construction that could affect observability/analytics correctness.
Overview
Adds a new
get_variant_statisticscapability end-to-end: an internalGET /internal/variant_statisticsroute, a corresponding AutopilotSimpleTool, and TS bindings for the new request/response shapes.Implements
VariantStatisticsQueriesintensorzero-corewith ClickHouse and Postgres backends (including optionalvariant_namesandafter/beforetime filtering, and ClickHouse-only latency quantiles), wires it throughDelegatingDatabaseConnection, and exposes it via thedurable-toolsTensorZeroClientin both HTTP-gateway and embedded modes (with RFC3339 parsing in embedded mode).Reviewed by Cursor Bugbot for commit 3cb0431. Bugbot is set up for automated code reviews on this repo. Configure here.