Skip to content

feat(agent-importers): give each Grok Bot its own profile - #394

Closed
ree2507 wants to merge 4 commits into
NousResearch:mainfrom
ree2507:fix/issue-265-one-profile-per-bot
Closed

ree2507 wants to merge 4 commits into
NousResearch:mainfrom
ree2507:fix/issue-265-one-profile-per-bot

Conversation

@ree2507

@ree2507 ree2507 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #265 (the multi-bott half)

What this changes

Previously, importing an export containing multiple Bots merged all of them into a single profile. Because single = len(bots) == 1 evaluated to False, none of the roles were written to SOUL.md—instead, every Bot after the first was saved as a memory entry under the same agent (e.g., "Grok Bot Ava: You are Ava...", "Grok Bot Scout: You are Scout..."), causing the merge behavior described in the issue.

hermes import-agent grok-bot now offers to create a separate profile for each Bot when an export contains more than one:

  • Cloned configuration: Each profile is created using the same behavior as hermes profile create --clone. The current profile's config.yaml and .env are carried over so the Bot works out of the box for one-shot chats, while messaging channels are excluded to prevent two gateways from conflicting over the same bot token.
  • Seeded identity: SOUL.md is seeded from scratch rather than cloned, allowing the Bot's own role to become that profile's identity (it will only replace the file if it still contains Hermes' default template).
  • Isolated routines: Only that specific Bot's routines are imported into its profile's cron store, and the printed hermes cron resume commands include -p <profile> so they can be copy-pasted and run from anywhere.

Scope

  • Single-Bot imports remain unchanged, and passing --bot continues to import directly into your active profile.
  • Non-interactive (-y) and --dry-run runs will not create new profiles. Instead, they warn about what gets lost by merging into one profile (one role in SOUL.md, the rest saved as memory entries) rather than silently triggering a side effect from a skipped prompt.
  • hermes setup is untouched. Since its child process always runs on --profile default (hermes_cli/setup_agent_import.py:157), supporting multi-profile selection there requires a core change, which can be handled in a separate PR as discussed.

Testing

  • Added test_several_bots_are_offered_one_profile_each: Verifies that two Bots in one export result in two separate profiles—each with its own role in SOUL.md, its own cron job, and a cloned .env—while leaving the current profile untouched and appending -p to both resume hints.
  • Added test_several_bots_without_a_prompt_are_imported_into_this_profile: Verifies that -y skips profile creation, saves both roles as memory entries, and prints a notice pointing to the interactive mode.
  • Ran the full agent-importers test suite: 134 passed, 1 skipped (up from the baseline of 132 passed, 1 skipped—the only additions being the two new tests). hermes plugins validate ./agent-importers also passed.
  • Note on private imports: hermes plugins validate flags the new hermes_cli.profiles imports under its private-core advisory. Since there isn't a public plugin-facing seam for creating profiles yet—and the issue specifically asked for hermes profile create --clone semantics—I used it directly, though I'm happy to move this behind a core helper if you'd prefer.

The resume-hint half is #290

@ree2507
ree2507 requested a review from teknium1 as a code owner November 14, 2026 15:52
Importing a Grok Bot or OpenBot into a named profile printed
'hermes cron resume <id>' without a -p selector, so the hint failed
when pasted from any other profile: the resume ran against the
caller's cron store and did not find the job (NousResearch#265).

The hint now carries the profile's -p selector via
hermes_constants.profile_cli_selector(), the same helper core uses
for its copy-pasteable guidance; the default profile keeps the bare
form. Existing suite extended with a named-profile end-to-end test.
@teknium1

Copy link
Copy Markdown
Contributor

Thanks, and the per-Bot profile approach is the option the reporter picked on #265. One blocker:

The importer calls private core functions: hermes_cli.profiles.create_profile, profile_exists, get_profile_dir, validate_profile_name, and hermes_cli.default_soul. None of these are in the published plugin API (hermes_cli/data/plugin_api.json). They can change or move in any core release, which would break the importer without warning. #383 was closed on 11-13 for the same reason.

Please create profiles through the public CLI instead: run hermes profile create <name> --clone as a subprocess, then write that profile's SOUL.md and cron jobs into the directory it creates. After that, rebase over #290, which conflicts with this PR. Once this lands, #279 can close as superseded.

The tests look good: 134 pass on this head, and 2 fail on main as they should.

An export holding several Bots imported them all into one profile, where
`single=len(bots) == 1` is False: no role could reach SOUL.md, so every Bot
after the first became a memory entry of the same agent. That is the merge
the issue reports.

`hermes import-agent grok-bot` now offers one profile per Bot when the
export holds more than one. Each profile is created the way
`hermes profile create --clone` does it (same config.yaml/.env, no messaging
channels), with SOUL.md seeded so the Bot's own role can become its identity,
and only that Bot's routines are imported into its cron store. The printed
`hermes cron resume` lines carry `-p <profile>`, so they work pasted from
anywhere.

A single-Bot import is unchanged, `--bot` keeps importing where you are, and
a non-interactive run (`-y`) or a dry run creates nothing — it says what the
Bots lose instead. The `hermes setup` path is untouched: its child always
runs on `--profile default`, so offering profiles there is a core change.

Refs NousResearch#265
…ate`

The importer called `hermes_cli.profiles.create_profile`, `profile_exists`,
`get_profile_dir`, `validate_profile_name` and `hermes_cli.default_soul` — private core with
no compatibility promise, so a routine release could move them and break the import without
warning (catalog rule 9; NousResearch#383 was closed for the same reason).

Each Bot's profile is now made the way a user makes one: `hermes profile create <name>
--clone` in a child process, its directory read back from the CLI's own output. A name the
CLI refuses (reserved, or not a valid id) is retried once with a `-bot` suffix; a profile
that already exists is merged into, never clobbered. `--no-alias` keeps the footprint to the
profile itself — an import should not install a wrapper script per Bot.

`--clone` copies this profile's SOUL.md, and a Bot's role only replaces a SOUL.md that still
holds Hermes' default. Keeping the clone would send the role to memory instead — the merge
NousResearch#265 reports — so the new profile starts without one and the Bot owns its identity.

Tests: 136 passed, 1 skipped. New: profiles are created through the public CLI (the private
functions are patched to fail), and a Bot's role reaches SOUL.md even when the importing
profile has a custom one.
@ree2507
ree2507 force-pushed the fix/issue-265-one-profile-per-bot branch from fa18cc8 to 54656a2 Compare November 15, 2026 05:21
@ree2507

ree2507 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Done.

Each Bot's profile is now created in a child process via hermes profile create --clone --no-alias (following setup_agent_import._import_child's sys.executable -P -m hermes_cli.main pattern). Its directory is parsed directly from stdout (Profile '' created at

, or Path: from hermes profile show if it already exists).

A few important detail to note:

  • Explicit home anchoring: Both HERMES_HOME and HOME/USERPROFILE are passed to the child process. Because the profiles root resolves from the platform home rather than HERMES_HOME, leaving it unset would write into a different install.

  • No cloned SOUL.md: Since --clone copies the source SOUL.md—and a Bot's role only replaces a default seeded one (_is_seeded_soul, per [agent-importers] Grok Bot: several Bots merge into one agent, and the per-profile path prints a resume command that fails #265)—the cloned SOUL.md is removed so the Bot's role cleanly becomes its identity instead of getting pushed to memory.

  • --no-alias: Skips generating a wrapper executable for every imported Bot, keeping the closing hint on profile_cli_selector() with -p (hermes -p chat).

validate_profile_name is also gone in favor of the CLI's own naming rules: rejected names retry once with a -bot suffix, and existing profiles are merged into rather than overwritten.

hermes plugins validate ./agent-importers is completely clean for cli.py (only untouched pre-existing imports remain in grok_bot.py and openclaw.py). Let me know if you'd like me to put default_soul behind a seam in a separate follow-up.

The tests is 137 passed, 1 skipped, including two new tests verifying that profile creation works with private functions patched to raise, and that a Bot's role still populates SOUL.md when the importing profile has its own.

the branch is rebased over #290 (9a96d29), so the hint keeps profile_cli_selector() and -p <profile> is layered on for the per-Bot targets. That's why three commits show here right now. #290's commit drops out of the diff once it merges.

teknium1 added a commit to salch-cred/hermes-official-plugins that referenced this pull request Nov 19, 2026
… not the launch env

The process env holds the launch profile's channels: a job imported into another
profile cannot deliver through them. Platform ids now match cron's deliver tokens
(qqbot; no bare qq). The config.yaml home_channel branch read PyYAML, which core no
longer ships; the broad except hid the ImportError, so it never matched — it now goes
through the plugin's load_config_file. The preview row (destination) carries
'delivers to <x>', and the local-output hint names the target profile's cron/output.
Test moved off the hunk NousResearch#290/NousResearch#394 edit so the three PRs merge cleanly.
…import (exit 1)

After the user accepted one profile per Bot, a failed 'hermes profile create' returned
an empty target list and the import silently fell back to merging every Bot into the
current profile: the merge they had just declined, reported as success. It now exits 1
with nothing imported.
teknium1 added a commit that referenced this pull request Nov 19, 2026
… not the launch env

The process env holds the launch profile's channels: a job imported into another
profile cannot deliver through them. Platform ids now match cron's deliver tokens
(qqbot; no bare qq). The config.yaml home_channel branch read PyYAML, which core no
longer ships; the broad except hid the ImportError, so it never matched — it now goes
through the plugin's load_config_file. The preview row (destination) carries
'delivers to <x>', and the local-output hint names the target profile's cron/output.
Test moved off the hunk #290/#394 edit so the three PRs merge cleanly.

(cherry picked from commit 36ca96c)
@teknium1

Copy link
Copy Markdown
Contributor

Thank you @ree2507! This landed on main through #446, which stacked the 34 reviewed official-plugin PRs on current main so their shared files (CHANGELOGs, versions, the README grid) conflicted only once. Your commits are kept with your authorship; this PR's tip is 2feabbb. To get it now: hermes plugins install NousResearch/hermes-official-plugins#<plugin> --force; hermes plugins update follows once the catalog pin moves (in progress).

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.

[agent-importers] Grok Bot: several Bots merge into one agent, and the per-profile path prints a resume command that fails

2 participants