hermes - ✅(Solved) Fix Background review agents ignore reasoning_config and fall back to medium [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#18871Fetched 2026-05-03 04:53:51
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Background memory/skill review agents can ignore the active agent.reasoning_effort configuration because _spawn_background_review() creates a fresh AIAgent without passing reasoning_config.

On Codex Responses routes, that fresh review agent falls back to the transport default:

{
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  }
}

This can produce unexpected medium-effort upstream requests even when the user's main session is configured for a higher effort such as xhigh.

Root Cause

Recent background-review fixes already focus on runtime inheritance:

  • #16006 preserves base_url, api_key, and api_mode when _spawn_background_review() forks a review agent.
  • #15884 passes base_url and api_key into the background review agent.
  • #13076 fixes another entrypoint where config.yaml reasoning config was loaded and passed into AIAgent.

reasoning_config appears to be another runtime field that should be inherited by background review agents.

Fix Action

Fixed

PR fix notes

PR #18973: fix(agent): forward reasoning_config to background review AIAgent fork

Description (problem / solution / changelog)

What does this PR do?

`_spawn_background_review()` in `run_agent.py` (line ~3611) inherits the parent session's `provider`, `model`, `base_url`, `api_key`, and `api_mode` when forking a review agent. `reasoning_config` was not forwarded.

On Codex Responses routes the missing field causes the forked review agent to fall back to the transport default (`medium` effort), so a session configured for `agent.reasoning_effort: xhigh` still generates medium-effort background review requests — wasting budget and ignoring the user's explicit preference.

One-line fix in `_spawn_background_review()` — passes `reasoning_config=self.reasoning_config`. When `reasoning_config` is `None` the behaviour is identical to before: harmless no-op for sessions without a reasoning override. Symmetric with the `api_mode`, `base_url`, and `api_key` fields that #16006 and #15884 already propagate on the same fork path.

Related Issue

Fixes #18871

Type of Change

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

Changes Made

  • `run_agent.py`: add `reasoning_config=self.reasoning_config` to `AIAgent(...)` in `_spawn_background_review()` (+1 line)
  • `tests/run_agent/test_background_review.py`: add `reasoning_config = None` to `_bare_agent()` helper; add `test_background_review_inherits_reasoning_config` parametrized over `None`, `{"effort": "xhigh"}`, and `{"enabled": False}` (+49 lines)

How to Test

```bash python3.11 -m pytest tests/run_agent/test_background_review.py -v --override-ini="addopts=" ```

Checklist

Code

  • Contributing Guide read
  • Conventional Commits
  • No duplicate PR
  • Single logical change only
  • pytest passing
  • Tests added
  • Platform: macOS

Documentation & Housekeeping

  • Docs updated — N/A
  • cli-config.yaml.example — N/A
  • CONTRIBUTING.md/AGENTS.md — N/A
  • Cross-platform impact — N/A
  • Tool descriptions — N/A

Changed files

  • run_agent.py (modified, +1/-0)
  • tests/run_agent/test_background_review.py (modified, +49/-0)

Code Example

{
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  }
}

---

agent:
  reasoning_effort: xhigh

---

review_agent = AIAgent(
    model=self.model,
    max_iterations=8,
    quiet_mode=True,
    platform=self.platform,
    provider=self.provider,
    api_mode=...,
    base_url=...,
    api_key=...,
    parent_session_id=self.session_id,
    enabled_toolsets=["memory", "skills"],
)

---

agent:
  reasoning_effort: xhigh

---

reasoning_config={"enabled": True, "effort": "xhigh"}

---

review_agent = AIAgent(
    ...,
    reasoning_config=self.reasoning_config,
)

---

reasoning:
  default_effort: xhigh

---

runtime:
  reasoning_effort: xhigh

---

agent:
  reasoning_effort: xhigh

delegation:
  reasoning_effort: high

auxiliary:
  title_generation:
    extra_body:
      reasoning:
        effort: low

memory:
  review:
    reasoning_effort: low

skills:
  review:
    reasoning_effort: low
RAW_BUFFERClick to expand / collapse

Summary

Background memory/skill review agents can ignore the active agent.reasoning_effort configuration because _spawn_background_review() creates a fresh AIAgent without passing reasoning_config.

On Codex Responses routes, that fresh review agent falls back to the transport default:

{
  "reasoning": {
    "effort": "medium",
    "summary": "auto"
  }
}

This can produce unexpected medium-effort upstream requests even when the user's main session is configured for a higher effort such as xhigh.

Why this matters

Recent background-review fixes already focus on runtime inheritance:

  • #16006 preserves base_url, api_key, and api_mode when _spawn_background_review() forks a review agent.
  • #15884 passes base_url and api_key into the background review agent.
  • #13076 fixes another entrypoint where config.yaml reasoning config was loaded and passed into AIAgent.

reasoning_config appears to be another runtime field that should be inherited by background review agents.

Current behavior

A main session configured like this:

agent:
  reasoning_effort: xhigh

can still spawn a background memory/skill review run whose model request uses the Codex transport's default medium reasoning effort, because the review agent is constructed without reasoning_config.

The relevant path is _spawn_background_review() in run_agent.py, where the review agent is instantiated with fields such as:

review_agent = AIAgent(
    model=self.model,
    max_iterations=8,
    quiet_mode=True,
    platform=self.platform,
    provider=self.provider,
    api_mode=...,
    base_url=...,
    api_key=...,
    parent_session_id=self.session_id,
    enabled_toolsets=["memory", "skills"],
)

but no reasoning_config=....

Expected behavior

Background memory/skill review should use the same active reasoning configuration as the parent session unless a review-specific override is configured.

For example, if the parent session has:

agent:
  reasoning_effort: xhigh

the spawned review agent should receive the parsed equivalent of:

reasoning_config={"enabled": True, "effort": "xhigh"}

and should not fall back to a transport-local medium default.

Suggested minimal fix

Pass the parent reasoning config when creating the background review agent:

review_agent = AIAgent(
    ...,
    reasoning_config=self.reasoning_config,
)

It may also be worth preserving related runtime fields in the same clone path, for example service_tier and request_overrides, if those are expected to apply consistently across internal agent forks.

Suggested broader config improvement

Please consider adding a true global reasoning default in config.yaml, for example:

reasoning:
  default_effort: xhigh

or:

runtime:
  reasoning_effort: xhigh

That value could be used by every AIAgent construction path when an explicit reasoning_config is not provided. Subsystem-specific settings could still override it, e.g.:

agent:
  reasoning_effort: xhigh

delegation:
  reasoning_effort: high

auxiliary:
  title_generation:
    extra_body:
      reasoning:
        effort: low

memory:
  review:
    reasoning_effort: low

skills:
  review:
    reasoning_effort: low

This would reduce the risk of new internal agent forks or auxiliary paths silently returning to a transport-local medium default.

Acceptance criteria

  • Background memory/skill review agents inherit the parent reasoning_config by default.
  • A session with agent.reasoning_effort: xhigh does not generate medium-effort background review requests through Codex Responses unless explicitly configured that way.
  • Tests cover _spawn_background_review() cloning reasoning_config into the review AIAgent.
  • Optional: a global reasoning default is available and used by bare AIAgent creation paths when no explicit reasoning config is supplied.

Privacy note

This report intentionally omits local paths, session identifiers, timestamps, upstream request dump IDs, credentials, provider keys, and user-specific configuration values.

extent analysis

TL;DR

Pass the parent reasoning config to the background review agent by adding reasoning_config=self.reasoning_config when creating the AIAgent in _spawn_background_review().

Guidance

  • Verify that the reasoning_config is correctly passed to the review agent by checking the review_agent object after creation.
  • Test the fix by configuring a main session with a high reasoning effort (e.g., xhigh) and checking that the spawned background review agent uses the same effort.
  • Consider adding a global reasoning default in config.yaml to reduce the risk of new internal agent forks or auxiliary paths silently returning to a transport-local medium default.
  • Review the acceptance criteria to ensure that the fix meets the required conditions.

Example

review_agent = AIAgent(
    model=self.model,
    max_iterations=8,
    quiet_mode=True,
    platform=self.platform,
    provider=self.provider,
    api_mode=...,
    base_url=...,
    api_key=...,
    parent_session_id=self.session_id,
    enabled_toolsets=["memory", "skills"],
    reasoning_config=self.reasoning_config,  # Add this line
)

Notes

The suggested fix only addresses the specific issue of background memory/skill review agents ignoring the active agent.reasoning_effort configuration. Additional testing and review may be necessary to ensure that the fix does not introduce any unintended consequences.

Recommendation

Apply the suggested minimal fix by passing the parent reasoning config to the background review agent. This should resolve the issue and ensure that background review agents use the correct reasoning effort.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Background memory/skill review should use the same active reasoning configuration as the parent session unless a review-specific override is configured.

For example, if the parent session has:

agent:
  reasoning_effort: xhigh

the spawned review agent should receive the parsed equivalent of:

reasoning_config={"enabled": True, "effort": "xhigh"}

and should not fall back to a transport-local medium default.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Background review agents ignore reasoning_config and fall back to medium [1 pull requests, 1 participants]