feat: make conversation canonical in Responses API #410
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
franciscojavierarceo
Summary
Makes
conversationthe canonical field name in the Responses API, replacingconversation_id. Maintains backward compatibility by acceptingconversation_idas an input alias via serde field aliasing.## Changes
- RequestPayload: Changed canonical field from
conversation_idtoconversationwith#[serde(alias = "conversation_id")]for backward compatibility- ResponsePayload: Changed field from
conversation_idtoconversation- OpenAPI schema: Updated to use
conversationas the property name- Error messages: Updated all validation errors to reference
conversationinstead ofconversation_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) andconversation_id(alias)Response: JSON now returns
conversationinstead ofconversation_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
conversationinstead ofconversation_id- Clients reading response JSON must update to parse
conversationfield- The old
conversation_idfield no longer exists in response payloads- Request input remains backward compatible - both field names accepted
Refs #155