feat(skills): DS-12 and DS-13 — config override application, batch auto-detection, and context preservation warning#6610
Merged
TimothyZhang7 merged 4 commits intoApr 1, 2026
Conversation
feat: agent skills system and observability improvements
Collaborator
Author
|
@TimothyZhang7 let me know if it works! |
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.
Summary
Implements DS-12, DS-13, and config override application for default skills. Config overrides set in agent definitions (e.g.
checkpoint_every_n: 10,warn_at_usage_ratio: 0.4) were previously parsed and logged but silently discarded — they now take effect at runtime.{{placeholder}}substitution added to SKILL.md bodies; overrides fromdefault_skillsagent config replace default values before the protocol is injected into the system prompthive.batch-ledgerauto-detects batch scenarios from goal/input text at node startup and prepends a ledger-init nudge to the system prompt; configurable viaauto_detect_batchoverridehive.context-preservationmonitors token usage during execution and injects a one-time preservation warning when usage crosseswarn_at_usage_ratio(default 0.45), before the framework's 0.6 prune threshold firesWhat Changed
core/framework/skills/_default_skills/quality-monitor/SKILL.md5with{{assessment_interval}}placeholdercore/framework/skills/_default_skills/error-recovery/SKILL.md3with{{max_retries_per_tool}}placeholdercore/framework/skills/_default_skills/context-preservation/SKILL.mdYou will receive an alert when context reaches {{warn_at_usage_ratio_pct}}% — preserve immediately.core/framework/skills/defaults.py_SKILL_DEFAULTSdict with per-skill default values for all placeholders_apply_overrides()— merges defaults with agent-supplied overrides and substitutes{{key}}in skill body text; handleswarn_at_usage_ratiofloat to percent conversionbuild_protocols_prompt()now calls_apply_overrides()per skill before appending to the combined promptis_batch_scenario(text)— keyword heuristic for DS-12 batch detection (11 keywords: "list of", "for each", "records", "items", etc.)batch_init_nudgeproperty — returns nudge text whenhive.batch-ledgeris active andauto_detect_batchis not Falsecontext_warn_ratioproperty — returnswarn_at_usage_ratiooverride or 0.45 default; returns None whenhive.context-preservationis disabledcore/framework/skills/manager.pySkillsManagerstores a reference toDefaultSkillManagerafter_do_load()batch_init_nudgeandcontext_warn_ratioas passthrough propertiescore/framework/runtime/agent_runtime.pycontext_warn_ratioandbatch_init_nudgefromSkillsManagerafter load; stores as instance attributes and passes toExecutionStreamcore/framework/runtime/execution_stream.pycontext_warn_ratioandbatch_init_nudgethrough toGraphExecutorcore/framework/graph/executor.pyNodeContextcreationcore/framework/graph/node.pydefault_skill_batch_nudge: str | Noneanddefault_skill_warn_ratio: float | NonetoNodeContextcore/framework/graph/event_loop_node.pyctx.default_skill_batch_nudge; runsis_batch_scenario()againstgoal_context + input_data; appends nudge if batch is detected_context_warn_sent = Falseper execution; after each successful LLM turn, checksusage_ratio() >= ctx.default_skill_warn_ratio; injects a user-facingCONTEXT ALERTmessage once and sets the flagcore/tests/test_default_skills.pyTestConfigOverrideSubstitution,TestBatchAutoDetection,TestContextWarnRatioWhy
Agents configured with
assessment_interval: 10orwarn_at_usage_ratio: 0.4expect those values to change agent behavior — previously they were no-ops. Batch auto-detection removes the manual overhead of telling the agent to initialize a ledger every time. Context preservation warnings give the agent advance notice at 45% usage rather than waiting until the framework silently prunes at 60%.How to Test
Run the updated test file:
All 44 tests pass. Full suite regression:
1002 passed, 0 failures.
Out of Scope
checkpoint_every_nis parsed and stored as an override but has no runtime hook yet — it is included in_SKILL_DEFAULTSso it will substitute cleanly into any future SKILL.md placeholder that references it. Iteration and node-completion hook infrastructure (DS-9, DS-10) are tracked separately.solves issue #6365