Repository navigation
Align Session input conflicts and tool result target errors - #74
Merged
Merged
Conversation
Every 409 now has type conflict_error, as every observed official conflict does (ERR-27). On events.create, input the Session cannot accept (a result after cancellation, a batch while earlier input is pending) and a changed tool result use code conflict_error (EVT-12, ERR-22). Idempotency-Key reuse and other Core-only conflicts keep their local codes. Tool result targets are resolved after the tenant Session lookup: an unknown call or a call of another, unknown or malformed Turn is 400 invalid_request_error with a fixed message and no writes (EVT-11), while missing and foreign Sessions keep one 404.
The client and Core Web never branched on turn_conflict or idempotency_conflict. Clarify that isSessionDeletionConflict applies only to deleteSession, since input conflicts now share its code, and cover the new fields alongside the codes of earlier Cores.
Add rows CF1-CF9 to the official semantics alignment, register CF in the operation evidence with an updated events.create row, and update the execution tools matrix, the EVT-11/12 deferral note and the contributor error-mapping rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every official 409 we observed uses type
conflict_error, codeconflict_error. Official tool_result admission rejects an unknown call or Turn inside an owned Session with 400invalid_request_error. This batch aligns Core's public input conflicts and tool_result target errors with that. Documented Core-only conflict codes keep their codes, because the Core API may be a superset. The pinned baseline is unchanged (SDK 3.13.0 / d7c41ef /agents=v1).Behavior
conflict_error.events.create: 409 with codeconflict_error. This covers a tool_result after cancellation, input while an input reservation is pending, and a changed result for a completed call.idempotency_conflict);eventsrequest idempotency;environment_input_*states;call_idreturns 400invalid_request_error, "Unknown pending tool call.";turn_idreturns 400 "The tool call belongs to a different Turn.";Evidence
Campaign scan 4 (ERR-22, ERR-27) and scan 2 (EVT-11, EVT-12), all with owned official resources that were deleted. Recorded in
official-semantics-alignment.md,execution-tools.mdandoperation-evidence.md(register CF, row 11).Validation
Live acceptance through real Core, the daemon, native Codex and Kimi K3, with a declared function tool (2 Turns per phase):
call_idinvalid_request_error, pending action unchangedturn_idinvalid_requestinvalid_request_erroridempotency_conflict, typeinvalid_request_errorconflict_error/conflict_errorturn_conflictconflict_error/conflict_errorinvalid_request_errorconflict_error, codeidempotency_conflictThe repository's
official_pending_actions_native.pyalso passed all three rounds (success, error, cancel) on the hosted Runtime with Codex and Kimi K3 (3 Turns). Cleanup and secret scans passed.Real-PostgreSQL test: exact bodies, no-write digests, unchanged Session reads, tenant B, a rolled-back mixed batch. Also API tests pinning every 409 body and the pinned-SDK official-client scripts.
Server gate on this head: all
make checktargets plus Web typecheck, core-doctor, unit tests and build pass. The Playwright browser cases were not run on the server (no Google Chrome; the user approved the skip).make openapiandmake sqlc-generateare byte-identical.Independent blind review by a fresh Claude Code subagent (the user-approved replacement for GPT-6 Astra): no blockers and no isolation leaks. Its three documentation nits are fixed in the last commit.
No full protocol compatibility is claimed.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.