Skip to content

feat(curator): support reasoning effort override - #50416

Open
kortylokai-web wants to merge 1 commit into
NousResearch:mainfrom
kortylokai-web:feature/curator-reasoning-effort
Open

feat(curator): support reasoning effort override#50416
kortylokai-web wants to merge 1 commit into
NousResearch:mainfrom
kortylokai-web:feature/curator-reasoning-effort

Conversation

@kortylokai-web

@kortylokai-web kortylokai-web commented Jun 21, 2026

Copy link
Copy Markdown

What does this PR do?

Adds a curator-specific reasoning_effort override for the LLM consolidation/review fork, using Hermes' normalized reasoning configuration instead of provider-specific request-body hacks.

This lets users keep ordinary chat at one reasoning level while giving curator consolidation a different level, or explicitly disable curator reasoning with none.

Behavior

Reasoning precedence for the curator review fork is:

  1. valid, non-empty auxiliary.curator.reasoning_effort
  2. deprecated curator.auxiliary.reasoning_effort when the canonical key is absent or empty
  3. the selected curator model's agent.reasoning_overrides entry
  4. valid agent.reasoning_effort
  5. provider or transport default

Additional semantics:

  • none and YAML false explicitly disable reasoning and stop fallback.
  • Invalid canonical values warn once, skip deprecated legacy config, and fall back through model-aware agent defaults.
  • Legacy deprecation notices are emitted once even when provider resolution rewrites the selected model.
  • The final provider-resolved model is used for model-aware fallback.
  • Reasoning still reaches the fork when provider resolution falls back or fails.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests
  • ♻️ Refactor

Changes Made

  • agent/curator.py
    • Resolves canonical, legacy, model-specific, and global reasoning settings with explicit precedence.
    • Carries normalized reasoning through _ReviewRuntimeBinding alongside the existing provider, model, credential, and request overrides.
    • Re-resolves model-aware fallback only when provider resolution changes the selected model, without duplicating warnings.
    • Passes reasoning_config into the forked AIAgent without disturbing credential pools, ACP settings, or output caps.
  • hermes_constants.py
    • Adds a backward-compatible keyword-only switch for suppressing duplicate invalid-value warnings during the second resolution pass.
  • Configuration
    • Uses the auxiliary.curator.reasoning_effort schema default already present on current main.
    • Keeps config version 33; the default arrives through load_config() deep merge without migration or user-YAML rewrites.
  • Tests
    • Covers canonical and legacy precedence, selected-model overrides, provider-rewritten models, global fallback, none, YAML false, invalid values, exact-once logging, runtime binding, constructor plumbing, provider-resolution failure, schema defaults, and no-write config loading.
  • Docs and example
    • Documents inheritance, model-aware overrides, explicit disable behavior, consolidation requirements, and deprecated fallback in English and zh-Hans.

How to Test

Candidate head: 1a2276ae649298771b5a0c8aa3aa9609b77d341b

scripts/run_tests.sh -j 8 \
  tests/agent/test_curator.py \
  tests/agent/test_curator_classification.py \
  tests/hermes_cli/test_aux_config.py \
  tests/hermes_cli/test_config.py \
  tests/cron/test_reasoning_config_per_model.py \
  tests/gateway/test_reasoning_config_per_model.py \
  tests/tui_gateway/test_reasoning_config_per_model.py \
  tests/run_agent/test_fallback_reasoning_override.py -q

Result:

144 passed, 0 failed (8 workers)

Additional verification:

uv run ruff check .: passed
git diff --check upstream/main..HEAD: passed
Spec-compliance review: passed
Code-quality review: passed
Official upstream/main at final rebase: f88ed6c71768cdc7ea3bfa8cf62d16654792fd2a

The full Python suite was run with the exact locked CI dependency set and an 8-worker cap:

23,750 passed, 13 failed; one unrelated file passed on retry

All 13 failures reproduced exactly on pristine f88ed6c7 in the same environment (72 passed, 13 failed across the seven failing files). They are pre-existing host-state/timing failures outside this PR's files.

Scope

The refreshed PR is one commit on upstream/main (f88ed6c7), touching 8 feature files (+469/-14). It ports the original intent onto the current curator runtime architecture without replaying obsolete migration machinery or restoring tests pruned from current main.

Checklist

Code

  • Read the contributing guidance
  • Conventional commit message
  • Feature-only scope
  • Tests added for behavior, model-aware fallback, exact-once logging, and no-write config loading
  • Full repository suite run with at most 8 workers; all failures reproduced on pristine upstream

Documentation & Housekeeping

  • Relevant documentation updated
  • cli-config.yaml.example updated
  • Cross-platform impact checked
  • No tool schema changes required

Screenshots / Logs

Not applicable; this changes curator/config behavior and documentation, not UI.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Jun 21, 2026
@kortylokai-web
kortylokai-web marked this pull request as ready for review June 21, 2026 20:53
@kortylokai-web
kortylokai-web force-pushed the feature/curator-reasoning-effort branch from 533124a to 92f8638 Compare July 13, 2026 01:53

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for routing the setting through Hermes' normalized reasoning_config mechanism. Current main's curator fork has no curator-specific reasoning resolver or AIAgent plumbing (agent/curator.py:1758-1803, agent/curator.py:1875-1934), so this remains a valid addition.

Problems

  • hermes_cli/config.py:3304 bumps _config_version for a default-only key. AGENTS.md:584-590 says new keys in an existing section are supplied by the deep merge and do not require a version bump. As written, migrate_config() persists a version-only rewrite (hermes_cli/config.py:6197-6200) even though load_config() already merges the new default (hermes_cli/config.py:6953-6967).

Suggested changes

  • Retain version 33 and adjust the lean-config test to verify the default through load_config() without invoking a version migration.

Automated hermes-sweeper review.

Comment thread hermes_cli/config.py Outdated
@@ -3303,7 +3304,7 @@ def _ensure_hermes_home_managed(home: Path):
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not bump _config_version for this default-only field. load_config() deep-merges new keys from DEFAULT_CONFIG, while the version bump makes migrate_config() persist a version-only rewrite. AGENTS.md:584-590 reserves bumps for active config transformations.

@kortylokai-web kortylokai-web Jul 15, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in c71716a68: rebased onto current upstream/main, retained config version 33, removed the redundant hermes_cli/config.py diff, and replaced the migration-based test with a load_config()-only no-write contract. Refreshed curator/config suite: 339 passed.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
@kortylokai-web
kortylokai-web force-pushed the feature/curator-reasoning-effort branch from 92f8638 to c71716a Compare July 15, 2026 08:52
@kortylokai-web
kortylokai-web force-pushed the feature/curator-reasoning-effort branch from c71716a to 1a2276a Compare August 1, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform 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.

3 participants