← Back to Pull requests

feat: make conversation canonical in Responses API #410

Closed
unknown closed this pull request without merging on Oct 09, 2026 13:25 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 11:55 UTC
Author

Summary

Makes conversation the canonical field name in the Responses API, replacing conversation_id. Maintains backward compatibility by accepting conversation_id as an input alias via serde field aliasing.

## Changes

- RequestPayload: Changed canonical field from conversation_id to conversation with #[serde(alias = "conversation_id")] for backward compatibility
- ResponsePayload: Changed field from conversation_id to conversation
- OpenAPI schema: Updated to use conversation as the property name
- Error messages: Updated all validation errors to reference conversation instead of conversation_id
- Mutual exclusivity: "provide only one of conversation or previous_response_id"
- Internal references: Updated 29 files across executor, engine, handlers, storage, and tests

## Backward Compatibility

Input: Accepts both conversation (canonical) and conversation_id (alias)
Response: JSON now returns conversation instead of conversation_id

## Test Plan

Unit Tests
- request_payload_accepts_openai_conversation_field - canonical field works
- request_payload_accepts_conversation_id_alias - alias field works
- All request_response tests (36 tests)

Integration Tests
- test_conversation_id_and_previous_response_id_are_rejected_together - mutual exclusivity with updated error message
- test_conversation_replays_plaintext_reasoning_without_opaque_state - conversation history loading
- All stateful_responses_integration tests (26 tests)
- All conversations_test (27 tests)
- conversations_api_cassette_test (10 tests) - OpenAI/gateway parity

Verified Existing Behaviours
- Mutual exclusivity with previous_response_id - implemented in rehydrate.rs:202-206
- Loading conversation history before inference - implemented in rehydrate.rs:392-394
- Appending new input/output items after execution - implemented in modes/conversation.rs:345-357

Breaking Changes

Response parsing only: API responses now return conversation instead of conversation_id
- Clients reading response JSON must update to parse conversation field
- The old conversation_id field no longer exists in response payloads
- Request input remains backward compatible - both field names accepted

Refs #155

Diff: 299 lines (+224 / -75) across 3 files Reviewer: franciscojavierarceo Review duration: 11609m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 299 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%
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.341
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #410"
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: 40% (MEDIUM) · Higher = larger blast radius
40%
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: 15.8% · Safe to merge
15.8%