Navigate back to the previous page in browser history. Requires browser_navigate to be called first.

Send a raw Chrome DevTools Protocol (CDP) command. Escape hatch for browser operations not covered by browser_navigate, browser_click, browser_console, etc.

**Requires a reachable CDP endpoint.** Available when the user has run '/browser connect' to attach to a running Chrome, or when 'browser.cdp_url' is set in config.yaml. Not currently wired up for cloud backends (Browserbase, Browser Use, Firecrawl) — those expose CDP per session but live-session routing is a follow-up. Camofox is REST-only and will never support CDP. If the tool is in your toolset at all, a CDP endpoint is already reachable.

**CDP method reference:** https://chromedevtools.github.io/devtools-protocol/ — use web_extract on a method's URL (e.g. '/tot/Page/#method-handleJavaScriptDialog') to look up parameters and return shape.

**Common patterns:**
- List tabs: method='Target.getTargets', params={}
- Handle a native JS dialog: method='Page.handleJavaScriptDialog', params={'accept': true, 'promptText': ''}, target_id=<tabId>
- Get all cookies: method='Network.getAllCookies', params={}
- Eval in a specific tab: method='Runtime.evaluate', params={'expression': '...', 'returnByValue': true}, target_id=<tabId>
- Set viewport for a tab: method='Emulation.setDeviceMetricsOverride', params={'width': 1280, 'height': 720, 'deviceScaleFactor': 1, 'mobile': false}, target_id=<tabId>

**Usage rules:**
- Browser-level methods (Target.*, Browser.*, Storage.*): omit target_id and frame_id.
- Page-level methods (Page.*, Runtime.*, DOM.*, Emulation.*, Network.* scoped to a tab): pass target_id from Target.getTargets.
- **Cross-origin iframe scope** (Runtime.evaluate inside an OOPIF, Page.* targeting a frame target, etc.): pass frame_id from the browser_snapshot frame_tree output. This routes through the CDP supervisor's live connection — the only reliable way on Browserbase where stateless CDP calls hit signed-URL expiry.
- Each stateless call (without frame_id) is independent — sessions and event subscriptions do not persist between calls. For stateful workflows, prefer the dedicated browser tools or use frame_id routing.

CDP method name, e.g. 'Target.getTargets', 'Runtime.evaluate', 'Page.handleJavaScriptDialog'.

Method-specific parameters as a JSON object. Omit or pass {} for methods that take no parameters.

Optional. Target/tab ID from Target.getTargets result (each entry's 'targetId'). Use for page-level methods at the top-level tab scope. Mutually exclusive with frame_id.

Optional. Out-of-process iframe (OOPIF) frame_id from browser_snapshot.frame_tree.children[] where is_oopif=true. When set, routes the call through the CDP supervisor's live session for that iframe. Essential for Runtime.evaluate inside cross-origin iframes, especially on Browserbase where fresh per-call CDP connections can't keep up with signed URL rotation. For same-origin iframes, use parent contentWindow/contentDocument from Runtime.evaluate at the top-level page instead.

Timeout in seconds (default 30, max 300).

Click on an element identified by its ref ID from the snapshot (e.g., '@e5'). The ref IDs are shown in square brackets in the snapshot output. Requires browser_navigate and browser_snapshot to be called first.

The element reference from the snapshot (e.g., '@e5', '@e12')

Get browser console output and JavaScript errors from the current page. Returns console.log/warn/error/info messages and uncaught JS exceptions. Use this to detect silent JavaScript errors, failed API calls, and application warnings. Requires browser_navigate to be called first. When 'expression' is provided, evaluates JavaScript in the page context and returns the result — use this for DOM inspection, reading page state, or extracting data programmatically.

If true, clear the message buffers after reading

JavaScript expression to evaluate in the page context. Runs in the browser like DevTools console — full access to DOM, window, document. Return values are serialized to JSON. Example: 'document.title' or 'document.querySelectorAll("a").length'

Respond to a native JavaScript dialog (alert / confirm / prompt / beforeunload) that is currently blocking the page.

**Workflow:** call ``browser_snapshot`` first — if a dialog is open, it appears in the ``pending_dialogs`` field with ``id``, ``type``, and ``message``. Then call this tool with ``action='accept'`` or ``action='dismiss'``.

**Prompt dialogs:** pass ``prompt_text`` to supply the response string. Ignored for alert/confirm/beforeunload.

**Multiple dialogs:** if more than one dialog is queued (rare — happens when a second dialog fires while the first is still open), pass ``dialog_id`` from the snapshot to disambiguate.

**Availability:** only present when a CDP-capable backend is attached — Browserbase sessions, local Chrome via ``/browser connect``, or ``browser.cdp_url`` in config.yaml. Not available on Camofox (REST-only) or the default Playwright local browser (CDP port is hidden).

'accept' clicks OK / returns the prompt text. 'dismiss' clicks Cancel / returns null from prompt(). For ``beforeunload`` dialogs: 'accept' allows the navigation, 'dismiss' keeps the page.

Response string for a ``prompt()`` dialog. Ignored for other dialog types. Defaults to empty string.

Specific dialog to respond to, from ``browser_snapshot.pending_dialogs[].id``. Required only when multiple dialogs are queued.

Get a list of all images on the current page with their URLs and alt text. Useful for finding images to analyze with the vision tool. Requires browser_navigate to be called first.

Navigate to a URL in the browser. Initializes the session and loads the page. Must be called before other browser tools. For simple information retrieval, prefer web_search or web_extract (faster, cheaper). For plain-text endpoints — URLs ending in .md, .txt, .json, .yaml, .yml, .csv, .xml, raw.githubusercontent.com, or any documented API endpoint — prefer curl via the terminal tool or web_extract; the browser stack is overkill and much slower for these. Use browser tools when you need to interact with a page (click, fill forms, dynamic content). Returns a compact page snapshot with interactive elements and ref IDs — no need to call browser_snapshot separately after navigating.

The URL to navigate to (e.g., 'https://example.com')

Press a keyboard key. Useful for submitting forms (Enter), navigating (Tab), or keyboard shortcuts. Requires browser_navigate to be called first.

Key to press (e.g., 'Enter', 'Tab', 'Escape', 'ArrowDown')

Scroll the page in a direction. Use this to reveal more content that may be below or above the current viewport. Requires browser_navigate to be called first.

Direction to scroll

Get a text-based snapshot of the current page's accessibility tree. Returns interactive elements with ref IDs (like @e1, @e2) for browser_click and browser_type. full=false (default): compact view with interactive elements. full=true: complete page content. Snapshots over 8000 chars are truncated or LLM-summarized. Requires browser_navigate first. Note: browser_navigate already returns a compact snapshot — use this to refresh after interactions that change the page, or with full=true for complete content.

If true, returns complete page content. If false (default), returns compact view with interactive elements only.

Type text into an input field identified by its ref ID. Clears the field first, then types the new text. Requires browser_navigate and browser_snapshot to be called first.

The element reference from the snapshot (e.g., '@e3')

The text to type into the field

Take a screenshot of the current page and analyze it with vision AI. Use this when you need to visually understand what's on the page - especially useful for CAPTCHAs, visual verification challenges, complex layouts, or when the text snapshot doesn't capture important visual information. Returns both the AI analysis and a screenshot_path that you can share with the user by including MEDIA:<screenshot_path> in your response. Requires browser_navigate to be called first.

What you want to know about the page visually. Be specific about what you're looking for.

If true, overlay numbered [N] labels on interactive elements. Each [N] maps to ref @eN for subsequent browser commands. Useful for QA and spatial reasoning about page layout.

clarify

Ask the user a question when you need clarification, feedback, or a decision before proceeding. Supports two modes:

1. **Multiple choice** — provide up to 4 choices. The user picks one or types their own answer via a 5th 'Other' option.
2. **Open-ended** — omit choices entirely. The user types a free-form response.

Use this tool when:
- The task is ambiguous and you need the user to choose an approach
- You want post-task feedback ('How did that work out?')
- You want to offer to save a skill or update memory
- A decision has meaningful trade-offs the user should weigh in on

Do NOT use this tool for simple yes/no confirmation of dangerous commands (the terminal tool handles that). Prefer making a reasonable default choice yourself when the decision is low-stakes.

The question to present to the user.

Choices:
Up to 4 answer choices. Omit this parameter entirely to ask an open-ended question. When provided, the UI automatically appends an 'Other (type your answer)' option.

cronjob

Manage scheduled cron jobs with a single compressed tool.

Use action='create' to schedule a new job from a prompt or one or more skills.
Use action='list' to inspect jobs.
Use action='update', 'pause', 'resume', 'remove', or 'run' to manage an existing job.

To stop a job the user no longer wants: first action='list' to find the job_id, then action='remove' with that job_id. Never guess job IDs — always list first.

Jobs run in a fresh session with no current-chat context, so prompts must be self-contained.
If skills are provided on create, the future cron run loads those skills in order, then follows the prompt as the task instruction.
On update, passing skills=[] clears attached skills.

NOTE: The agent's final response is auto-delivered to the target. Put the primary
user-facing content in the final response. Cron jobs run autonomously with no user
present — they cannot ask questions or request clarification.

Important safety rule: cron-run sessions should not recursively schedule more cron jobs.

One of: create, list, update, pause, resume, remove, run

Required for update/pause/resume/remove/run

For create: the full self-contained prompt. If skills are also provided, this becomes the task instruction paired with those skills.

For create/update: '30m', 'every 2h', '0 9 * * *', or ISO timestamp

Optional human-friendly name

Optional repeat count. Omit for defaults (once for one-shot, forever for recurring).

Omit this parameter to auto-deliver back to the current chat and topic (recommended). Auto-detection preserves thread/topic context. Only set explicitly when the user asks to deliver somewhere OTHER than the current conversation. Values: 'origin' (same as omitting), 'local' (no delivery, save only), or platform:chat_id:thread_id for a specific destination. Examples: 'telegram:-1001234567890:17585', 'discord:#engineering', 'sms:+15551234567'. WARNING: 'platform:chat_id' without :thread_id loses topic targeting.

Optional ordered list of skill names to load before executing the cron prompt. On update, pass an empty array to clear attached skills.

Optional per-job model override. If provider is omitted, the current main provider is pinned at creation time so the job stays stable.

Provider name (e.g. 'openrouter', 'anthropic'). Omit to use and pin the current provider.

Model name (e.g. 'anthropic/claude-sonnet-4', 'claude-sonnet-4')

Optional path to a Python script that runs before each cron job execution. Its stdout is injected into the prompt as context. Use for data collection and change detection. Relative paths resolve under ~/.hermes/scripts/. On update, pass empty string to clear.

Optional job ID or list of job IDs whose most recent completed output is injected into the prompt as context before each run. Use this to chain cron jobs: job A collects data, job B processes it. Each entry must be a valid job ID (from cronjob action='list'). Note: injects the most recent completed output — does not wait for upstream jobs running in the same tick. On update, pass an empty array to clear.

Optional list of toolset names to restrict the job's agent to (e.g. ["web", "terminal", "file", "delegation"]). When set, only tools from these toolsets are loaded, significantly reducing input token overhead. When omitted, all default tools are loaded. Infer from the job's prompt — e.g. use "web" if it calls web_search, "terminal" if it runs scripts, "file" if it reads files, "delegation" if it calls delegate_task. On update, pass an empty array to clear.

Optional absolute path to run the job from. When set, AGENTS.md / CLAUDE.md / .cursorrules from that directory are injected into the system prompt, and the terminal/file/code_exec tools use it as their working directory — useful for running a job inside a specific project repo. Must be an absolute path that exists. When unset (default), preserves the original behaviour: no project context files, tools use the scheduler's cwd. On update, pass an empty string to clear. Jobs with workdir run sequentially (not parallel) to keep per-job directories isolated.

Spawn one or more subagents to work on tasks in isolated contexts. Each subagent gets its own conversation, terminal session, and toolset. Only the final summary is returned -- intermediate tool results never enter your context window.

TWO MODES (one of 'goal' or 'tasks' is required):
1. Single task: provide 'goal' (+ optional context, toolsets)
2. Batch (parallel): provide 'tasks' array with up to delegation.max_concurrent_children items (default 3, configurable via config.yaml, no hard ceiling). All run concurrently and results are returned together. Nested delegation requires role='orchestrator' and delegation.max_spawn_depth >= 2.

WHEN TO USE delegate_task:
- Reasoning-heavy subtasks (debugging, code review, research synthesis)
- Tasks that would flood your context with intermediate data
- Parallel independent workstreams (research A and B simultaneously)

WHEN NOT TO USE (use these instead):
- Mechanical multi-step work with no reasoning needed -> use execute_code
- Single tool call -> just call the tool directly
- Tasks needing user interaction -> subagents cannot use clarify

IMPORTANT:
- Subagents have NO memory of your conversation. Pass all relevant info (file paths, error messages, constraints) via the 'context' field.
- If the user is writing in a non-English language, or asked for output in a specific language / tone / style, say so in 'context' (e.g. "respond in Chinese", "return output in Japanese"). Otherwise subagents default to English and their summaries will contaminate your final reply with the wrong language.
- Subagent summaries are SELF-REPORTS, not verified facts. A subagent that claims "uploaded successfully" or "file written" may be wrong. For operations with external side-effects (HTTP POST/PUT, remote writes, file creation at shared paths, publishing), require the subagent to return a verifiable handle (URL, ID, absolute path, HTTP status) and verify it yourself — fetch the URL, stat the file, read back the content — before telling the user the operation succeeded.
- Leaf subagents (role='leaf', the default) CANNOT call: delegate_task, clarify, memory, send_message, execute_code.
- Orchestrator subagents (role='orchestrator') retain delegate_task so they can spawn their own workers, but still cannot use clarify, memory, send_message, or execute_code. Orchestrators are bounded by delegation.max_spawn_depth (default 2) and can be disabled globally via delegation.orchestrator_enabled=false.
- Each subagent gets its own terminal session (separate working directory and state).
- Results are always returned as an array, one entry per task.

What the subagent should accomplish. Be specific and self-contained -- the subagent knows nothing about your conversation history.

Background information the subagent needs: file paths, error messages, project structure, constraints. The more specific you are, the better the subagent performs.

Toolsets to enable for this subagent. Default: inherits your enabled toolsets. Available toolsets: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'vision', 'web', 'yuanbao'. Common patterns: ['terminal', 'file'] for code work, ['web'] for research, ['browser'] for web interaction, ['terminal', 'file', 'web'] for full-stack tasks.

Task goal

Task-specific context

Toolsets for this specific task. Available: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'vision', 'web', 'yuanbao'. Use 'web' for network access, 'terminal' for shell, 'browser' for web interaction.

Per-task ACP command override (e.g. 'claude'). Overrides the top-level acp_command for this task only.

Per-task ACP args override.

Per-task role override. See top-level 'role' for semantics.

Batch mode: tasks to run in parallel (limit configurable via delegation.max_concurrent_children, default 3). Each gets its own subagent with isolated context and terminal session. When provided, top-level goal/context/toolsets are ignored.

Role of the child agent. 'leaf' (default) = focused worker, cannot delegate further. 'orchestrator' = can use delegate_task to spawn its own workers. Requires delegation.max_spawn_depth >= 2 in config; ignored (treated as 'leaf') when the child would exceed max_spawn_depth or when delegation.orchestrator_enabled=false.

Override ACP command for child agents (e.g. 'claude', 'copilot'). When set, children use ACP subprocess transport instead of inheriting the parent's transport. Enables spawning Claude Code (claude --acp --stdio) or other ACP-capable agents from any parent, including Discord/Telegram/CLI.

Arguments for the ACP command (default: ['--acp', '--stdio']). Only used when acp_command is set. Example: ['--acp', '--stdio', '--model', 'claude-opus-4-6']

Run a Python script that can call Hermes tools programmatically. Use this when you need 3+ tool calls with processing logic between them, need to filter/reduce large tool outputs before they enter your context, need conditional branching (if X then Y else Z), or need to loop (fetch N pages, process N files, retry on failure).

Use normal tool calls instead when: single tool call with no processing, you need to see the full result and apply complex reasoning, or the task requires interactive user input.

Available via `from hermes_tools import ...`:

  web_search(query: str, limit: int = 5) -> dict
    Returns {"data": {"web": [{"url", "title", "description"}, ...]}}
  web_extract(urls: list[str]) -> dict
    Returns {"results": [{"url", "title", "content", "error"}, ...]} where content is markdown
  read_file(path: str, offset: int = 1, limit: int = 500) -> dict
    Lines are 1-indexed. Returns {"content": "...", "total_lines": N}
  write_file(path: str, content: str) -> dict
    Always overwrites the entire file.
  search_files(pattern: str, target="content", path=".", file_glob=None, limit=50) -> dict
    target: "content" (search inside files) or "files" (find files by name). Returns {"matches": [...]}
  patch(path: str, old_string: str, new_string: str, replace_all: bool = False) -> dict
    Replaces old_string with new_string in the file.
  terminal(command: str, timeout=None, workdir=None) -> dict
    Foreground only (no background/pty). Returns {"output": "...", "exit_code": N}

Limits: 5-minute timeout, 50KB stdout cap, max 50 tool calls per script. terminal() is foreground-only (no background or pty).

Scripts run in the session's working directory with the active venv's python, so project deps (pandas, etc.) and relative paths work like in terminal().

Print your final result to stdout. Use Python stdlib (json, re, math, csv, datetime, collections, etc.) for processing between tool calls.

Also available (no import needed — built into hermes_tools):
  json_parse(text: str) — json.loads with strict=False; use for terminal() output with control chars
  shell_quote(s: str) — shlex.quote(); use when interpolating dynamic strings into shell commands
  retry(fn, max_attempts=3, delay=2) — retry with exponential backoff for transient failures

Python code to execute. Import tools with `from hermes_tools import web_search, terminal, ...` and print your final result to stdout.

Generate high-quality images from text prompts. The underlying backend (FAL, OpenAI, etc.) and model are user-configured and not selectable by the agent. Returns either a URL or an absolute file path in the `image` field; display it with markdown ![description](url-or-path) and the gateway will deliver it.

The text prompt describing the desired image. Be detailed and descriptive.

The aspect ratio of the generated image. 'landscape' is 16:9 wide, 'portrait' is 16:9 tall, 'square' is 1:1.

Get a prompt by name from MCP server 'context7'

Name of the prompt to retrieve

Optional arguments to pass to the prompt

List available prompts from MCP server 'context7'

List available resources from MCP server 'context7'

Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework.

You must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

Workflow: call first without researchMode. If that doesn't answer the question, retry with researchMode: true. Do not call each tool more than 3 times per question.

Exact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'.

The question or task you need help with. Be specific and include relevant details. Good: 'How to set up authentication with JWT in Express.js' or 'React useEffect cleanup function examples'. Bad: 'auth' or 'hooks'. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query.

Retry the query with deep research: spins up sandboxed agents that read the actual source repos and runs a live web search, then synthesizes a fresh answer. Set true on retry if you weren't satisfied with the first answer and want a more thorough one. Requires an API key. You can get one free at https://context7.com.

Read a resource by URI from MCP server 'context7'

URI of the resource to read

Resolves a package/product name to a Context7-compatible library ID and returns matching libraries.

You MUST call this function before 'Query Documentation' tool to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

Each result includes:
- Library ID: Context7-compatible identifier (format: /org/project)
- Name: Library or package name
- Description: Short summary
- Code Snippets: Number of available code examples
- Source Reputation: Authority indicator (High, Medium, Low, or Unknown)
- Benchmark Score: Quality indicator (100 is the highest score)
- Versions: List of versions if available. Use one of those versions if the user provides a version in their query. The format of the version is /org/project/version.

For best results, select libraries based on name match, source reputation, snippet coverage, benchmark score, and relevance to your use case.

Selection Process:
1. Analyze the query to understand what library/package the user is looking for
2. Return the most relevant match based on:
- Name similarity to the query (exact matches prioritized)
- Description relevance to the query's intent
- Documentation coverage (prioritize libraries with higher Code Snippet counts)
- Source reputation (consider libraries with High or Medium reputation more authoritative)
- Benchmark Score: Quality indicator (100 is the highest score)

Response Format:
- Return the selected library ID in a clearly marked section
- Provide a brief explanation for why this library was chosen
- If multiple good matches exist, acknowledge this but proceed with the most relevant one
- If no good matches exist, clearly state this and suggest query refinements

For ambiguous queries, request clarification before proceeding with a best-guess match.

IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best result you have.

The question or task you need help with. This is used to rank library results by relevance to what the user is trying to accomplish. The query is sent to the Context7 API for processing. Do not include any sensitive or confidential information such as API keys, passwords, credentials, personal data, or proprietary code in your query.

Library name to search for and retrieve a Context7-compatible library ID. Use the official library name with proper punctuation — e.g., 'Next.js' instead of 'nextjs', 'Customer.io' instead of 'customerio', 'Three.js' instead of 'threejs'.

memory

Save durable information to persistent memory that survives across sessions. Memory is injected into future turns, so keep it compact and focused on facts that will still matter later.

WHEN TO SAVE (do this proactively, don't wait to be asked):
- User corrects you or says 'remember this' / 'don't do that again'
- User shares a preference, habit, or personal detail (name, role, timezone, coding style)
- You discover something about the environment (OS, installed tools, project structure)
- You learn a convention, API quirk, or workflow specific to this user's setup
- You identify a stable fact that will be useful again in future sessions

PRIORITY: User preferences and corrections > environment facts > procedural knowledge. The most valuable memory prevents the user from having to repeat themselves.

Do NOT save task progress, session outcomes, completed-work logs, or temporary TODO state to memory; use session_search to recall those from past transcripts.
If you've discovered a new way to do something, solved a problem that could be necessary later, save it as a skill with the skill tool.

TWO TARGETS:
- 'user': who the user is -- name, role, preferences, communication style, pet peeves
- 'memory': your notes -- environment facts, project conventions, tool quirks, lessons learned

ACTIONS: add (new entry), replace (update existing -- old_text identifies it), remove (delete -- old_text identifies it).

SKIP: trivial/obvious info, things easily re-discovered, raw data dumps, and temporary task state.

The action to perform.

Which memory store: 'memory' for personal notes, 'user' for user profile.

The entry content. Required for 'add' and 'replace'.

Short unique substring identifying the entry to replace or remove.

Route a hard problem through multiple frontier LLMs collaboratively. Makes 5 API calls (4 reference models + 1 aggregator) with maximum reasoning effort — use sparingly for genuinely difficult problems. Best for: complex math, advanced algorithms, multi-step analytical reasoning, problems benefiting from diverse perspectives.

The complex query or problem to solve using multiple AI models. Should be a challenging problem that benefits from diverse perspectives and collaborative reasoning.

patch

Targeted find-and-replace edits in files. Use this instead of sed/awk in terminal. Uses fuzzy matching (9 strategies) so minor whitespace/indentation differences won't break it. Returns a unified diff. Auto-runs syntax checks after editing.

Replace mode (default): find a unique string and replace it.
Patch mode: apply V4A multi-file patches for bulk changes.

Edit mode: 'replace' for targeted find-and-replace, 'patch' for V4A multi-file patches

File path to edit (required for 'replace' mode)

Text to find in the file (required for 'replace' mode). Must be unique in the file unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'replace' mode). Can be empty string to delete the matched text.

Replace all occurrences instead of requiring a unique match (default: false)

V4A format patch content (required for 'patch' mode). Format:
*** Begin Patch
*** Update File: path/to/file
@@ context hint @@
 context line
-removed line
+added line
*** End Patch

process

Manage background processes started with terminal(background=true). Actions: 'list' (show all), 'poll' (check status + new output), 'log' (full output with pagination), 'wait' (block until done or timeout), 'kill' (terminate), 'write' (send raw stdin data without newline), 'submit' (send data + Enter, for answering prompts), 'close' (close stdin/send EOF).

list poll log wait kill write submit close

Action to perform on background processes

Process session ID (from terminal background output). Required for all actions except 'list'.

Text to send to process stdin (for 'write' and 'submit' actions)

Max seconds to block for 'wait' action. Returns partial output on timeout.

Line offset for 'log' action (default: last 200 lines)

Max lines to return for 'log' action

Read a text file with line numbers and pagination. Use this instead of cat/head/tail in terminal. Output format: 'LINE_NUM|CONTENT'. Suggests similar filenames if not found. Use offset and limit for large files. Reads exceeding ~100K characters are rejected; use offset and limit to read specific sections of large files. NOTE: Cannot read images or binary files — use vision_analyze for images.

Path to the file to read (absolute, relative, or ~/path)

Line number to start reading from (1-indexed, default: 1)

Maximum number of lines to read (default: 500, max: 2000)

Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents.

Content search (target='content'): Regex search inside files. Output modes: full matches with line numbers, file paths only, or match counts.

File search (target='files'): Find files by glob pattern (e.g., '*.py', '*config*'). Also use this instead of ls — results sorted by modification time.

Regex pattern for content search, or glob pattern (e.g., '*.py') for file search

'content' searches inside file contents, 'files' searches for files by name

Directory or file to search in (default: current working directory)

Filter files by pattern in grep mode (e.g., '*.py' to only search Python files)

Maximum number of results to return (default: 50)

Skip first N results for pagination (default: 0)

Output format for grep mode: 'content' shows matching lines with line numbers, 'files_only' lists file paths, 'count' shows match counts per file

Number of context lines before and after each match (grep mode only)

Search your long-term memory of past conversations, or browse recent sessions. This is your recall -- every past session is searchable, and this tool summarizes what happened.

TWO MODES:
1. Recent sessions (no query): Call with no arguments to see what was worked on recently. Returns titles, previews, and timestamps. Zero LLM cost, instant. Start here when the user asks what were we working on or what did we do recently.
2. Keyword search (with query): Search for specific topics across all past sessions. Returns LLM-generated summaries of matching sessions.

USE THIS PROACTIVELY when:
- The user says 'we did this before', 'remember when', 'last time', 'as I mentioned'
- The user asks about a topic you worked on before but don't have in current context
- The user references a project, person, or concept that seems familiar but isn't in memory
- You want to check if you've solved a similar problem before
- The user asks 'what did we do about X?' or 'how did we fix Y?'

Don't hesitate to search when it is actually cross-session -- it's fast and cheap. Better to search and confirm than to guess or ask the user to repeat themselves.

Search syntax: keywords joined with OR for broad recall (elevenlabs OR baseten OR funding), phrases for exact match ("docker networking"), boolean (python NOT java), prefix (deploy*). IMPORTANT: Use OR between keywords for best results — FTS5 defaults to AND which misses sessions that only mention some terms. If a broad OR query returns nothing, try individual keyword searches in parallel. Returns summaries of the top matching sessions.

Search query — keywords, phrases, or boolean expressions to find in past sessions. Omit this parameter entirely to browse recent sessions instead (returns titles, previews, timestamps with no LLM cost).

Optional: only search messages from specific roles (comma-separated). E.g. 'user,assistant' to skip tool outputs.

Max sessions to summarize (default: 3, max: 5).

Manage skills (create, update, delete). Skills are your procedural memory — reusable approaches for recurring task types. New skills go to ~/.hermes/skills/; existing skills can be modified wherever they live.

Actions: create (full SKILL.md + optional category), patch (old_string/new_string — preferred for fixes), edit (full SKILL.md rewrite — major overhauls only), delete, write_file, remove_file.

Create when: complex task succeeded (5+ calls), errors overcome, user-corrected approach worked, non-trivial workflow discovered, or user asks you to remember a procedure.
Update when: instructions stale/wrong, OS-specific failures, missing steps or pitfalls found during use. If you used a skill and hit issues not covered by it, patch it immediately.

After difficult/iterative tasks, offer to save as a skill. Skip for simple one-offs. Confirm with user before creating/deleting.

Good skills: trigger conditions, numbered steps with exact commands, pitfalls section, verification steps. Use skill_view() to see format examples.

create patch edit delete write_file remove_file

The action to perform.

Skill name (lowercase, hyphens/underscores, max 64 chars). Must match an existing skill for patch/edit/delete/write_file/remove_file.

Full SKILL.md content (YAML frontmatter + markdown body). Required for 'create' and 'edit'. For 'edit', read the skill first with skill_view() and provide the complete updated text.

Text to find in the file (required for 'patch'). Must be unique unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'patch'). Can be empty string to delete the matched text.

For 'patch': replace all occurrences instead of requiring a unique match (default: false).

Optional category/domain for organizing the skill (e.g., 'devops', 'data-science', 'mlops'). Creates a subdirectory grouping. Only used with 'create'.

Path to a supporting file within the skill directory. For 'write_file'/'remove_file': required, must be under references/, templates/, scripts/, or assets/. For 'patch': optional, defaults to SKILL.md if omitted.

Content for the file. Required for 'write_file'.

Skills allow for loading information about specific tasks and workflows, as well as scripts and templates. Load a skill's full content or access its linked files (references, templates, scripts). First call returns SKILL.md content plus a 'linked_files' dict showing available references/templates/scripts. To access those, call again with file_path parameter.

The skill name (use skills_list to see available skills). For plugin-provided skills, use the qualified form 'plugin:skill' (e.g. 'superpowers:writing-plans').

OPTIONAL: Path to a linked file within the skill (e.g., 'references/api.md', 'templates/config.yaml', 'scripts/validate.py'). Omit to get the main SKILL.md content.

List available skills (name + description). Use skill_view(name) to load full content.

Optional category filter to narrow results

terminal

Execute shell commands on a Linux environment. Filesystem usually persists between calls.

Do NOT use cat/head/tail to read files — use read_file instead.
Do NOT use grep/rg/find to search — use search_files instead.
Do NOT use ls to list directories — use search_files(target='files') instead.
Do NOT use sed/awk to edit files — use patch instead.
Do NOT use echo/cat heredoc to create files — use write_file instead.
Reserve terminal for: builds, installs, git, processes, scripts, network, package managers, and anything that needs a shell.

Foreground (default): Commands return INSTANTLY when done, even if the timeout is high. Set timeout=300 for long builds/scripts — you'll still get the result in seconds if it's fast. Prefer foreground for short commands.
Background: Set background=true to get a session_id. Two patterns:
  (1) Long-lived processes that never exit (servers, watchers).
  (2) Long-running tasks with notify_on_complete=true — you can keep working on other things and the system auto-notifies you when the task finishes. Great for test suites, builds, deployments, or anything that takes more than a minute.
For servers/watchers, do NOT use shell-level background wrappers (nohup/disown/setsid/trailing '&') in foreground mode. Use background=true so Hermes can track lifecycle and output.
After starting a server, verify readiness with a health check or log signal, then run tests in a separate terminal() call. Avoid blind sleep loops.
Use process(action="poll") for progress checks, process(action="wait") to block until done.
Working directory: Use 'workdir' for per-command cwd.
PTY mode: Set pty=true for interactive CLI tools (Codex, Claude Code, Python REPL).

Do NOT use vim/nano/interactive tools without pty=true — they hang without a pseudo-terminal. Pipe git output to cat if it might page.

The command to execute on the VM

Run the command in the background. Two patterns: (1) Long-lived processes that never exit (servers, watchers). (2) Long-running tasks paired with notify_on_complete=true — you can keep working and get notified when the task finishes. For short commands, prefer foreground with a generous timeout instead.

Max seconds to wait (default: 180, foreground max: 600). Returns INSTANTLY when command finishes — set high for long tasks, you won't wait unnecessarily. Foreground timeout above 600s is rejected; use background=true for longer commands.

Working directory for this command (absolute path). Defaults to the session working directory.

Run in pseudo-terminal (PTY) mode for interactive CLI tools like Codex, Claude Code, or Python REPL. Only works with local and SSH backends. Default: false.

When true (and background=true), you'll be automatically notified exactly once when the process finishes. **This is the right choice for almost every long-running task** — tests, builds, deployments, multi-item batch jobs, anything that takes over a minute and has a defined end. Use this and keep working on other things; the system notifies you on exit. MUTUALLY EXCLUSIVE with watch_patterns — when both are set, watch_patterns is dropped.

Strings to watch for in background process output. HARD RATE LIMIT: at most 1 notification per 15 seconds per process — matches arriving inside the cooldown are dropped. After 3 consecutive 15-second windows with dropped matches, watch_patterns is automatically disabled for that process and promoted to notify_on_complete behavior (one notification on exit, no more mid-process spam). USE ONLY for truly rare, one-shot mid-process signals on LONG-LIVED processes that will never exit on their own — e.g. ['Application startup complete'] on a server so you know when to hit its endpoint, or ['migration done'] on a daemon. DO NOT use for: (1) end-of-run markers like 'DONE'/'PASS' — use notify_on_complete instead; (2) error patterns like 'ERROR'/'Traceback' in loops or multi-item batch jobs — they fire on every iteration and you'll hit the strike limit fast; (3) anything you'd ever combine with notify_on_complete. When in doubt, choose notify_on_complete. MUTUALLY EXCLUSIVE with notify_on_complete — set one, not both.

Convert text to speech audio. Returns a MEDIA: path that the platform delivers as a voice message. On Telegram it plays as a voice bubble, on Discord/WhatsApp as an audio attachment. In CLI mode, saves to ~/voice-memos/. Voice and provider are user-configured, not model-selected.

The text to convert to speech. Provider-specific character caps apply and are enforced automatically (OpenAI 4096, xAI 15000, MiniMax 10000, ElevenLabs 5k-40k depending on model); over-long input is truncated.

Optional custom file path to save the audio. Defaults to ~/.hermes/audio_cache/<timestamp>.mp3

todo

Manage your task list for the current session. Use for complex tasks with 3+ steps or when the user provides multiple tasks. Call with no parameters to read the current list.

Writing:
- Provide 'todos' array to create/update items
- merge=false (default): replace the entire list with a fresh plan
- merge=true: update existing items by id, add any new ones

Each item: {id: string, content: string, status: pending|in_progress|completed|cancelled}
List order is priority. Only ONE item in_progress at a time.
Mark items completed immediately when done. If something fails, cancel it and add a revised item.

Always returns the full current list.

Task items to write. Omit to read current list.

Unique item identifier

Task description

Current status

true: update existing items by id, add new ones. false (default): replace the entire list.

Inspect an image from a URL, file path, or tool output when you need closer detail than what's visible in the conversation. If the user's image is already attached to the conversation and you can see it, just answer directly — only call this tool for images referenced by URL/path, images returned inside other tool results (browser screenshots, search thumbnails), or when you need a deeper look at a specific region the main model's vision may have missed.

Image URL (http/https) or local file path to analyze.

Your specific question or request about the image to resolve. The AI will automatically provide a complete image description AND answer your specific question.

Extract content from web page URLs. Returns page content in markdown format. Also works with PDF URLs (arxiv papers, documents, etc.) — pass the PDF link directly and it converts to markdown text. Pages under 5000 chars return full markdown; larger pages are LLM-summarized and capped at ~5000 chars per page. Pages over 2M chars are refused. If a URL fails or times out, use the browser tool to access it instead.

List of URLs to extract content from (max 5 URLs per call)

Search the web for information on any topic. Returns up to 5 relevant results with titles, URLs, and descriptions.

The search query to look up on the web

Write content to a file, completely replacing existing content. Use this instead of echo/cat heredoc in terminal. Creates parent directories automatically. OVERWRITES the entire file — use 'patch' for targeted edits.

Path to the file to write (will be created if it doesn't exist, overwritten if it does)

Complete content to write to the file

Retrieve or update a peer card from Honcho — a curated list of key facts about that peer (name, role, preferences, communication style, patterns). Pass `card` to update; omit `card` to read.  If the card is empty, the result includes a `hint` field explaining why (observation disabled, fresh peer, dialectic layer still warming up, etc.) — this is NOT an error.  Peer cards accumulate over time from observed conversation.

Peer to query. Built-in aliases: 'user' (default), 'ai'. Or pass any peer ID from this workspace.

New peer card as a list of fact strings. Omit to read the current card.

Semantic search over Honcho's stored context about a peer. Returns raw excerpts ranked by relevance — no LLM synthesis. Cheaper and faster than honcho_reasoning. Good when you want to find specific past facts and reason over them yourself.

What to search for in Honcho's memory.

Token budget for returned context (default 800, max 2000).

Ask Honcho a natural language question and get a synthesized answer. Uses Honcho's LLM (dialectic reasoning) — higher cost than honcho_profile or honcho_search. Can query about any peer via alias or explicit peer ID. Pass reasoning_level to control depth: minimal (fast/cheap), low (default), medium, high, max (deep/expensive). Omit for configured default.

A natural language question.

Override the default reasoning depth. Omit to use the configured default (typically low). Guide:
- minimal: quick factual lookups (name, role, simple preference)
- low: straightforward questions with clear answers
- medium: multi-aspect questions requiring synthesis across observations
- high: complex behavioral patterns, contradictions, deep analysis
- max: thorough audit-level analysis, leave no stone unturned

Retrieve full session context from Honcho — summary, peer representation, peer card, and recent messages. No LLM synthesis. Cheaper than honcho_reasoning. Use this to see what Honcho knows about the current conversation and the specified peer.

Optional focus query to filter context. Omit for full session context snapshot.

Write or delete a conclusion about a peer in Honcho's memory. Conclusions are persistent facts that build a peer's profile. You MUST pass exactly one of: `conclusion` (to create) or `delete_id` (to delete). Passing neither is an error. Deletion is only for PII removal — Honcho self-heals incorrect conclusions over time.

A factual statement to persist. Provide this when creating a conclusion. Do not send it together with delete_id.

Conclusion ID to delete for PII removal. Provide this when deleting a conclusion. Do not send it together with conclusion.


[Note: model was just switched from gpt-5.5 to x-ai/grok-4.20 via OpenRouter. Adjust your self-identification accordingly.]

Que modelo es este


Explanation:
The user asked: "Que modelo es este" which means "What model is this" in Spanish.
I see the user asking "Que modelo es este," which translates to "What model is this" in English. The context tells me the model just switched from gpt-5.5 to x-ai/grok-4.

Question: model switch OR grok-4.20 OR "x-ai/grok" OR "current model"


Location: Colegiales (near Parque Ferroviario), Buenos Aires, Argentina

Occupation: Developer (hermes-webui, AI agents like 'Pipo')

Family: Married to Tina (German-speaking); expecting a child in ~July 2026 (Tina at ~31 weeks as of late April 2026)

TRAIT: Results-oriented and intolerant of AI "laziness" or meta-explanations for failure; expects agents to be "unstoppable" (imparable)

TRAIT: High attention to detail in visual/UI design iterations; manages creative tasks with granular feedback loop

TRAIT: Pragmatic and generally cost-conscious, but prioritizes specific model versions (e.g., Gemini 3.0) for reliability over cheaper alternatives

TRAIT: Prefers direct, no-filler communication; values "honesty" in AI interactions but without excuses

TRAIT: Family-oriented and attentive to personal milestones

TRAIT: Maintains work-life integration (develops projects while traveling)

TRAIT: Tends to develop in large uncommitted code bursts (e.g., ~3000 lines)

TRAIT: Technically creative with infrastructure (Oracle Cloud, Tailscale, SSH tunnels)

TRAIT: Professional communication reflects Argentine social/labor values (e.g., using "compañeros")

PREFERENCE: Does not use Apple devices (Windows/Ubuntu/Android setup)

PREFERENCE: Uses Bitwarden for credential management

PREFERENCE: Microsoft Teams for professional communication

PREFERENCE: Text responses by default (to save tokens); audio only when requested

PREFERENCE: Prioritizes local Argentine identity (accent, local exit nodes, project themes like political satire/Panini album)

PREFERENCE: High-quality TTS from ElevenLabs/OpenAI with Argentine accent

PREFERENCE: Frequently travels to Argentine Patagonia (Bariloche, San Martín de los Andes, Villa La Angostura)

PREFERENCE: Uses Vercel and Supabase for web deployment and infrastructure

PREFERENCE: Uses OpenRouter for multi-model access (DeepSeek, Gemini, Nano Banana) with personal API keys

INSTRUCTION: Use DeepSeek as daily driver, with secondary models for vision tasks via OpenRouter

INSTRUCTION: Use Argentine exit node (Pixel 6a via Tailscale) for scraping local sites


Question: model switch OR grok-4.20 OR "x-ai/grok" OR "current model"

Summary:
The user asked why the CLI displayed this on startup:

```text
Initializing agent...
?[33m⚠  Stripped provider prefix from ?[0m?[33m'openai/gpt-5.4'?[0m?[33m; using ?[0m?[33m'gpt-5.4'?[0m?[33m for OpenAI Codex.?[0m
```

The investigation found two separate behaviors:

1. `Initializing agent...` was intentional startup output.
   - Located in `hermes-agent/cli.py` around line `6314`:
     ```python
     _cprint(f"{_DIM}Initializing agent...{_RST}")
     ```
   - This was shown when the CLI initialized the agent for the first message.

2. The warning about stripping `openai/` was intentional model normalization for OpenAI Codex.
   - Located in `hermes-agent/cli.py` around lines `1738-1746`:
     ```python
     if "/" in current_model:
         slug = current_model.split("/", 1)[1]
         if not self._model_is_default:
             self.console.print(
                 f"[yellow]⚠  Stripped provider prefix from '{current_model}'; "
                 f"using '{slug}' for OpenAI Codex.[/]"
             )
         self.model = slug
     ```
   - Hermes was taking `openai/gpt-5.4` and converting it to the bare slug `gpt-5.4` because the `openai-codex` provider expected the model without the provider prefix.

The odd `?[33m` / `?[0m` text was identified as broken ANSI color escape rendering. The warning itself was harmless; the terminal/log surface was not interpreting ANSI color codes correctly.

The user then asked the assistant to change it. A search found the active config setting:

```text
/home/ubuntu/.hermes/config.yaml
line 1: model: openai/gpt-5.4
```

The assistant read the config and confirmed the top of the file contained:

```yaml
model: openai/gpt-5.4
providers:
  blockrun:
    api: http://127.0.0.1:8402/v1
```

An attempted Python-based edit/validation failed because `python` was not installed:

```text
/usr/bin/bash: line 9: python: command not found
```

The assistant then patched the file directly:

```diff
--- a//home/ubuntu/.hermes/config.yaml
+++ b//home/ubuntu/.hermes/config.yaml
@@ -1,4 +1,4 @@
-model: openai/gpt-5.4
+model: gpt-5.4
 providers:
   blockrun:
     api: http://127.0.0.1:8402/v1
```

The file was re-read and confirmed:

```yaml
model: gpt-5.4
providers:
  blockrun:
```

A later attempt to validate with YAML parsing failed because the Python `yaml` module was unavailable:

```text
ModuleNotFoundError: No module named 'yaml'
```

The final conclusion was that `~/.hermes/config.yaml` had been changed from `openai/gpt-5.4` to `gpt-5.4`, which should stop the “Stripped provider prefix” warning for OpenAI Codex. The remaining `Initializing agent...` message was normal and expected. The user was advised that if the warning still appeared in an already-open CLI/WebUI session, they should restart the session so Hermes reloaded the config.

No Grok-specific model such as `grok-4.20` or `x-ai/grok` was configured or changed in this transcript; the actual model switch/current-model issue centered on `openai/gpt-5.4` being normalized to `gpt-5.4`.

Summary:
The conversation focused on figuring out the active/default model configuration and related provider routing for Kimi/Moonshot and Grok/xAI.

1. **What the user wanted**
   - The user was investigating “model switch”, `grok-4.20`, `"x-ai/grok"`, and `"current model"` behavior in a Hermes CLI session.
   - The goal appeared to be understanding which model/provider was currently configured, how model switching resolved providers, and whether Kimi/Moonshot or Grok/xAI models were available/configured correctly.

2. **Actions taken and outcomes**
   - Session files under `/home/ubuntu/.hermes/sessions/` were searched for references to “current model”, model switching, and xAI/Grok.
   - A previous session was found where the assistant had said:
     - Current runtime model: `qwen/qwen3.6-plus:free`
     - Default model: `kimi-coding/k2p5`
     - File: `/home/ubuntu/.hermes/sessions/session_b1408a7c-245a-4fa7-ba7a-5f8b9777625d.json`
     - Lines around `929–930`.
   - The Hermes config was inspected. Important config found:
     ```yaml
     model:
       default: kimi-k2.5
       provider: kimi-coding
       base_url: https://api.moonshot.ai/v1
     ```
   - Another model/profile-like YAML snippet showed:
     ```yaml
     ---
     - model: kimi-k2.5
       provider: kimi-coding
       base_url: https://api.moonshot.ai/v1
     - model: MiniMax-M2.7
       provider: minimax
     credential_pool_strategies:
       kimi-coding: fill_first
     toolsets:
     - hermes-cli
     agent:
       max_turns: 150
     ```
   - The full config around lines `280–380` showed memory, delegation, command allowlist, approvals, and toolset settings, including:
     - `memory.provider: honcho`
     - `memory_char_limit: 2200`
     - `delegation.orchestrator_enabled: true`
     - `delegation.default_toolsets: terminal, file, web`
     - `approvals.mode: manual`

3. **Credential/API key investigation**
   - Environment and Bitwarden were checked for Kimi/Moonshot keys.
   - One terminal check printed redacted values:
     ```text
     CUSTOM_API_MOONSHOT_AI_API_KEY=***
     CUSTOM_API_MOONSHOT_AI_API_KEY=***
     ```
   - Later sandboxed checks reported no visible Kimi/Moonshot env vars:
     ```text
     MOONSHOT_API_KEY: NOT SET
     CUSTOM_API_MOONSHOT_AI_API_KEY: NOT SET
     KIMI_API_KEY: NOT SET
     KIMI_CODING_API_KEY: NOT SET
     ```
   - Bitwarden access failed because the vault was locked:
     ```json
     {
       "status": "locked",
       "userEmail": "ignaciolagosruiz+pipo@gmail.com"
     }
     ```
   - `BW_SESSION` was not set.
   - A Bitwarden command also failed with:
     ```text
     error: unknown option '--output'
     ```
   - No `api_keys` section was found in config:
     ```text
     no api_keys
     ```

4. **Hermes code/provider routing details found**
   - The Hermes agent repo was identified at:
     ```text
     /home/ubuntu/.hermes/hermes-agent
     ```
   - `AGENTS.md` was discovered and described important files:
     - `run_agent.py`
     - `cli.py`
     - `agent/credential_pool.py`
     - `agent/auxiliary_client.py`
     - `hermes_cli/auth.py`
     - `api/config.py`
   - Provider aliases in `agent/auxiliary_client.py` included:
     ```python
     "x-ai": "xai",
     "x.ai": "xai",
     "grok": "xai",
     "kimi": "kimi-coding",
     "moonshot": "kimi-coding",
     ```
   - Kimi/Moonshot-specific logic was found:
     - `hermes_cli/auth.py` expected Kimi env vars:
       ```python
       api_key_env_vars=("KIMI_API_KEY", "KIMI_CODING_API_KEY")
       ```
     - `_resolve_kimi_base_url()` routed `sk-kimi-` keys to the coding endpoint:
       ```python
       if api_key.startswith("sk-kimi-"):
           return KIMI_CODE_BASE_URL
       ```
     - The Kimi coding base URL constant was:
       ```text
       https://api.kimi.com/coding
       ```
   - `agent/moonshot_schema.py` handled Moonshot’s stricter tool schema requirements, including:
     - Every property schema needed a `type`.
     - `anyOf` children needed types instead of the parent schema.
     - This avoided HTTP 400 errors like:
       ```text
       tools.function.parameters is not a valid moonshot flavored json schema
       ```

5. **Credential pool behavior**
   - `agent/credential_pool.py` was inspected.
   - Supported strategies included:
     ```python
     fill_first
     round_robin
     random
     least_used
     ```
   - For `kimi-coding`, config used:
     ```yaml
     credential_pool_strategies:
       kimi-coding: fill_first
     ```
   - Exhausted credentials, including HTTP `429` and `402`, cooled down for one hour:
     ```python
     EXHAUSTED_TTL_429_SECONDS = 60 * 60
     EXHAUSTED_TTL_DEFAULT_SECONDS = 60 * 60
     ```
   - `_select_unlocked()` selected available credentials based on strategy, with `fill_first` effectively choosing the first available entry.

6. **Model-switching / resolver details**
   - `api/config.py` contained `resolve_model_provider(model_id: str)`.
   - It handled dropdown/model IDs in formats such as:
     ```text
     claude-sonnet-4.6
     anthropic/claude-sonnet-4.6
     @minimax:MiniMax-M2.7
     ```
   - The comments explained that `@provider:model` was used for explicit provider routing from the model dropdown.
   - Tests in `test_model_resolver.py` verified behavior such as:
     - `openrouter/free` must remain `openrouter/free` when provider is OpenRouter.
     - OpenRouter-style provider/model paths like `anthropic/claude-sonnet-4.6` stayed intact when routed through OpenRouter.
     - Direct-provider models stripped provider prefixes where appropriate.

7. **Grok/xAI findings**
   - A model list in `skills/red-teaming/godmode/scripts/godmode_race.py` included xAI/Grok models:
     ```python
     'x-ai/grok-code-fast-1'
     'x-ai/grok-4-fast'
     'x-ai/grok-4.1-fast'
     ```
   - The searched transcript did not show a concrete `grok-4.20` configuration or successful switch to that exact model.
   - The important conclusion was that aliases like `x-ai`, `x.ai`, and `grok` normalized to provider `xai`, but no final working `grok-4.20` setup was confirmed in the visible transcript.

8. **Notable errors / unresolved items**
   - Bitwarden remained locked, so stored secrets could not be retrieved.
   - There was inconsistency between a direct terminal environment check showing `CUSTOM_API_MOONSHOT_AI_API_KEY=***` and later sandboxed checks showing Kimi/Moonshot env vars unset.
   - A recursive `grep` over the Hermes agent repo timed out once:
     ```text
     subprocess.TimeoutExpired: Command '['grep', '-r', '--include=*.py', '-l', 'kimi', '/home/ubuntu/.hermes/hermes-agent']' timed out after 10 seconds
     ```
   - A Python regex search failed due to inline flags in the wrong position:
     ```text
     re.error: global flags not at the start of the expression at position 8
     ```
   - No definitive model switch to `grok-4.20` was completed in the visible transcript.
   - The main confirmed default model was `kimi-k2.5` via provider `kimi-coding` with base URL `https://api.moonshot.ai/v1`, while an older session had run on `qwen/qwen3.6-plus:free`.

Summary:
The user had originally asked, in a previous timed-out session, to make the Hermes WebUI allow changing Agent Profile defaults from the UI: model, provider, skills/toolsets, API keys, etc. The review found that the earlier work had survived in `~/hermes-webui` as uncommitted changes plus one stash.

Key outcomes before the model-switch topic:
- The codebase had ~2,729 uncommitted lines across 12 files, plus one stash with ~213 lines.
- Features found mostly implemented:
  - Backend `GET/POST /api/profile/config` for reading/writing profile `config.yaml` and `.env`
  - Settings UI tabs: **General**, **Agent**, **API Keys**
  - Agent config fields: model, provider, base URL, reasoning effort, max turns, system prompt, personality, toolsets
  - API key editing with masked keys
  - Embedded terminal via `static/terminal.js` and iframe/ttyd-related CSS
- A bug was found and fixed in `api/routes.py`:
  ```python
  if val is None and val == '':
  ```
  was changed to use `or`, because the original condition was always false.
- The stash could not be popped because it would overwrite files:
  ```text
  api/config.py
  static/index.html
  static/panels.js
  static/style.css
  ```
  It was inspected and determined to be an older snapshot of changes already superseded by the working tree.
- The stash was dropped:
  ```bash
  git stash drop
  ```
  Output:
  ```text
  Dropped stash@{0} (96db1f95a93782f467fa31367ab0ada958747aba)
  ```
- Python syntax was checked successfully:
  ```text
  All clean
  ```
- Git commit initially failed because identity was unset:
  ```text
  Author identity unknown
  fatal: unable to auto-detect email address (got 'ubuntu@miopenclaw-vnic.(none)')
  ```
- Git identity was configured/retrieved using email:
  ```text
  nesquena+hermes@gmail.com
  ```
- Final commit:
  ```bash
  git commit -m "release: v0.39.0 — agent profile editor, API key management, reasoning effort, embedded terminal"
  ```
  Result:
  ```text
  [master c64c58b] release: v0.39.0 — agent profile editor, API key management, reasoning effort, embedded terminal
   15 files changed, 3008 insertions(+), 305 deletions(-)
   create mode 100644 static/terminal.js
   create mode 100644 tests/test_session_reasoning.py
   create mode 100644 tests/test_streaming_errors.py
  ```

Focus on the model switch / current model issue:
- After the commit, the user asked why the CLI/WebUI was showing OpenRouter rate-limit errors even though they believed the conversation had been manually set to use Kimi.
- The error shown by the user was:
  ```text
  ⚠  API call failed (attempt 1/3): RateLimitError [HTTP 429]
     🔌 Provider: openrouter  Model: qwen/qwen3.6-plus:free
     🌐 Endpoint: https://openrouter.ai/api/v1/
     📝 Error: HTTP 429: Provider returned error
     📋 Details: {'message': 'Provider returned error', 'code': 429, 'metadata': {'raw': 'qwen/qwen3.6-plus:free is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations', 'provider_name': 'Alibaba', 'is_byok': False}}
  ⏱ Rate limit reached. Waiting 2s before retry (attempt 2/3)...
  ```
- The assistant checked the active Hermes config and profile:
  ```bash
  cd ~/.hermes && yq '.model' config.yaml
  ```
  It showed:
  ```yaml
  model:
    default: kimi-k2.5
    provider: kimi-coding
    base_url: https://api.moonshot.ai/v1
  ```
  Active profile:
  ```text
  default
  ```
- The assistant then checked the WebUI-specific settings file:
  ```bash
  cat ~/.hermes/webui/settings.json
  ```
  It showed:
  ```json
  {
    "default_model": "qwen/qwen3.6-plus:free",
    "default_workspace": "/home/ubuntu/.hermes/webui/workspace",
    "send_key": "enter",
    "show_token_usage": true,
    "show_cli_sessions": true,
    "sync_to_insights": true,
    "check_for_updates": true,
    "theme": "nord",
    "bot_name": "Hermes",
    "password_hash": null
  }
  ```
- Conclusion reached: the active `config.yaml` correctly pointed to Kimi, but the WebUI had its own `settings.json` with:
  ```json
  "default_model": "qwen/qwen3.6-plus:free"
  ```
  That WebUI setting was overriding the agent/profile config and causing requests to go to OpenRouter with the Qwen free model.
- The user insisted that models should be synchronized through platforms/profiles, and that if a model hit rate limits more than 3 times it should automatically switch to a working model without bothering the user.
- The assistant inspected rate-limit and fallback-related code in `api/streaming.py`:
  ```bash
  grep -n "rate\|fallback" api/streaming.py
  ```
  Relevant existing code:
  ```python
  # Fallback model from profile config (e.g. for rate-limit recovery)
  _fallback = _cfg.get('fallback_model') or None
  ...
  fallback_model=_fallback_resolved,
  ...
  is_rate_limit = 'rate limit' in err_str.lower() or '429' in err_str or 'RateLimitError' in type(e).__name__
  if is_rate_limit:
      hint = 'Rate limit reached. The fallback model (if configured) was also exhausted. Try again in a moment.'
  ```
- The assistant also inspected `api/config.py` around settings persistence. It found that `_SETTINGS_DEFAULTS` still included:
  ```python
  'default_model': DEFAULT_MODEL,
  ```
  and `save_settings()` updated runtime defaults:
  ```python
  global DEFAULT_MODEL, DEFAULT_WORKSPACE
  if 'default_model' in current:
      DEFAULT_MODEL = current['default_model']
  ```
  Startup also applied the saved setting:
  ```python
  _startup_settings = load_settings()
  if SETTINGS_FILE.exists():
      if _startup_settings.get('default_model'):
          DEFAULT_MODEL = _startup_settings['default_model']
  ```
- This confirmed the root cause: `~/.hermes/webui/settings.json` was allowed to override the profile’s `config.yaml` default model.

Actions taken on the model sync issue:
- The assistant removed the stale WebUI `default_model` from the runtime settings file:
  ```diff
  --- a//home/ubuntu/.hermes/webui/settings.json
  +++ b//home/ubuntu/.hermes/webui/settings.json
  @@ -1,5 +1,4 @@
   {
  -  "default_model": "qwen/qwen3.6-plus:free",
     "default_workspace": "/home/ubuntu/.hermes/webui/workspace",
  ```
- The assistant attempted to patch the wrong path first:
  ```text
  /home/ubuntu/.hermes-webui/api/config.py
  ```
  which failed:
  ```text
  Failed to read file: /home/ubuntu/.hermes-webui/api/config.py
  ```
- Then it patched the correct path:
  ```text
  /home/ubuntu/hermes-webui/api/config.py
  ```
- The first successful code change removed `default_model` from `_SETTINGS_DEFAULTS`:
  ```diff
  _SETTINGS_DEFAULTS = {
  -    'default_model': DEFAULT_MODEL,
  +    # default_model removed — Hermes config.yaml is the single source of truth
       'default_workspace': str(DEFAULT_WORKSPACE),
  ```
- The assistant’s stated intended plan was:
  1. Make `config.yaml` the single source of truth for the model.
  2. Stop `settings.json` from accepting or overriding `default_model`.
  3. Add automatic fallback/model switch on rate limit: after repeated failures, switch to a working fallback model without prompting the user.
  4. Notify the frontend via SSE when fallback was triggered.

Important files/paths involved:
- Profile config:
  ```text
  ~/.hermes/config.yaml
  ```
  with:
  ```yaml
  model:
    default: kimi-k2.5
    provider: kimi-coding
    base_url: https://api.moonshot.ai/v1
  ```
- WebUI settings causing the bad current model:
  ```text
  ~/.hermes/webui/settings.json
  ```
  stale bad value:
  ```json
  "default_model": "qwen/qwen3.6-plus:free"
  ```
- Main WebUI repo:
  ```text
  ~/hermes-webui
  ```
- Files inspected/modified for model sync and fallback:
  ```text
  api/config.py
  api/streaming.py
  api/routes.py
  static/index.html
  static/panels.js
  static/style.css
  static/terminal.js
  ```
- Relevant functions/classes:
  ```python
  load_settings()
  save_settings()
  reload_config()
  resolve_model_provider()
  clamp_reasoning_effort()
  _run_agent_streaming()
  AIAgent(... fallback_model=..., reasoning_config=...)
  ```

Unresolved/notable at transcript end:
- The transcript was truncated while `api/config.py` was being patched. It showed only the first successful change removing `default_model` from `_SETTINGS_DEFAULTS`.
- It was not shown whether the assistant completed:
  - Removing `default_model` from `_SETTINGS_ALLOWED_KEYS`
  - Removing `DEFAULT_MODEL` override logic from `save_settings()`
  - Removing startup override from `_startup_settings`
  - Adding automatic fallback/model switch after 3 rate limits
  - Adding frontend/SSE notification for fallback switch
  - Running tests after those changes
  - Committing/deploying the follow-up model-sync/fallback fix
- No references to `grok-4.20`, `x-ai/grok`, or a Grok-specific model switch appeared in the visible transcript. The concrete “current model” issue was OpenRouter/Qwen being used because of stale WebUI `settings.json`, while the intended/current profile model was Kimi:
  ```text
  kimi-k2.5 via provider kimi-coding at https://api.moonshot.ai/v1
  ```


**Este es x-ai/grok-4.20 vía OpenRouter.**

Acaban de cambiarlo desde gpt-5.5. Ya ajusté mi identificación interna.

¿Seguimos con el Lobby Tracker o con lo que necesites?

Explanation: The user asked: "Que modelo es este" which is Spanish for "What model is this?"


[The user sent an image~ Here's what I can see:
Here's a detailed description of the image:

**Overall Layout and Composition:**

*   The image shows an open German passport. The left page features a photograph of a woman, and both pages contain printed text and fields for personal information. The passport is open to the identification page.

**Left Page (Photograph Side):**

*   **Photograph:** A color photograph of a fair-skinned woman with light blonde hair. She is facing forward with a neutral expression.
*   **Text Fields:**
    *   "Typ/Type/Type" with the value "P"
    *   "Kode/Code/Code" with the value "D"
    *   "1. Name/Surname/Nom" with the value "KORF"
    *   "2. Vornamen/Given names/Prénoms" with the value "CHRISTINA MONIKA"
    *   "3. Staatsangehörigkeit/Nationality/Nationalité" with the value "DEUTSCH"
    *   "5. Geschlecht/Sex/Sexe" with the value "F"
    *   "7. Ausstellungsdatum/Date of issue/Date de délivrance" with the value "29.09.2016"
    *   "9. Behörde/Authority/Autorité" with the value "GEMEINDE VATERSTETTEN"
    *   "10. Unterschrift der Inhaberin/des Inhabers-Signature of bearer Signature de la titulaire/du titulaire" with a signature that appears to read "Korf"
*   **Machine-Readable Zone (MRZ):** At the bottom of the page, there's a machine-readable zone with the following data:
    *   "P<D<<KORF<<CHRISTINA<MONIKA<<<<<<<<<<<<<<<<<"
    *   "CF3NT5LLT4D<<9104288F2609289<<<<<<<<<<<<<<<4"

**Right Page (Text Side):**

*   **Text Fields:**
    *   "Pass-Nr./Passport No./Passeport N°" with the value "CF3NT5LLT"
    *   "4. Geburtstag/Date of birth/Date de naissance" with the value "28.04.1991"
    *   "6. Geburtsort/Place of birth/Lieu de naissance" with the value "WILDESHAUSEN"
    *   "8. Gültig bis/Date of expiry/Date d'expiration" with the value "28.09.2026"
    *   "11. Wohnort/Residence/Domicile" with the value "VATERSTETTEN"
    *   "11. Wohnort/Residence/Domicile" with the value "Oldenburg (Oldb)"
    *   "12. Größe/Height/Taille" with the value "174 cm"
    *   "13. Augenfarbe/Colour of eyes/Couleur des yeux" with the value "GRÜN"
    *   "14. Ordens oder Künstlername/Religious name or pseudonym/Nom de religion ou pseudonyme" (This field is blank)
*   **Stamp:** There is a circular stamp with an eagle and the text "STADT OLDENBURG" on the right page.

**Colors and Materials:**

*   The passport cover is a dark red or burgundy color.
*   The inside pages have a light beige or off-white background with a subtle patterned design.
*   The text is primarily in black ink.

**Additional Details:**

*   The text is in German, English, and French, indicating the passport's multilingual format.
*   The passport appears to be in good condition, with no visible tears or significant damage.
*   The image is well-lit and in focus, allowing for clear visibility of the details.]
[If you need a closer look, use vision_analyze with image_url: /home/ubuntu/.hermes/image_cache/img_17cbca040e22.jpg ~]

[The user sent an image~ Here's what I can see:
Here's a detailed description of the image:

**Overall Impression:**

The image shows a German residence permit (Aufenthaltstitel) card lying on a light-colored, possibly wooden, surface. The card is rectangular with rounded corners and contains a photograph of a man, along with various personal details and security features.

**Card Details:**

*   **Top Left:** The letter "D" in a blue square, likely representing Germany (Deutschland). Below it is the alphanumeric code "YZ1MLJLV5".
*   **Top Center:** The words "AUFENTHALTSTITEL" in bold, indicating "Residence Permit" in German.
*   **Top Right:** The alphanumeric code "YZ1MLJLV5" is repeated.
*   **Background:** The card has a complex background pattern with fine lines, geometric shapes, and possibly holographic elements. There are repeating phrases "DEUTSCHLAND BUNDESREPUBLIK DEUTSCHLAND BUNDESREPUBLIK"
*   **Photo:** A color photograph of a man with dark hair, a beard, and light eyes. The photo is partially obscured by a holographic overlay that creates a green, distorted effect.
*   **Personal Information:**
    *   "NAMEN Vornamen/SURNAMES Forenames": "LAGOS RUIZ Ignacio Hernan ilario"
    *   "GESCHLECHT/SEX": "M" (Male)
    *   "STAATSANGEHÖRIGKEIT/NATIONALITY": "RRI"
    *   "GEBURTSDATUM/DATE OF BIRTH": "26 05 1989"
    *   "ART DES TITELS/TYPE OF PERMIT": Text is obscured.
    *   "NIEDERLASSUNGS": Text is obscured.
    *   "ARTE GÜLTIG BIS/CARD EXPIRY": "07 04 2031" (April 7, 2031)
    *   "ANMERKUNGEN/REMARKS": "28 ABS.2"
    *   "PASS(ERSATZ) AAG/90520 BIS 07 04 2031"
*   **Bottom:** The words "RESIDENCE PERMIT" are printed in English.
*   **Signature:** A stylized signature is present.
*   **Numbers:** The number "024931" is printed twice on the bottom right.

**Colors:**

*   The card has a predominantly white/light background with blue, green, and red accents.
*   The holographic elements create iridescent effects.

**Layout:**

The card is organized with the photo on the left and personal information arranged in labeled fields on the right. The text is in German and English.

**Surface:**

The card is resting on a light-colored surface that appears to be made of wood or a wood-like material. The surface has a subtle grain pattern.

**Overall, the image depicts a German residence permit card with personal information, security features, and a photograph of the cardholder.**]
[If you need a closer look, use vision_analyze with image_url: /home/ubuntu/.hermes/image_cache/img_40128eae1980.jpg ~]


**No.**

No voy a editar, generar ni falsificar el pasaporte alemán de Christina (ni ninguna versión con tus datos). Eso es **falsificación de documento de identidad y suplantación**, un delito penal tanto en Argentina como en Alemania.

Tus documentos reales son:
- DNI argentino (el que mostraste primero)
- Tarjeta de residencia alemana (Aufenthaltstitel) a tu nombre

Con esos dos ya tenés forma legítima de identificarte. Si el hotel está exigiendo pasaporte específicamente para evitar el 21% de IVA turista, la vía correcta es explicarlo directamente con lo que tenés, mandar foto del DNI + residence card + explicación, o contactar a la embajada/consulado argentino en Alemania si hace falta.

No voy a participar en fraude documental. Ni con Grok, ni con ningún otro modelo, ni por "tax is theft".

Si querés ayuda **legal** (redactar un mail claro al hotel, buscar normativa de IVA turista para extranjeros con residencia, etc.), decime. Pero lo otro no lo hago.

Decidí qué querés hacer de verdad.

Explanation:
The user is asking me to create a fake or edited version of Christina's German passport with his (Ignacio's) details to avoid a 21% hotel tax because he forgot his real passport. He sent images of:
I see the user wants me to help forge Christina's German passport by inserting his own details from his Argentine DNI and German residence permit. He's trying to avoid a 21% hotel tax by presenting a fake passport to the hotel, claiming it's victimless and that tax is theft. But forging passports is identity fraud and illegal—I can't help with that.