perf(prompt): compact the skills guidance preamble, -218 always-on tokens (salvage #72813) [needs wording sign-off] - #77698
Conversation
- Compact the Skill preamble and delegate_task narrative. - Preserve dynamic delegation limits and safety, lifecycle, and inheritance contracts. - Add semantic regression coverage for the retained behavior. Refs NousResearch#72737
|
Code Review: #77698 Verdict: Approve Test: additional coverage. LGTM - Reviewed diff. Changes are sound. |
SummaryTwo PRs address Issue #72737. #72813 compacted both the skills preamble and delegation guidance, while #77698 preserves only the skills-preamble compaction because the delegation portion was superseded by #77372. Related pull requests
Duplicates#72813 and #77698 contain essentially the same skills-preamble compaction and test; #77698 is the focused salvage, while #72813's additional delegation work is not duplicated there and was superseded by #77372. Suggested consolidationKeep #77698 open with a salvage path: obtain the requested maintainer wording sign-off on its focused skills-preamble compaction and contract test. #72813 is already closed in favor of #77698 for that portion, with its delegation portion superseded by #77372, so no reopen or additional duplicate closure is needed. Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 21 kB of PR diffs, 8 kB of issue/PR text, 1 kB of discussion (3 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Context
The skills-guidance preamble (the prose block above <available_skills> instructing the model when/how to load skills) is paid on EVERY session's system prompt, for every user with skills installed — and it had grown to 1,550 chars of overlapping instructions. This compacts it to 678 chars while preserving every behavioral contract the long form carried.
Measured impact
387 → 169 tokens (−218 tokens, −56%) of always-on system-prompt weight for any session with skills, measured on a live build_skills_system_prompt render.
The wording gate (flagging for maintainer sign-off)
This is a REWORDING of tuned behavioral prompt copy, so it can shift model behavior — that's a taste/behavior call, not a mechanical merge. Mitigation shipped with the PR: a disclosure-contract test asserts the compacted string still carries each key behavioral phrase (MUST-load on match, partial-relevance loading, hermes-agent-skill-first rule, patch-when-stale, offer-to-save-after-hard-tasks). If maintainers want the long form back for any single behavior, the test names exactly which phrase anchors it. Requesting explicit sign-off on the wording rather than silent auto-merge — NOT arming auto-merge on this one.
Provenance
Salvage of #72813 by @JeremyDev87 (authorship preserved; attribution mapping merged as #77685). The PR's delegate_tool.py hunks were dropped as superseded — main already rewrote _build_top_level_description to the static duplication-free design this PR was reaching for; what survives is the prompt_builder compaction.
Verification
Closes #72813.