Skip to content

Rename Hermes adapter setting max_turns -> max_iterations - #14

Merged
AjayThorve merged 1 commit into
NVIDIA:mainfrom
AjayThorve:ajay/rename-max-turns-to-max-iterations
Jun 24, 2026
Merged

Rename Hermes adapter setting max_turns -> max_iterations#14
AjayThorve merged 1 commit into
NVIDIA:mainfrom
AjayThorve:ajay/rename-max-turns-to-max-iterations

Conversation

@AjayThorve

@AjayThorve AjayThorve commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #12. Renames the Hermes adapter setting max_turnsmax_iterations.

Why

max_turns maps to Hermes' AIAgent(max_iterations=…) — the cap on agent-loop iterations within a single invocation. The name reads as a conversational-turn count, which is misleading (a session "turn" is one invoke()). max_iterations matches Hermes' own parameter.

What

  • Rename the setting in the hermes-sdk, hermes-session, hermes-cli, and hermes-relay profiles.
  • Both adapters read settings.get("max_iterations").
  • Hermes' config-file key (agent.max_turns) and the SDK parameter (max_iterations) are unchanged; runtime behavior is identical.

Tests

  • All four profiles resolve with max_iterations: 1; adapter syntax + profile YAML verified. The setting only reaches Hermes on gated real-Hermes runs.

Summary by CodeRabbit

  • Configuration Updates
    • Standardized configuration parameter naming across Hermes adapters for consistency and clarity. The iteration limit setting is now referred to as max_iterations instead of max_turns in all Hermes implementations. Users with existing Hermes configurations should update their settings to use the new parameter name.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ab28cde3-80ab-4ed5-ba4f-0b7049e5e327

📥 Commits

Reviewing files that changed from the base of the PR and between 3bebb75 and 01d1587.

📒 Files selected for processing (6)
  • adapters/hermes-cli/src/nemo_fabric_adapters/hermes_cli/adapter.py
  • adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py
  • examples/code-review-agent/profiles/hermes-cli.yaml
  • examples/code-review-agent/profiles/hermes-relay.yaml
  • examples/code-review-agent/profiles/hermes-sdk.yaml
  • examples/code-review-agent/profiles/hermes-session.yaml
✅ Files skipped from review due to trivial changes (1)
  • examples/code-review-agent/profiles/hermes-cli.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • examples/code-review-agent/profiles/hermes-session.yaml
  • examples/code-review-agent/profiles/hermes-sdk.yaml
  • examples/code-review-agent/profiles/hermes-relay.yaml

📝 Walkthrough

Walkthrough

Across two Hermes adapter implementations and four example profile YAML files, the iteration-limit configuration key is renamed from max_turns to max_iterations. The adapter code reads the new key directly without fallback behavior.

Changes

max_turns → max_iterations rename

Layer / File(s) Summary
Adapter implementations
adapters/hermes-cli/src/.../adapter.py, adapters/hermes-sdk/src/.../adapter.py
build_hermes_config() now reads max_iterations for the agent max_turns field; run_hermes_sdk() passes max_iterations to AIAgent constructor with default value 1.
Example profile configs
examples/code-review-agent/profiles/hermes-*.yaml
All four profiles replace max_turns: 1 with max_iterations: 1 under harness.settings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • dagardner-nv
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary change: renaming the Hermes adapter setting from max_turns to max_iterations across adapters and example profiles.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@AjayThorve
AjayThorve requested a review from dagardner-nv June 23, 2026 23:19
@linear

linear Bot commented Jun 23, 2026

Copy link
Copy Markdown

Comment thread adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py Outdated
@AjayThorve
AjayThorve force-pushed the ajay/rename-max-turns-to-max-iterations branch from 7d85412 to 3bebb75 Compare June 23, 2026 23:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py (1)

257-257: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore legacy fallback when populating agent.max_turns (Line 257).

build_hermes_config() currently ignores legacy max_turns, so profiles still using that key won’t propagate the limit through this path. This conflicts with the backward-compat behavior implemented at Line 396.

Suggested fix
-                "max_turns": settings.get("max_iterations"),
+                "max_turns": settings.get("max_iterations", settings.get("max_turns")),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py` at line
257, The settings.get("max_iterations") call in the max_turns population logic
does not include a fallback for the legacy "max_turns" key, causing profiles
using the old key to be ignored in this code path. Modify the settings.get()
call to first check for "max_iterations", and if it doesn't exist, fall back to
checking for the legacy "max_turns" key. This will ensure consistency with the
backward-compatibility behavior already implemented elsewhere in the code (as
referenced in the comment regarding line 396) and allow legacy configurations to
propagate correctly through the build_hermes_config() function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py`:
- Line 257: The settings.get("max_iterations") call in the max_turns population
logic does not include a fallback for the legacy "max_turns" key, causing
profiles using the old key to be ignored in this code path. Modify the
settings.get() call to first check for "max_iterations", and if it doesn't
exist, fall back to checking for the legacy "max_turns" key. This will ensure
consistency with the backward-compatibility behavior already implemented
elsewhere in the code (as referenced in the comment regarding line 396) and
allow legacy configurations to propagate correctly through the
build_hermes_config() function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5f460e16-9b55-4db9-bdd5-54e3d563a7ac

📥 Commits

Reviewing files that changed from the base of the PR and between 7d85412 and 3bebb75.

📒 Files selected for processing (6)
  • adapters/hermes-cli/src/nemo_fabric_adapters/hermes_cli/adapter.py
  • adapters/hermes-sdk/src/nemo_fabric_adapters/hermes_sdk/adapter.py
  • examples/code-review-agent/profiles/hermes-cli.yaml
  • examples/code-review-agent/profiles/hermes-relay.yaml
  • examples/code-review-agent/profiles/hermes-sdk.yaml
  • examples/code-review-agent/profiles/hermes-session.yaml
✅ Files skipped from review due to trivial changes (3)
  • examples/code-review-agent/profiles/hermes-session.yaml
  • examples/code-review-agent/profiles/hermes-cli.yaml
  • examples/code-review-agent/profiles/hermes-relay.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • examples/code-review-agent/profiles/hermes-sdk.yaml
  • adapters/hermes-cli/src/nemo_fabric_adapters/hermes_cli/adapter.py

The Fabric-facing setting `max_turns` maps to Hermes' agent-loop iteration cap,
not a conversational-turn count, which is misleading in session profiles where a
turn is one invoke. Rename it to `max_iterations` (matching Hermes' AIAgent
param) in the example profiles and read `max_iterations` in both adapters.

Hermes' own config-file key (`agent.max_turns`) and the SDK
`AIAgent(max_iterations=...)` parameter are unchanged, so real Hermes runs
behave identically.

Signed-off-by: Ajay Thorve <athorve@nvidia.com>
@AjayThorve
AjayThorve force-pushed the ajay/rename-max-turns-to-max-iterations branch from 3bebb75 to 01d1587 Compare June 23, 2026 23:48
@AjayThorve
AjayThorve merged commit e7892f5 into NVIDIA:main Jun 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants