Pull requests / #2875

#2875 serve: "skills_compact" (opt-in) keeps opencode's skill list to names and first sentences

open · @zsariboga · 0 comentarios · En GitHub

Setup & installServer & APINVIDIA / CUDAModels & quantsDocumentation

Descripción

## What it changes

opencode lists every installed skill in its system message, inside `<available_skills>`, with the whole description and
the 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": true` in the config, `openai_to_messages` and `anthropic_to_messages` rewrite that block before
the 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 runs
next to `env_to_user` (same place, same shape), and it is deterministic, so the prefix cache keeps working.

## What it leaves alone

- Off by default: with the key absent or `false`, the messages are untouched (a test checks the text is identical).
- Only the first system message, only between `<available_skills>` and `</available_skills>`; a prompt without that
  block is unchanged.
- No engine change.

## 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 to `env_to_user`.

En el sitio

Enlaces a install, modelos, releases.