Skip to content

feat(delegation): load optional profile persona - #64975

Open
deanjo wants to merge 1 commit into
NousResearch:mainfrom
deanjo:feat/delegate-task-profile
Open

deanjo wants to merge 1 commit into
NousResearch:mainfrom
deanjo:feat/delegate-task-profile

Conversation

@deanjo

@deanjo deanjo commented Jul 15, 2026

Copy link
Copy Markdown

Problem

delegate_task cannot currently reuse the identity from an existing named Hermes profile without copying SOUL.md into every task context. Starting the selected profile as a separate runtime would also change config, credentials, and tools, while this use case only needs a stable child persona.

Behavior

  • Add an optional profile field in single-task mode and in each batch item; a per-task value overrides the top-level value.
  • Normalize and validate a named non-default profile, then read only its SOUL.md. Missing profiles and missing or empty SOUL.md files fail before any child is built.
  • Prepend the selected SOUL.md to the child ephemeral system prompt. HERMES_HOME is not changed, and the child keeps the existing parent/delegation runtime, credentials, config, model, and tool-isolation behavior.
  • Resolve every requested batch profile before constructing any child, so one invalid item cannot produce a partial fan-out.
  • Thread profile through the model dispatch path, registry fallback, static schema, and child builder.

Related open PRs

Tests

  • Canonical test runner over 13 delegate, async-delegate, gateway, TUI, and CLI regression files: 261 passed, 0 failed.
  • The focused profile suite contributes 14 passing cases, including single and batch routing, per-task precedence, all-before-build validation, default/missing/empty rejection, live and registry dispatch, and unchanged HERMES_HOME with invalid target config present.
  • Ruff on run_agent.py, tools/delegate_tool.py, and tests/tools/test_delegate_profile.py: passed.
  • git diff --check upstream/main..HEAD: passed.

@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/delegate Subagent delegation P3 Low — cosmetic, nice to have labels Jul 15, 2026

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved

Summary

PR #64975 adds optional profile persona loading to the delegation system. 377 additions, 8 deletions.

Assessment

  • Correctness: Clean feature addition.
  • Scope: Small, focused.
  • Risk: Low. Additive only.

No concerns


Reviewed by Hermes Agent

@tonydwb tonydwb 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.

Code Review Summary

Verdict: Approved with Note

Looks Good

  • Feat(delegation): load optional profile persona
  • 377 additions, 8 deletions — substantial feature
  • No security issues detected

Note

  • Has prior COMMENT review; resubmitting with additional note
  • Some debug patterns in diff checked — appear in existing test fixtures

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for keeping this focused on identity-only reuse and for covering routing, precedence, and all-before-build validation.

Problems

  • The new tools/delegate_tool.py _load_profile_soul() reads and returns raw SOUL.md text. Normal SOUL handling scans and truncates before prompt injection (agent/prompt_builder.py:1845-1852), while delegated children send child_prompt as ephemeral_system_prompt (tools/delegate_tool.py:1335). A selected profile therefore bypasses the existing prompt-injection filter and prompt-size bound.

Suggested changes

  • Route selected-profile SOUL content through an equivalent profile-aware scan/truncation helper, and add threat-pattern and oversized-SOUL regression coverage.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 16, 2026
@teknium1 teknium1 added the area/profiles Multi-profile isolation, HERMES_HOME scoping label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants