hermes - 💡(How to fix) Fix [Feature]: Per-subagent temperature control via delegate_task parameter

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…

Fix Action

Fix / Workaround

Current workarounds and their problems:

  1. Local source patch — Modify delegate_tool.py to hardcode temperature. Problem: not maintainable across updates, not shareable across team members.
ApproachProsCons
Model switching (current workaround)No code changesCostly; limited by provider model availability; can't fine-tune within same model
Prompt engineeringNo code changesUnreliable; model-dependent; wastes tokens; not deterministic
Local source patchWorks immediatelyNot maintainable; breaks on updates; not team-shareable
Global config key (delegation.temperature)SimpleToo coarse — can't vary per subagent in same workflow
Per-task temperature in batch modeFlexibleSlightly more complex API; but this is the proposed solution

Code Example

def delegate_task(
    goal: str = None,
    context: str = None,
    tasks: List[Dict[str, Any]] = None,
    model: str = None,
    temperature: float = None,        # ← NEW
    toolsets: List[str] = None,
    role: str = "leaf",
    acp_command: str = None,
    acp_args: List[str] = None,
) -> List[Dict[str, Any]]:
    """Spawn one or more subagents to work on tasks in isolated contexts.
    
    ...existing docs...
    
    Args:
        temperature: Optional sampling temperature (0.0-2.0) for the subagent's
            LLM calls. Overrides the parent agent's temperature. Useful for
            creative tasks (higher) vs analytical tasks (lower).
    """

---

# Around line 1106 in current main
def _build_child_agent(...):
    ...
    child = AIAgent(
        base_url=effective_base_url,
        api_key=effective_api_key,
        model=effective_model,
        provider=effective_provider,
        api_mode=effective_api_mode,
        ...
        request_overrides={"temperature": temperature} if temperature is not None else None,
        # ↑ NEW: forward temperature to child via request_overrides
        ...
    )

---

delegation:
  model: ''
  provider: ''
  temperature: null    # ← NEW: default null = inherit from parent
  max_iterations: 50

---

# Creative brainstorming — high temperature
creative_results = delegate_task(
    goal="Brainstorm 10 unexpected plot twists for a mystery novel",
    temperature=0.8,
    model="anthropic/claude-sonnet-4",
)

# Logic review — low temperature
review_results = delegate_task(
    goal="Check the following plot for logical inconsistencies...",
    temperature=0.2,
    model="anthropic/claude-sonnet-4",  # same model, different behavior
)

# Batch with mixed temperatures (parallel execution)
mixed_results = delegate_task(
    tasks=[
        {"goal": "Generate title ideas", "temperature": 0.9},
        {"goal": "Check grammar", "temperature": 0.1},
        {"goal": "Expand outline", "temperature": 0.6},
    ]
)

---
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Currently, all subagents spawned via delegate_task inherit the parent's temperature (or the model's default). This makes it impossible to use different creative/deterministic settings for different phases of a workflow.

My use case (creative writing workflow):

PhasePurposeDesired TemperatureWhy
Creative brainstormingGenerate diverse story ideas0.8Need imagination, unexpected connections
Plot structuringOrganize narrative arcs0.5Balance creativity and coherence
Logic reviewCheck for plot holes0.2Strict, deterministic analysis
Style consistencyEnsure voice uniformity0.3Predictable output patterns

Current workarounds and their problems:

  1. Model switching — Use "creative" model (Claude Sonnet) for brainstorming, "strict" model (Claude Opus/o1) for review. Problem: costly, limited model availability, not fine-grained enough.

  2. Prompt engineering — Ask for "be creative" or "be strict" in the prompt. Problem: unreliable, model-dependent, wastes tokens on instructions that should be inference parameters.

  3. Local source patch — Modify delegate_tool.py to hardcode temperature. Problem: not maintainable across updates, not shareable across team members.

Why this matters for multi-agent workflows:

The delegate_task tool is designed for parallel subagent execution — a core selling point of Hermes. But without per-subagent inference parameter control, all children in a batch are forced into the same "personality mode." This significantly limits the sophistication of multi-agent workflows.

Proposed Solution

Add an optional temperature parameter to delegate_task that gets forwarded to the child AIAgent via request_overrides.

Minimal implementation (~3 files, <50 lines)

1. tools/delegate_tool.py — tool signature

def delegate_task(
    goal: str = None,
    context: str = None,
    tasks: List[Dict[str, Any]] = None,
    model: str = None,
    temperature: float = None,        # ← NEW
    toolsets: List[str] = None,
    role: str = "leaf",
    acp_command: str = None,
    acp_args: List[str] = None,
) -> List[Dict[str, Any]]:
    """Spawn one or more subagents to work on tasks in isolated contexts.
    
    ...existing docs...
    
    Args:
        temperature: Optional sampling temperature (0.0-2.0) for the subagent's
            LLM calls. Overrides the parent agent's temperature. Useful for
            creative tasks (higher) vs analytical tasks (lower).
    """

2. tools/delegate_tool.py_build_child_agent()

# Around line 1106 in current main
def _build_child_agent(...):
    ...
    child = AIAgent(
        base_url=effective_base_url,
        api_key=effective_api_key,
        model=effective_model,
        provider=effective_provider,
        api_mode=effective_api_mode,
        ...
        request_overrides={"temperature": temperature} if temperature is not None else None,
        # ↑ NEW: forward temperature to child via request_overrides
        ...
    )

3. Optional: config.yaml schema

delegation:
  model: ''
  provider: ''
  temperature: null    # ← NEW: default null = inherit from parent
  max_iterations: 50

Usage examples

# Creative brainstorming — high temperature
creative_results = delegate_task(
    goal="Brainstorm 10 unexpected plot twists for a mystery novel",
    temperature=0.8,
    model="anthropic/claude-sonnet-4",
)

# Logic review — low temperature
review_results = delegate_task(
    goal="Check the following plot for logical inconsistencies...",
    temperature=0.2,
    model="anthropic/claude-sonnet-4",  # same model, different behavior
)

# Batch with mixed temperatures (parallel execution)
mixed_results = delegate_task(
    tasks=[
        {"goal": "Generate title ideas", "temperature": 0.9},
        {"goal": "Check grammar", "temperature": 0.1},
        {"goal": "Expand outline", "temperature": 0.6},
    ]
)

Alternatives Considered

ApproachProsCons
Model switching (current workaround)No code changesCostly; limited by provider model availability; can't fine-tune within same model
Prompt engineeringNo code changesUnreliable; model-dependent; wastes tokens; not deterministic
Local source patchWorks immediatelyNot maintainable; breaks on updates; not team-shareable
Global config key (delegation.temperature)SimpleToo coarse — can't vary per subagent in same workflow
Per-task temperature in batch modeFlexibleSlightly more complex API; but this is the proposed solution

Feature Type

Configuration option

Scope

Small (single file, < 50 lines)

Contribution

  • I'd like to implement this myself and submit a PR

Debug Report (optional)

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…

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 - 💡(How to fix) Fix [Feature]: Per-subagent temperature control via delegate_task parameter