Repository navigation
Implement PHP Server's sticky execution contract on native (#1017 part 1) - #1140
Merged
Merged
Conversation
Native advertised sticky_execution unsupported, ignored every completion's sticky_cache claim and told each claim to expect a cold replay (#1017, part 1). It now follows published PHP Server 2.11.8 and Core 2.15.12: - A completion's sticky_cache needs protocol 1.18, a registration listing and supporting sticky_execution, and the exact worker, run, workflow and build; otherwise 409 as PHP answers. An accepted claim records the run's sticky worker until the claim's TTL, cleared when the run closes, and keeps the worker's reported cache metrics. - Each workflow claim records and returns sticky_worker_id, sticky_until and sticky_replay_mode (sticky_hit_expected, forced_cold_replay or cold_replay). Routing and full history delivery are unchanged, as in PHP. - Re-registering a worker process clears its runs' affinity. - The server capability is Core's StickyExecution::describe(), and operator metrics report real affinity and last-minute replay counts. No schema change: the frozen PHP schema already has these columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
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.



Part 1 of #1017 (PHP parity). Part 2, the history suffix that actually cuts transfer, follows behind the
sticky_history_suffixcapability (wire shape on #1017; sdk-php owns the SDK half).Change
Native now follows published PHP Server 2.11.8 / Core 2.15.12 sticky execution:
sticky_cacheneeds protocol ≥ 1.18, a registration that lists and supportssticky_execution, and the exact worker/run/workflow/build (build falls back to the registration's SDK version). Otherwise 409portable_worker_affinity_protocol_floor_unavailable,worker_capability_not_supportedorsticky_cache_identity_mismatch, as PHP answers. An accepted claim setsworkflow_runs.sticky_worker_id/sticky_until(TTL from the claim; cleared when the run closes) and stores the worker's cache metrics.sticky_worker_id,sticky_untilandsticky_replay_mode(sticky_hit_expected/forced_cold_replay/cold_replay) by Core's rule. Routing and full-history delivery are unchanged, exactly as PHP. The mode is derived from the run's affinity in the existing leaseUPDATE, so claims gain no statement.server_capabilities.sticky_executionis Core'sStickyExecution::describe()(wasfalse). Operator metrics report real active/ready/leased counts and last-minute hit/forced/cold counts.Behavior change to note
A completion carrying
sticky_cachefrom a worker whose registration doesn't supportsticky_executionis now refused (409), as PHP does; native used to ignore the field. sdk-python and sdk-php register the capability before sending claims. sdk-python refused to enable its sticky cache against native because native advertised no support; it now can.Checks
tests/execution/sticky_execution.rs: cold first claim, identity-mismatch 409,sticky_hit_expectedfor the sticky worker with full history still delivered,forced_cold_replayfor another worker and after TTL expiry, metrics counts, affinity cleared on re-registration.continuationstest updated to register the capability it claims.cargo test --lib481 passed (plus a unit test for the claim rule); full--test executionpasses. CI runs MySQL/MariaDB/PostgreSQL.🤖 Generated with Claude Code