Skip to content

fix(oneshot): inject --skills content into one-shot -z runs (#71759) - #71781

Closed
JonthanaHanh wants to merge 2 commits into
NousResearch:mainfrom
JonthanaHanh:fix/oneshot-skills-inject-71759
Closed

JonthanaHanh wants to merge 2 commits into
NousResearch:mainfrom
JonthanaHanh:fix/oneshot-skills-inject-71759

Conversation

@JonthanaHanh

Copy link
Copy Markdown
Contributor

Summary

Fixes #71759hermes --skills <name> -z "<prompt>" runs the prompt but the named skill's content never reaches the model.

Root Cause

The --skills flag is parsed by the CLI argument parser but never passed through the oneshot execution path. The chain _run_and_exit_oneshot -> run_oneshot -> _run_agent had no skills parameter, so skill content was silently dropped.

Fix

  1. Add skills parameter to _run_and_exit_oneshot, run_oneshot, and _run_agent
  2. Pass skills from the two callers in main.py
  3. In _run_agent, load skill content via build_preloaded_skills_prompt and inject into ephemeral_system_prompt

Changes

  • hermes_cli/main.py: Pass skills to _run_and_exit_oneshot (2 call sites)
  • hermes_cli/oneshot.py: Add _parse_skills_for_oneshot helper, add skills param throughout the chain, load and inject skill content

Test Results

tests/hermes_cli/test_chat_skills_flag.py .... [100%]
4 passed in 1.29s

For finite one-shot jobs (repeat.times=1), mark_job_run removes the job
from the store when completed >= times.  The subsequent get_job() in
_execute_job_now returns None, causing execution_success=False even though
the job ran end-to-end and delivered its output.

Handle the None case: if run_one_job returned True and the job no longer
exists in the store, treat it as successful completion rather than failure.

Fixes NousResearch#71760
…arch#71759)

The --skills flag was parsed but never passed to the oneshot path. Skills loaded via build_preloaded_skills_prompt were silently dropped in -z mode.

Fix: pass skills through _run_and_exit_oneshot -> run_oneshot -> _run_agent, load skill content via build_preloaded_skills_prompt, and inject into ephemeral_system_prompt.

Fixes NousResearch#71759
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management tool/skills Skills system (list, view, manage) P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 26, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #31591: both forward --skills through oneshot and inject the preload into ephemeral_system_prompt. This PR additionally bundles an unrelated cron success-status fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global --skills flag does not inject skill content in one-shot -z runs

2 participants