Skip to content

fix: deterministic skill order in the available_skills manifest - #214

Closed
Classic298 wants to merge 1 commit into
devfrom
fix/deterministic-skill-order
Closed

fix: deterministic skill order in the available_skills manifest#214
Classic298 wants to merge 1 commit into
devfrom
fix/deterministic-skill-order

Conversation

@Classic298

Copy link
Copy Markdown
Owner

skill_ids is a set union and set iteration order varies across worker processes (string hash randomization), so on multi-worker or multi-replica installs the <available_skills> block in the system prompt shuffles between requests. That changes the system prompt bytes every turn and silently breaks provider prompt caching for the entire prefix (system prompt, tool definitions and history), so every request pays a full cache write and never gets a cache read. Sort the ids before building the manifest so the prompt is byte-stable across turns and replicas.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.

skill_ids is a set union and set iteration order varies across worker processes (string hash randomization), so on multi-worker or multi-replica installs the <available_skills> block in the system prompt shuffles between requests. That changes the system prompt bytes every turn and silently breaks provider prompt caching for the entire prefix (system prompt, tool definitions and history), so every request pays a full cache write and never gets a cache read. Sort the ids before building the manifest so the prompt is byte-stable across turns and replicas.
@Classic298 Classic298 closed this Jul 30, 2026
@Classic298
Classic298 deleted the fix/deterministic-skill-order branch July 30, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant