← Back to Pull requests

chore: extract tool OpenAPI schemas into params/openapi.rs #591

Closed
unknown closed this pull request without merging on Nov 30, 2026 05:16 UTC
View on GitHub
unknown unknown commented on Nov 27, 2026 05:09 UTC
Author

Summary

Part of #312. crates/agentic-server-core/src/types/tools/params.rs exceeded the 500-line production limit (537 production lines). Extracted the manual #[cfg(feature = "openapi")] utoipa::PartialSchema and utoipa::ToSchema trait implementations (NonEmptyToolName, ShellEnvironment, ResponsesTool, and CodexNamespaceMember) into params/openapi.rs with no behavior changes, reducing params.rs to 434 production lines (params/openapi.rs is 157 production lines) and removing its baseline and exception entries from .rust-file-sizes.json.

Changes by API

| API | What changed |
| --- | --- |
| Responses API (/v1/responses) | no wire change (internal OpenAPI schema module extraction only) |

New modules


  • crates/agentic-server-core/src/types/tools/params/openapi.rs (157 production lines): holds the manual utoipa::PartialSchema and utoipa::ToSchema implementations for NonEmptyToolName, ShellEnvironment, ResponsesTool (including tagged and code_interpreter_tagged helpers), and CodexNamespaceMember when feature = "openapi" is enabled.
  • classDiagram
        class params_rs["types/tools/params.rs (434 prod lines)"] {
            +NonEmptyToolName
            +ResponsesTool
            +ShellEnvironment
            +CodexNamespaceMember
            +serde Serialize / Deserialize
        }
        class params_openapi_rs["types/tools/params/openapi.rs (157 prod lines)"] {
            <<cfg(feature = "openapi")>>
            +impl PartialSchema / ToSchema for NonEmptyToolName
            +impl PartialSchema / ToSchema for ShellEnvironment
            +impl PartialSchema / ToSchema for ResponsesTool
            +impl PartialSchema / ToSchema for CodexNamespaceMember
        }
        params_rs --> params_openapi_rs : #[cfg(feature = "openapi")] mod openapi
    

    Test Plan

  • cargo fmt --all -- --check: passed.

  • cargo clippy --workspace --all-targets -- -D warnings: passed.

  • cargo clippy -p agentic-server-core --all-targets --features openapi -- -D warnings: passed.

  • cargo test -p agentic-server-core --features openapi --lib types::tools: passed (all tool parameter round-trip, OpenAPI schema, and validation tests unchanged).

  • pre-commit run rust-file-sizes --all-files & uv run scripts/check_rust_file_sizes.py --report: passed (params.rs: 434 production lines; params/openapi.rs: 157 production lines; baseline and exception entries removed).
  • AI assistance was used to prepare this change; I reviewed the diff and ran the checks above.

    Diff: 309 lines (+231 / -78) across 3 files Reviewer: franciscojavierarceo Review duration: 4326m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 309 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #591"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.4% · Safe to merge
    17.4%