Skip to content

feat: execution-discipline guidance now reaches DeepSeek/Kimi/Qwen-class models (Composio eval findings) - #90335

Merged
teknium1 merged 1 commit into
mainfrom
feat/execution-discipline-all-models
Aug 19, 2026
Merged

feat: execution-discipline guidance now reaches DeepSeek/Kimi/Qwen-class models (Composio eval findings)#90335
teknium1 merged 1 commit into
mainfrom
feat/execution-discipline-all-models

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Execution-discipline guidance now reaches every major tool-capable model family — previously only models whose name contained gpt/codex/grok received OPENAI_MODEL_EXECUTION_GUIDANCE, so DeepSeek/Kimi/Qwen/GLM/MiMo/MiniMax/Mistral sessions ran with zero verification/computation pressure in the system prompt.

Root cause of a measurable share of Composio's published eval failures (Hard-30, DeepSeek V4 + Kimi K3 campaigns): trace analysis showed Hermes doing financial rule-math in prose, skipping read-back after external writes, "repairing" malformed identifiers, and finalizing despite count mismatches — exactly the failure modes this block addresses, on models that weren't getting it.

Changes

  • agent/prompt_builder.py: EXECUTION_GUIDANCE_MODELS auto-list (gpt, codex, grok + deepseek, kimi, qwen, glm, minimax, mimo, mistral); block extended with 5 clauses distilled from winning-harness research: external-write read-back (with a don't-re-verify-internal-edits counterweight), count reconciliation on declared totals/has_more, literal preservation (lookup success ≠ valid malformed token), retry-differently on suspiciously-narrow results, completion-gated-on-verification.
  • agent/system_prompt.py: guidance gets its own injection gate (auto/true/false/list via agent.execution_guidance), no longer nested under tool-use enforcement.
  • tools/todo_tool.py: description adds enumeration-as-checklist for "all N items" tasks + "completed only after verification, never intent".
  • Config default + docs (configuration.md), tests (injection matrix, model-list contracts, byte-stability).

Validation

Before After
deepseek/kimi system prompt no execution discipline full block injected
gpt/grok required tool-enforcement on independent gate (still suppressible)
claude/gemini excluded excluded (unchanged)
prompt byte-stability across rebuilds verified E2E (real build_system_prompt, temp HERMES_HOME)

Targeted tests: 104 passed (1 pre-existing cross-file flake on main, unrelated — test_build_system_prompt_records_stable_prefix fails identically on origin/main). E2E injection matrix verified with real AIAgent construction.

Prior contributor work credited (same direction, narrower scope): #20588 @Mat-London, #35087 @intelac, #41874 @6ylqq, #53847 @tauros1983 — co-authored.

Infographic

execution discipline infographic

…ls (config model.execution_guidance)

Un-fences OPENAI_MODEL_EXECUTION_GUIDANCE from the gpt/codex/grok substring
check and gives it its own injection gate, independent of
tool_use_enforcement, controlled by config.yaml `agent.execution_guidance`
(auto/true/false/list — same semantics as tool_use_enforcement). The "auto"
list (EXECUTION_GUIDANCE_MODELS) now also covers deepseek, kimi, qwen, glm,
minimax, mimo, and mistral.

Composio agentic-eval traces showed Hermes+DeepSeek/Kimi failing where
competitors passed: financial math done in prose, no read-back after
external writes, malformed identifiers "repaired", completeness claimed
despite count mismatches. The discipline block existed but those models
never received it.

The block is extended with compact clauses distilled from that analysis:
- external-write read-back (tool-call success is not task success; internal
  file edits already confirmed by the tool are not re-verified)
- count reconciliation (declared totals/has_more are hard assertions)
- literal preservation (never normalize identifiers that fail a stated
  format; lookup success does not validate a malformed token)
- retry-differently (empty/partial/suspiciously narrow results get a
  broader retry before concluding)
- completion gated on verification (done = every named acceptance
  criterion verified, never a plausible subset)

The todo tool description now encourages enumeration-as-checklist for
"all N items" tasks and gates completed status on verified work, never
intent.

Guidance is chosen once at session start keyed on model name, so the
system prompt stays byte-stable for the life of a conversation.

Supersedes/absorbs prior contributor proposals: #20588, #35087, #41874
(MiMo), #53847 (GLM tool-calls-as-text stall).

Co-authored-by: Mat-London <56627804+Mat-London@users.noreply.github.com>
Co-authored-by: intelac <8803887+intelac@users.noreply.github.com>
Co-authored-by: 6ylqq <51219463+6ylqq@users.noreply.github.com>
Co-authored-by: tauros1983 <267660491+tauros1983@users.noreply.github.com>
@alt-glitch alt-glitch added type/feature New feature or request P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/config Config system, migrations, profiles sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 6cb5a86 — feat: execution-discipline guidance now reaches all tool-cap

⚠️ Warnings

CI timings · View report · View job

Wall time 13m58s vs 3m31s (+297.2%). 10 job(s) slower, 13 faster, 2 unchanged.

  • Python tests / Run tests slice 4/12: +48.0s
  • Python tests / Run tests slice 12/12: +46.0s
  • Python tests / Run tests slice 11/12: +38.0s
  • Python tests / Run tests slice 2/12: +27.0s
  • OS-specific tests / Windows-only tests: -20.0s

OSV vulnerability scan · View job

7 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants