← Back to Pull requests

feat(responses): reject background=true with 400 not supported #1239

Closed
unknown closed this pull request without merging on Sep 18, 2026 16:38 UTC
View on GitHub
unknown unknown commented on Sep 18, 2026 14:52 UTC
Author

Summary

Praxis does not implement the asynchronous Responses lifecycle (schedule, poll, cancel), so previously forwarding background: true to a native backend could return a 202 the gateway cannot manage, while the Responses→Chat Completions path rejected it — inconsistent behavior. This change rejects background: true uniformly in the openai_responses_format classifier, before routing or upstream contact, with an OpenAI-shaped 400 invalid_request_error ("background mode is not supported"); background: false/null remain supported. It also removes background from stateful mode classification and updates the format/validate filters, example configs, architecture/filter docs, and unit/SDK/integration tests, plus a new background-unsupported inference fixture scenario with synthetic recording.

Related issue

No issue is closed by this change (the background epic tracks implementing the feature). Related: Epic #32 (OpenAI background_jobs).

Closes #

Validation

  • Unit tests — cargo test -p praxis-ai-apis --lib responses (1862 passed)

  • Integration or functional tests — updated openai_responses_format, responses_routing, openai_responses_validate suites; new SDK test test_background_mode_is_rejected_before_inference; inference fixture replay (cargo xtask check-inference)

  • make lint (also make build and make doc)
  • Checklist

  • I reviewed every changed line and can explain the change.

  • New capabilities include an example config and functional example test.

  • User-facing behavior and generated documentation are updated.

  • Performance-sensitive changes include appropriate benchmark or load-test evidence. (N/A — early request rejection, no hot-path impact)

  • Commits are signed and include a Signed-off-by trailer.
  • Breaking changes

    Clients sending background: true to a native Responses route now receive a 400 instead of having the request forwarded to the backend. This aligns behavior with the (already-rejecting) translation path; background: false/omitted are unaffected.

    Diff: 262 lines (+196 / -66) across 3 files Reviewer: franciscojavierarceo Review duration: 105m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 262 lines diff across 3 files
    0.44
    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%
    60%
    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.333
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1239"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 44.3% (MEDIUM) · Higher = larger blast radius
    44.3%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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.5% · Safe to merge
    17.5%