feat(system-prompt): HERMES_INTENT_OVERRIDE narrowing (closes #97, advances #89 Direction A)#98
Merged
Merged
Conversation
…vances #89 Direction A) Operator-supplied intent override (Option A3 from #97). When ``HERMES_INTENT_OVERRIDE=code`` is set, the system prompt's ``stable`` layer narrows for tool-call-heavy traffic — addresses #89's prompt-saturation symptom on mid-tier coding models. ## What narrows under code intent | Block | Action | Why | |---|---|---| | SOUL.md | Skip | Largest single contributor; falls back to short DEFAULT_AGENT_IDENTITY floor | | HERMES_AGENT_HELP_GUIDANCE | Skip | Off-topic for tool-call traffic | | SKILLS_GUIDANCE | Skip | Per-tool block, off-topic for code | | KANBAN_GUIDANCE | Skip | Worker-lifecycle, off-topic for code | | SESSION_SEARCH_GUIDANCE | Skip | Off-topic for code | | skills_prompt (the big one) | Skip | Biggest contributor when many skills loaded | | MEMORY_GUIDANCE | **Keep** | Small + sometimes useful even for code | | TOOL_USE_ENFORCEMENT_GUIDANCE | **Keep** | Critical for tool emission | | Per-model operational guidance | **Keep** | Model-quality-specific | | Env / platform hints | **Keep** | Execution-environment essentials | | nous-subscription + computer-use + alibaba | **Keep** | Operational invariants | | ``context`` + ``volatile`` layers | **Untouched** | Out of scope per #97 | Other intents (``confer`` / ``planning`` / ``exploration`` / ``refinement`` / ``generic``) are recognized as valid but pass through without narrowing in v1 (keeps the door open for per- intent shape later). ## Intent vocabulary Matches devagentic#240's ``intent_classifier`` 6-key enum exactly, so the same operator-side classifier that's wired into devagentic's R5 dispatch hook can also drive hermes-side prompt narrowing without a second vocabulary. ## Doctor probe New ``_check_intent_override_env`` probe surfaces the active override at ``hermes doctor`` time — silent when unset, check_ok when valid (with a narrowing-active note for ``code``), check_warn with the full valid-keys list when typo'd. Mirrors the silent- when-irrelevant pattern from PR #95 / #96. ## Tests - 22 new prompt-narrowing tests in ``tests/agent/test_system_prompt_intent_override.py``: resolver enum + normalization (5), per-section drops under code (7), pass-through for non-code intents (5), typo falls back (1), byte-count regression (1), default-still-includes counter-case (1), case-insensitive (1), runtime-vs-doctor-config sanity (1). - 6 new doctor-probe tests in ``tests/hermes_cli/test_doctor_intent_override_probe.py``: silent-when-unset / silent-when-empty / code-ok-with-narrowing-note / non-code-valid-pass-through / typo-warn-with-valid-sample / case-insensitive. - 258 total green across affected suites (system-prompt + prompt- builder + restore + doctor + provider-env + tools-subset). No regression in the existing prompt-shape pins. ## Composition note Option A1 (port classifier) + A2 (devagentic GraphQL surface) are deferred per the #97 sequencing — A3 unblocks deployment-specific narrowing immediately; A1/A2 only matter when dynamic per-turn classification is needed on the hermes side. The classifier output on the devagentic side (NousResearch#240) drives R5 dispatch decisions there.
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
Closes #97 (Option A3 — operator-supplied intent override). Advances #89 Direction A: when
HERMES_INTENT_OVERRIDE=codeis set, the system prompt'sstablelayer narrows for tool-call-heavy traffic — addresses the prompt-saturation symptom on mid-tier coding models documented in #89.What narrows under
codeintentDEFAULT_AGENT_IDENTITYfloorHERMES_AGENT_HELP_GUIDANCESKILLS_GUIDANCEKANBAN_GUIDANCESESSION_SEARCH_GUIDANCEskills_prompt(the big one)MEMORY_GUIDANCETOOL_USE_ENFORCEMENT_GUIDANCEcontext+volatilelayersOther intents (
confer/planning/exploration/refinement/generic) are recognized as valid but pass through without narrowing in v1 — keeps the door open for per-intent shape later.Intent vocabulary
Matches devagentic#240's
intent_classifier6-key enum exactly, so the same operator-side classifier wired into devagentic's R5 dispatch hook can also drive hermes-side prompt narrowing without a second vocabulary.Doctor probe
New
_check_intent_override_envsurfaces the active override athermes doctor:check_okwhen valid (with a narrowing-active note forcode)check_warnwith the full valid-keys list when typo'dMirrors the silent-when-irrelevant pattern from PR #95 / #96.
Test plan
coding-groq/coding-gpt54empirically emit tool calls with the narrowed prompt (the Research: default Hermes system prompt overwhelms tool-emission on mid-tier coding models #89 symptom)Composition with #89 / #97
classifyIntent) — deferred follow-ups; only matter when dynamic per-turn classification is needed on the hermes side