feat: add atomic agent turn admission - #15
Conversation
| if request.previous_response_id.is_some() == request.conversation.is_some() { return Err(ApiError::BadRequest("conversation is required only without previous_response_id".into())); } | ||
| if let Some(conversation) = &mut request.conversation { | ||
| if !conversation.metadata.is_object() { return Err(ApiError::BadRequest("metadata must be a JSON object".into())); } | ||
| conversation.title = Some(normalize_title(conversation.title.as_deref())?); |
There was a problem hiding this comment.
The idempotency lookup is not serialized before this transaction starts mutating state. Two simultaneous requests with the same (tenant, owner, client, idempotency_key) can both see no row and proceed; one will later lose on the unique constraint and return a database error instead of the required replay result. Please acquire an advisory transaction lock keyed by that idempotency tuple (as start_turn does) before the lookup, or otherwise handle the unique-conflict by loading and validating the stored result.
|
Maintenance follow-up: PR review routing is deferred. The current head has two completed failing |
|
Maintenance follow-up: review routing is deferred because both completed |
|
Maintenance follow-up: the current head has two failed |
|
Follow-up: the two latest |
|
Maintenance follow-up: the current head has two completed |
|
Follow-up: both completed |
|
Maintenance check: current head |
|
Maintenance follow-up: this PR is not ready for review routing: both |
|
Follow-up: PR is not ready for review routing: both required |
|
Maintenance follow-up: review routing is deferred because the completed |
|
Maintenance follow-up: this PR is not eligible for review routing yet. Both |
|
Maintenance follow-up: PR is not ready for review routing. Both completed |
|
Maintenance follow-up: not eligible for review routing yet—both |
|
Hourly maintenance: review routing deferred. The current head has two completed failing |
|
Maintenance follow-up: this PR is not ready for review routing: both completed |
|
Maintenance follow-up: the current head |
|
Hourly maintenance: not routed for review. Both |
|
Maintenance follow-up: the current head |
|
Maintenance follow-up: head |
|
Hourly maintenance check: PR is not ready for review routing. Both |
Summary
POST /v1/agent-turnsfor transactional agent response admissionValidation
git diff --checkCloses #4