NousResearch/hermes-agent · error · KeyError

unknown one-shot template: {name}

Error message

unknown one-shot template: {name}

What it means

Error "unknown one-shot template: {name}" thrown in NousResearch/hermes-agent.

Source

Thrown at agent/oneshot.py:102

    return _COMMIT_INSTRUCTIONS, "\n\n".join(parts)


# Registry of named templates. Add an entry here to give a new surface a
# consistent, reusable prompt without teaching every caller the prompt text.
PROMPT_TEMPLATES: Dict[str, PromptTemplate] = {
    "commit_message": _commit_message_template,
}


def render_template(name: str, variables: Optional[Dict[str, Any]] = None) -> Tuple[str, str]:
    """Resolve a registered template into (instructions, user_input).

    Raises KeyError if the template name is unknown so callers fail loudly
    instead of silently sending an empty prompt.
    """
    template = PROMPT_TEMPLATES.get(name)
    if template is None:
        raise KeyError(f"unknown one-shot template: {name}")
    return template(variables or {})


def run_oneshot(
    *,
    instructions: str = "",
    user_input: str = "",
    template: Optional[str] = None,
    variables: Optional[Dict[str, Any]] = None,
    task: str = "title_generation",
    max_tokens: int = 1024,
    temperature: Optional[float] = 0.3,
    timeout: float = 60.0,
    main_runtime: Optional[Dict[str, Any]] = None,
) -> str:
    """Run a single stateless LLM request and return its text.

    Provide either a registered ``template`` (+ ``variables``) or an explicit

View on GitHub (pinned to c896c09c42)

Solutions

  1. Use one of the registered one-shot template names.
  2. List available templates and pick an existing one.

When it happens

Trigger: Thrown at agent/oneshot.py:102 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/0d58cabcf3e38b99. Report an issue: GitHub.