mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2875] [CLOSED] serve: "skills_compact" (opt-in) keeps opencode's skill list to names and first sentences #4308
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4308
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2875
Author: @zsariboga
Created: 10/17/2026
Status: ❌ Closed
Base:
main← Head:pr-skills-compact📝 Commits (1)
0a85dd0serve: "skills_compact" (opt-in) keeps opencode's skill list to names and first sentences (system message 21,651 -> 16,259 tokens)📊 Changes
4 files changed (+125 additions, -2 deletions)
View changed files
📝
docs/DETAILS.md(+7 -0)📝
serve/frontend.py(+39 -2)📝
serve/server.py(+4 -0)➕
serve/test_skills_compact.py(+75 -0)📄 Description
What it changes
opencode lists every installed skill in its system message, inside
<available_skills>, with the whole description andthe file location of each. With 58 skills installed that list was ~32K characters, ~43% of the system message. The
skill tool loads a skill by name with its full text, so the list only has to tell the skills apart.
With
"skills_compact": truein the config,openai_to_messagesandanthropic_to_messagesrewrite that block beforethe template sees it: each
<description>keeps its first sentence (at most 160 characters, cut at a word with...when there is no sentence end in reach), and each
<location>line is dropped. Every skill's<name>stays. It runsnext to
env_to_user(same place, same shape), and it is deterministic, so the prefix cache keeps working.What it leaves alone
false, the messages are untouched (a test checks the text is identical).<available_skills>and</available_skills>; a prompt without thatblock is unchanged.
Measured
A captured opencode 1.18.7 request (build agent, 58 skills, 15 tools), counted with the model's tokenizer: system
message 21,651 -> 16,259 tokens (-5,392, -25%). On an RTX 5070 Ti Laptop (12 GB) with Swift 1.5 IQ3_XXS that is about
3 s less to read for every session whose system prompt the prefix cache does not already hold. Every skill name is
kept. On by default in our fork's config since 2026-10-13.
How it was checked
serve/test_skills_compact.py(6 tests): off changes nothing; first sentence kept, location dropped, names kept,text around the block kept; a long sentence is cut at a word; the same list gives the same text; no block, no
change; the Anthropic path too.
serve.test_skills_compact,serve.test_env_to_user,serve.test_frontend: 37 tests OK.docs/DETAILS.md: one entry next toenv_to_user.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.