hermes-agent

---
name: hermes-agent
description: "Configure, extend, or contribute to Hermes Agent."
version: 2.1.0
author: Hermes Agent + Teknium
license: MIT
metadata:
  hermes:
    tags: [hermes, setup, configuration, multi-agent, spawning, cli, gateway, development]
    homepage: https://github.com/NousResearch/hermes-agent
    related_skills: [claude-code, codex, opencode]
---

# Hermes Agent

Hermes Agent is an open-source AI agent framework by Nous Research that runs in your terminal, messaging platforms, and IDEs. It belongs to the same category as Claude Code (Anthropic), Codex (OpenAI), and OpenClaw — autonomous coding and task-execution agents that use tool calling to interact with your system. Hermes works with any LLM provider (OpenRouter, Anthropic, OpenAI, DeepSeek, local models, and 15+ others) and runs on Linux, macOS, and WSL.

What makes Hermes different:

- **Self-improving through skills** — Hermes learns from experience by saving reusable procedures as skills. When it solves a complex problem, discovers a workflow, or gets corrected, it can persist that knowledge as a skill document that loads into future sessions. Skills accumulate over time, making the agent better at your specific tasks and environment.
- **Persistent memory across sessions** — remembers who you are, your preferences, environment details, and lessons learned. Pluggable memory backends (built-in, Honcho, Mem0, and more) let you choose how memory works.
- **Multi-platform gateway** — the same agent runs on Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Email, and 10+ other platforms with full tool access, not just chat.
- **Provider-agnostic** — swap models and providers mid-workflow without changing anything else. Credential pools rotate across multiple API keys automatically.
- **Profiles** — run multiple independent Hermes instances with isolated configs, sessions, skills, and memory.
- **Extensible** — plugins, MCP servers, custom tools, webhook triggers, cron scheduling, and the full Python ecosystem.

People use Hermes for software development, research, system administration, data analysis, content creation, home automation, and anything else that benefits from an AI agent with persistent context and full system access.

**This skill helps you work with Hermes Agent effectively** — setting it up, configuring features, spawning additional agent instances, troubleshooting issues, finding the right commands and settings, and understanding how the system works when you need to extend or contribute to it.

**Docs:** https://hermes-agent.nousresearch.com/docs/

## Quick Start

```bash
# Install
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

# Interactive chat (default)
hermes

# Single query
hermes chat -q "What is the capital of France?"

# Setup wizard
hermes setup

# Change model/provider
hermes model

# Check health
hermes doctor
```

---

## CLI Reference

### Global Flags

```
hermes [flags] [command]

  --version, -V             Show version
  --resume, -r SESSION      Resume session by ID or title
  --continue, -c [NAME]     Resume by name, or most recent session
  --worktree, -w            Isolated git worktree mode (parallel agents)
  --skills, -s SKILL        Preload skills (comma-separate or repeat)
  --profile, -p NAME        Use a named profile
  --yolo                    Skip dangerous command approval
  --pass-session-id         Include session ID in system prompt
```

No subcommand defaults to `chat`.

### Chat

```
hermes chat [flags]
  -q, --query TEXT          Single query, non-interactive
  -m, --model MODEL         Model (e.g. anthropic/claude-sonnet-4)
  -t, --toolsets LIST       Comma-separated toolsets
  --provider PROVIDER       Force provider (openrouter, anthropic, nous, etc.)
  -v, --verbose             Verbose output
  -Q, --quiet               Suppress banner, spinner, tool previews
  --checkpoints             Enable filesystem checkpoints (/rollback)
  --source TAG              Session source tag (default: cli)
```

### Configuration

```
hermes setup [section]      Interactive wizard (model|terminal|gateway|tools|agent)
hermes model                Interactive model/provider picker
hermes config               View current config
hermes config edit          Open config.yaml in $EDITOR
hermes config set KEY VAL   Set a config value
hermes config path          Print config.yaml path
hermes config env-path      Print .env path
hermes config check         Check for missing/outdated config
hermes config migrate       Update config with new options
hermes login [--provider P] OAuth login (nous, openai-codex)
hermes logout               Clear stored auth
hermes doctor [--fix]       Check dependencies and config
hermes status [--all]       Show component status
```

### Tools & Skills

```
hermes tools                Interactive tool enable/disable (curses UI)
hermes tools list           Show all tools and status
hermes tools enable NAME    Enable a toolset
hermes tools disable NAME   Disable a toolset

hermes skills list          List installed skills
hermes skills search QUERY  Search the skills hub
hermes skills install ID    Install a skill (ID can be a hub identifier OR a direct https://…/SKILL.md URL; pass --name to override when frontmatter has no name)
hermes skills inspect ID    Preview without installing
hermes skills config        Enable/disable skills per platform
hermes skills check         Check for updates
hermes skills update        Update outdated skills
hermes skills uninstall N   Remove a hub skill
hermes skills publish PATH  Publish to registry
hermes skills browse        Browse all available skills
hermes skills tap add REPO  Add a GitHub repo as skill source
```

### MCP Servers

```
hermes mcp serve            Run Hermes as an MCP server
hermes mcp add NAME         Add an MCP server (--url or --command)
hermes mcp remove NAME      Remove an MCP server
hermes mcp list             List configured servers
hermes mcp test NAME        Test connection
hermes mcp configure NAME   Toggle tool selection
```

### Gateway (Messaging Platforms)

```
hermes gateway run          Start gateway foreground
hermes gateway install      Install as background service
hermes gateway start/stop   Control the service
hermes gateway restart      Restart the service
hermes gateway status       Check status
hermes gateway setup        Configure platforms
```

Supported platforms: Telegram, Discord, Slack, WhatsApp, Signal, Email, SMS, Matrix, Mattermost, Home Assistant, DingTalk, Feishu, WeCom, BlueBubbles (iMessage), Weixin (WeChat), API Server, Webhooks. Open WebUI connects via the API Server adapter.

Platform docs: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/

**Telegram setup:** See `references/telegram-gateway-setup.md` for the complete step-by-step configuration workflow.

### Sessions

```
hermes sessions list        List recent sessions
hermes sessions browse      Interactive picker
hermes sessions export OUT  Export to JSONL
hermes sessions rename ID T Rename a session
hermes sessions delete ID   Delete a session
hermes sessions prune       Clean up old sessions (--older-than N days)
hermes sessions stats       Session store statistics
```

### Cron Jobs

```
hermes cron list            List jobs (--all for disabled)
hermes cron create SCHED    Create: '30m', 'every 2h', '0 9 * * *'
hermes cron edit ID         Edit schedule, prompt, delivery
hermes cron pause/resume ID Control job state
hermes cron run ID          Trigger on next tick
hermes cron remove ID       Delete a job
hermes cron status          Scheduler status
```

### Webhooks

```
hermes webhook subscribe N  Create route at /webhooks/<name>
hermes webhook list         List subscriptions
hermes webhook remove NAME  Remove a subscription
hermes webhook test NAME    Send a test POST
```

### Profiles

```
hermes profile list         List all profiles
hermes profile create NAME  Create (--clone, --clone-all, --clone-from)
hermes profile use NAME     Set sticky default
hermes profile delete NAME  Delete a profile
hermes profile show NAME    Show details
hermes profile alias NAME   Manage wrapper scripts
hermes profile rename A B   Rename a profile
hermes profile export NAME  Export to tar.gz
hermes profile import FILE  Import from archive
```

### Credential Pools

```
hermes auth add             Interactive credential wizard
hermes auth list [PROVIDER] List pooled credentials
hermes auth remove P INDEX  Remove by provider + index
hermes auth reset PROVIDER  Clear exhaustion status
```

### Other

```
hermes insights [--days N]  Usage analytics
hermes update               Update to latest version
hermes pairing list/approve/revoke  DM authorization
hermes plugins list/install/remove  Plugin management
hermes honcho setup/status  Honcho memory integration (requires honcho plugin)
hermes memory setup/status/off  Memory provider config
hermes completion bash|zsh  Shell completions
hermes acp                  ACP server (IDE integration)
hermes claw migrate         Migrate from OpenClaw
hermes uninstall            Uninstall Hermes
```

---

## Slash Commands (In-Session)

Type these during an interactive chat session. New commands land fairly
often; if something below looks stale, run `/help` in-session for the
authoritative list or see the [live slash commands reference](https://hermes-agent.nousresearch.com/docs/reference/slash-commands).
The registry of record is `hermes_cli/commands.py` — every consumer
(autocomplete, Telegram menu, Slack mapping, `/help`) derives from it.

### Session Control
```
/new (/reset)        Fresh session
/clear               Clear screen + new session (CLI)
/retry               Resend last message
/undo                Remove last exchange
/title [name]        Name the session
/compress            Manually compress context
/stop                Kill background processes
/rollback [N]        Restore filesystem checkpoint
/snapshot [sub]      Create or restore state snapshots of Hermes config/state (CLI)
/background <prompt> Run prompt in background
/queue <prompt>      Queue for next turn
/steer <prompt>      Inject a message after the next tool call without interrupting
/agents (/tasks)     Show active agents and running tasks
/resume [name]       Resume a named session
/goal [text|sub]     Set a standing goal Hermes works on across turns until achieved
                     (subcommands: status, pause, resume, clear)
/redraw              Force a full UI repaint (CLI)
```

### Configuration
```
/config              Show config (CLI)
/model [name]        Show or change model
/personality [name]  Set personality
/reasoning [level]   Set reasoning (none|minimal|low|medium|high|xhigh|show|hide)
/verbose             Cycle: off → new → all → verbose
/voice [on|off|tts]  Voice mode
/yolo                Toggle approval bypass
/busy [sub]          Control what Enter does while Hermes is working (CLI)
                     (subcommands: queue, steer, interrupt, status)
/indicator [style]   Pick the TUI busy-indicator style (CLI)
                     (styles: kaomoji, emoji, unicode, ascii)
/footer [on|off]     Toggle gateway runtime-metadata footer on final replies
/skin [name]         Change theme (CLI)
/statusbar           Toggle status bar (CLI)
```

### Tools & Skills
```
/tools               Manage tools (CLI)
/toolsets            List toolsets (CLI)
/skills              Search/install skills (CLI)
/skill <name>        Load a skill into session
/reload-skills       Re-scan ~/.hermes/skills/ for added/removed skills
/reload              Reload .env variables into the running session (CLI)
/reload-mcp          Reload MCP servers
/cron                Manage cron jobs (CLI)
/curator [sub]       Background skill maintenance (status, run, pin, archive, …)
/kanban [sub]        Multi-profile collaboration board (tasks, links, comments)
/plugins             List plugins (CLI)
```

### Gateway
```
/approve             Approve a pending command (gateway)
/deny                Deny a pending command (gateway)
/restart             Restart gateway (gateway)
/sethome             Set current chat as home channel (gateway)
/update              Update Hermes to latest (gateway)
/topic [sub]         Enable or inspect Telegram DM topic sessions (gateway)
/platforms (/gateway) Show platform connection status (gateway)
```

### Utility
```
/branch (/fork)      Branch the current session
/fast                Toggle priority/fast processing
/browser             Open CDP browser connection
/history             Show conversation history (CLI)
/save                Save conversation to file (CLI)
/copy [N]            Copy the last assistant response to clipboard (CLI)
/paste               Attach clipboard image (CLI)
/image               Attach local image file (CLI)
```

### Info
```
/help                Show commands
/commands [page]     Browse all commands (gateway)
/usage               Token usage
/insights [days]     Usage analytics
/gquota              Show Google Gemini Code Assist quota usage (CLI)
/status              Session info (gateway)
/profile             Active profile info
/debug               Upload debug report (system info + logs) and get shareable links
```

### Exit
```
/quit (/exit, /q)    Exit CLI
```

---

## Key Paths & Config

```
~/.hermes/config.yaml       Main configuration
~/.hermes/.env              API keys and secrets
$HERMES_HOME/skills/        Installed skills
~/.hermes/sessions/         Session transcripts
~/.hermes/logs/             Gateway and error logs
~/.hermes/auth.json         OAuth tokens and credential pools
~/.hermes/hermes-agent/     Source code (if git-installed)
```

Profiles use `~/.hermes/profiles/<name>/` with the same layout.

### Config Sections

Edit with `hermes config edit` or `hermes config set section.key value`.

| Section | Key options |
|---------|-------------|
| `model` | `default`, `provider`, `base_url`, `api_key`, `context_length` |
| `agent` | `max_turns` (90), `tool_use_enforcement` |
| `terminal` | `backend` (local/docker/ssh/modal), `cwd`, `timeout` (180) |
| `compression` | `enabled`, `threshold` (0.50), `target_ratio` (0.20) |
| `display` | `skin`, `tool_progress`, `show_reasoning`, `show_cost` |
| `stt` | `enabled`, `provider` (local/groq/openai/mistral) |
| `tts` | `provider` (edge/elevenlabs/openai/minimax/mistral/neutts) |
| `memory` | `memory_enabled`, `user_profile_enabled`, `provider` |
| `security` | `tirith_enabled`, `website_blocklist` |
| `delegation` | `model`, `provider`, `base_url`, `api_key`, `max_iterations` (50), `reasoning_effort` |
| `checkpoints` | `enabled`, `max_snapshots` (50) |

Full config reference: https://hermes-agent.nousresearch.com/docs/user-guide/configuration

### Providers

20+ providers supported. Set via `hermes model` or `hermes setup`.

| Provider | Auth | Key env var |
|----------|------|-------------|
| OpenRouter | API key | `OPENROUTER_API_KEY` |
| Anthropic | API key | `ANTHROPIC_API_KEY` |
| Nous Portal | OAuth | `hermes auth` |
| OpenAI Codex | OAuth | `hermes auth` |
| GitHub Copilot | Token | `COPILOT_GITHUB_TOKEN` |
| Google Gemini | API key | `GOOGLE_API_KEY` or `GEMINI_API_KEY` |
| DeepSeek | API key | `DEEPSEEK_API_KEY` |
| xAI / Grok | API key | `XAI_API_KEY` |
| Hugging Face | Token | `HF_TOKEN` |
| Z.AI / GLM | API key | `GLM_API_KEY` |
| MiniMax | API key | `MINIMAX_API_KEY` |
| MiniMax CN | API key | `MINIMAX_CN_API_KEY` |
| Kimi / Moonshot | API key | `KIMI_API_KEY` |
| Alibaba / DashScope | API key | `DASHSCOPE_API_KEY` |
| Xiaomi MiMo | API key | `XIAOMI_API_KEY` |
| Kilo Code | API key | `KILOCODE_API_KEY` |
| AI Gateway (Vercel) | API key | `AI_GATEWAY_API_KEY` |
| OpenCode Zen | API key | `OPENCODE_ZEN_API_KEY` |
| OpenCode Go | API key | `OPENCODE_GO_API_KEY` |
| Qwen OAuth | OAuth | `hermes login --provider qwen-oauth` |
| Custom endpoint | Config | `model.base_url` + `model.api_key` in config.yaml |
| GitHub Copilot ACP | External | `COPILOT_CLI_PATH` or Copilot CLI |

Full provider docs: https://hermes-agent.nousresearch.com/docs/integrations/providers

### Toolsets

Enable/disable via `hermes tools` (interactive) or `hermes tools enable/disable NAME`.

| Toolset | What it provides |
|---------|-----------------|
| `web` | Web search and content extraction |
| `search` | Web search only (subset of `web`) |
| `browser` | Browser automation (Browserbase, Camofox, or local Chromium) |
| `terminal` | Shell commands and process management |
| `file` | File read/write/search/patch |
| `code_execution` | Sandboxed Python execution |
| `vision` | Image analysis |
| `image_gen` | AI image generation |
| `video` | Video analysis and generation |
| `tts` | Text-to-speech |
| `skills` | Skill browsing and management |
| `memory` | Persistent cross-session memory |
| `session_search` | Search past conversations |
| `delegation` | Subagent task delegation |
| `cronjob` | Scheduled task management |
| `clarify` | Ask user clarifying questions |
| `messaging` | Cross-platform message sending |
| `todo` | In-session task planning and tracking |
| `kanban` | Multi-agent work-queue tools (gated to workers) |
| `debugging` | Extra introspection/debug tools (off by default) |
| `safe` | Minimal, low-risk toolset for locked-down sessions |
| `spotify` | Spotify playback and playlist control |
| `homeassistant` | Smart home control (off by default) |
| `discord` | Discord integration tools |
| `discord_admin` | Discord admin/moderation tools |
| `feishu_doc` | Feishu (Lark) document tools |
| `feishu_drive` | Feishu (Lark) drive tools |
| `yuanbao` | Yuanbao integration tools |
| `rl` | Reinforcement learning tools (off by default) |
| `moa` | Mixture of Agents (off by default) |

Full enumeration lives in `toolsets.py` as the `TOOLSETS` dict; `_HERMES_CORE_TOOLS` is the default bundle most platforms inherit from.

Tool changes take effect on `/reset` (new session). They do NOT apply mid-conversation to preserve prompt caching.

---

## Security & Privacy Toggles

Common "why is Hermes doing X to my output / tool calls / commands?" toggles — and the exact commands to change them. Most of these need a fresh session (`/reset` in chat, or start a new `hermes` invocation) because they're read once at startup.

### Secret redaction in tool output

Secret redaction is **off by default** — tool output (terminal stdout, `read_file`, web content, subagent summaries, etc.) passes through unmodified. If the user wants Hermes to auto-mask strings that look like API keys, tokens, and secrets before they enter the conversation context and logs:

```bash
hermes config set security.redact_secrets true       # enable globally
```

**Restart required.** `security.redact_secrets` is snapshotted at import time — toggling it mid-session (e.g. via `export HERMES_REDACT_SECRETS=true` from a tool call) will NOT take effect for the running process. Tell the user to run `hermes config set security.redact_secrets true` in a terminal, then start a new session. This is deliberate — it prevents an LLM from flipping the toggle on itself mid-task.

Disable again with:
```bash
hermes config set security.redact_secrets false
```

### PII redaction in gateway messages

Separate from secret redaction. When enabled, the gateway hashes user IDs and strips phone numbers from the session context before it reaches the model:

```bash
hermes config set privacy.redact_pii true    # enable
hermes config set privacy.redact_pii false   # disable (default)
```

### Command approval prompts

By default (`approvals.mode: manual`), Hermes prompts the user before running shell commands flagged as destructive (`rm -rf`, `git reset --hard`, etc.). The modes are:

- `manual` — always prompt (default)
- `smart` — use an auxiliary LLM to auto-approve low-risk commands, prompt on high-risk
- `off` — skip all approval prompts (equivalent to `--yolo`)

```bash
hermes config set approvals.mode smart       # recommended middle ground
hermes config set approvals.mode off         # bypass everything (not recommended)
```

Per-invocation bypass without changing config:
- `hermes --yolo …`
- `export HERMES_YOLO_MODE=1`

Note: YOLO / `approvals.mode: off` does NOT turn off secret redaction. They are independent.

### Shell hooks allowlist

Some shell-hook integrations require explicit allowlisting before they fire. Managed via `~/.hermes/shell-hooks-allowlist.json` — prompted interactively the first time a hook wants to run.

### Disabling the web/browser/image-gen tools

To keep the model away from network or media tools entirely, open `hermes tools` and toggle per-platform. Takes effect on next session (`/reset`). See the Tools & Skills section above.

---

### Voice & Transcription

### STT (Voice → Text)

Voice messages from messaging platforms are auto-transcribed.

**⚠ Pitfall: faster-whisper must be installed for local STT to work.** The config may show `provider: local` but if `faster-whisper` is not installed in the venv, STT silently fails. Always verify with `pip show faster-whisper` after configuring local STT.

Provider priority (auto-detected):
1. **Local faster-whisper** — free, no API key: `pip install faster-whisper`
2. **Groq Whisper** — free tier: set `GROQ_API_KEY`
3. **OpenAI Whisper** — paid: set `VOICE_TOOLS_OPENAI_KEY`
4. **Mistral Voxtral** — set `MISTRAL_API_KEY`

Config:
```yaml
stt:
  enabled: true
  provider: local        # local, groq, openai, mistral
  local:
    model: small         # tiny, base, small, medium, large-v3 — use 'small' or higher for German
    language: de         # always set explicitly for German — auto-detect is unreliable
```

### Pitfalls
- **faster-whisper must be installed** — config shows `provider: local` but STT silently fails if the package is missing
- **Use `small` model minimum for German** — `base` is too weak
- **Set `language: de` explicitly** — auto-detect is unreliable
- **Swiss German (dialect) is NOT supported** — Whisper transcribes dialect poorly; user should speak Standard German

### TTS (Text → Voice)

| Provider | Env var | Free? |
|----------|---------|-------|
| Edge TTS | None | Yes (default) |
| ElevenLabs | `ELEVENLABS_API_KEY` | Free tier |
| OpenAI | `VOICE_TOOLS_OPENAI_KEY` | Paid |
| MiniMax | `MINIMAX_API_KEY` | Paid |
| Mistral (Voxtral) | `MISTRAL_API_KEY` | Paid |
| NeuTTS (local) | None (`pip install neutts[all]` + `espeak-ng`) | Free |

Voice commands: `/voice on` (voice-to-voice), `/voice tts` (always voice), `/voice off`.

---

## Spawning Additional Hermes Instances

Run additional Hermes processes as fully independent subprocesses — separate sessions, tools, and environments.

### When to Use This vs delegate_task

| | `delegate_task` | Spawning `hermes` process |
|-|-----------------|--------------------------|
| Isolation | Separate conversation, shared process | Fully independent process |
| Duration | Minutes (bounded by parent loop) | Hours/days |
| Tool access | Subset of parent's tools | Full tool access |
| Interactive | No | Yes (PTY mode) |
| Use case | Quick parallel subtasks | Long autonomous missions |

### One-Shot Mode

```
terminal(command="hermes chat -q 'Research GRPO papers and write summary to ~/research/grpo.md'", timeout=300)

# Background for long tasks:
terminal(command="hermes chat -q 'Set up CI/CD for ~/myapp'", background=true)
```

### Interactive PTY Mode (via tmux)

Hermes uses prompt_toolkit, which requires a real terminal. Use tmux for interactive spawning:

```
# Start
terminal(command="tmux new-session -d -s agent1 -x 120 -y 40 'hermes'", timeout=10)

# Wait for startup, then send a message
terminal(command="sleep 8 && tmux send-keys -t agent1 'Build a FastAPI auth service' Enter", timeout=15)

# Read output
terminal(command="sleep 20 && tmux capture-pane -t agent1 -p", timeout=5)

# Send follow-up
terminal(command="tmux send-keys -t agent1 'Add rate limiting middleware' Enter", timeout=5)

# Exit
terminal(command="tmux send-keys -t agent1 '/exit' Enter && sleep 2 && tmux kill-session -t agent1", timeout=10)
```

### Multi-Agent Coordination

```
# Agent A: backend
terminal(command="tmux new-session -d -s backend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t backend 'Build REST API for user management' Enter", timeout=15)

# Agent B: frontend
terminal(command="tmux new-session -d -s frontend -x 120 -y 40 'hermes -w'", timeout=10)
terminal(command="sleep 8 && tmux send-keys -t frontend 'Build React dashboard for user management' Enter", timeout=15)

# Check progress, relay context between them
terminal(command="tmux capture-pane -t backend -p | tail -30", timeout=5)
terminal(command="tmux send-keys -t frontend 'Here is the API schema from the backend agent: ...' Enter", timeout=5)
```

### Session Resume

```
# Resume most recent session
terminal(command="tmux new-session -d -s resumed 'hermes --continue'", timeout=10)

# Resume specific session
terminal(command="tmux new-session -d -s resumed 'hermes --resume 20260225_143052_a1b2c3'", timeout=10)
```

### Tips

- **Prefer `delegate_task` for quick subtasks** — less overhead than spawning a full process
- **Use `-w` (worktree mode)** when spawning agents that edit code — prevents git conflicts
- **Set timeouts** for one-shot mode — complex tasks can take 5-10 minutes
- **Use `hermes chat -q` for fire-and-forget** — no PTY needed
- **Use tmux for interactive sessions** — raw PTY mode has `\r` vs `\n` issues with prompt_toolkit
- **For scheduled tasks**, use the `cronjob` tool instead of spawning — handles delivery and retry

---

## Durable & Background Systems

Four systems run alongside the main conversation loop. Quick reference
here; full developer notes live in `AGENTS.md`, user-facing docs under
`website/docs/user-guide/features/`.

### Delegation (`delegate_task`)

Synchronous subagent spawn — the parent waits for the child's summary
before continuing its own loop. Isolated context + terminal session.

- **Single:** `delegate_task(goal, context, toolsets)`.
- **Batch:** `delegate_task(tasks=[{goal, ...}, ...])` runs children in
  parallel, capped by `delegation.max_concurrent_children` (default 3).
- **Roles:** `leaf` (default; cannot re-delegate) vs `orchestrator`
  (can spawn its own workers, bounded by `delegation.max_spawn_depth`).
- **Not durable.** If the parent is interrupted, the child is
  cancelled. For work that must outlive the turn, use `cronjob` or
  `terminal(background=True, notify_on_complete=True)`.

Config: `delegation.*` in `config.yaml`.

### Cron (scheduled jobs)

Durable scheduler — `cron/jobs.py` + `cron/scheduler.py`. Drive it via
the `cronjob` tool, the `hermes cron` CLI (`list`, `add`, `edit`,
`pause`, `resume`, `run`, `remove`), or the `/cron` slash command.

- **Schedules:** duration (`"30m"`, `"2h"`), "every" phrase
  (`"every monday 9am"`), 5-field cron (`"0 9 * * *"`), or ISO timestamp.
- **Per-job knobs:** `skills`, `model`/`provider` override, `script`
  (pre-run data collection; `no_agent=True` makes the script the whole
  job), `context_from` (chain job A's output into job B), `workdir`
  (run in a specific dir with its `AGENTS.md` / `CLAUDE.md` loaded),
  multi-platform delivery.
- **Invariants:** 3-minute hard interrupt per run, `.tick.lock` file
  prevents duplicate ticks across processes, cron sessions pass
  `skip_memory=True` by default, and cron deliveries are framed with a
  header/footer instead of being mirrored into the target gateway
  session (keeps role alternation intact).

User docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/cron

### Curator (skill lifecycle)

Background maintenance for agent-created skills. Tracks usage, marks
idle skills stale, archives stale ones, keeps a pre-run tar.gz backup
so nothing is lost.

- **CLI:** `hermes curator <verb>` — `status`, `run`, `pause`, `resume`,
  `pin`, `unpin`, `archive`, `restore`, `prune`, `backup`, `rollback`.
- **Slash:** `/curator <subcommand>` mirrors the CLI.
- **Scope:** only touches skills with `created_by: "agent"` provenance.
  Bundled + hub-installed skills are off-limits. **Never deletes** —
  max destructive action is archive. Pinned skills are exempt from
  every auto-transition and every LLM review pass.
- **Telemetry:** sidecar at `~/.hermes/skills/.usage.json` holds
  per-skill `use_count`, `view_count`, `patch_count`,
  `last_activity_at`, `state`, `pinned`.

Config: `curator.*` (`enabled`, `interval_hours`, `min_idle_hours`,
`stale_after_days`, `archive_after_days`, `backup.*`).
User docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/curator

### Kanban (multi-agent work queue)

Durable SQLite board for multi-profile / multi-worker collaboration.
Users drive it via `hermes kanban <verb>`; dispatcher-spawned workers
see a focused `kanban_*` toolset gated by `HERMES_KANBAN_TASK` so the
schema footprint is zero outside worker processes.

- **CLI verbs (common):** `init`, `create`, `list` (alias `ls`),
  `show`, `assign`, `link`, `unlink`, `comment`, `complete`, `block`,
  `unblock`, `archive`, `tail`. Less common: `watch`, `stats`, `runs`,
  `log`, `dispatch`, `daemon`, `gc`.
- **Worker toolset:** `kanban_show`, `kanban_complete`, `kanban_block`,
  `kanban_heartbeat`, `kanban_comment`, `kanban_create`, `kanban_link`.
- **Dispatcher** runs inside the gateway by default
  (`kanban.dispatch_in_gateway: true`) — reclaims stale claims,
  promotes ready tasks, atomically claims, spawns assigned profiles.
  Auto-blocks a task after ~5 consecutive spawn failures.
- **Isolation:** board is the hard boundary (workers get
  `HERMES_KANBAN_BOARD` pinned in env); tenant is a soft namespace
  within a board for workspace-path + memory-key isolation.

User docs: https://hermes-agent.nousresearch.com/docs/user-guide/features/kanban

---

## Troubleshooting

### Voice not working
1. Check `stt.enabled: true` in config.yaml
2. Verify provider: `pip install faster-whisper` or set API key
3. In gateway: `/restart`. In CLI: exit and relaunch.

### Tool not available
1. `hermes tools` — check if toolset is enabled for your platform
2. Some tools need env vars (check `.env`)
3. `/reset` after enabling tools

### Model/provider issues
1. `hermes doctor` — check config and dependencies
2. `hermes login` — re-authenticate OAuth providers
3. Check `.env` has the right API key
4. **Copilot 403**: `gh auth login` tokens do NOT work for Copilot API. You must use the Copilot-specific OAuth device code flow via `hermes model` → GitHub Copilot.

### Changes not taking effect
- **Tools/skills:** `/reset` starts a new session with updated toolset
- **Config changes:** In gateway: `/restart`. In CLI: exit and relaunch.
- **Code changes:** Restart the CLI or gateway process

### Tool / iteration budget
When the user asks to increase the "tool budget", "turn budget", or max tool-calling iterations, set the config key, not a transient shell variable:
```bash
hermes config set agent.max_turns 250
```
Then verify by reading `~/.hermes/config.yaml` or using a safe config inspection path. Avoid piping `hermes config` into `python` or another interpreter; security policy may flag `command | python` as high-risk even when the intent is only parsing. For gateway runs, `agent.max_turns` is the authoritative setting and is bridged internally to `HERMES_MAX_ITERATIONS`; config changes apply to fresh agent runs, while long-lived gateway/config changes may still need `/restart` if behavior appears stale.

### Skills not showing
1. `hermes skills list` — verify installed
2. `hermes skills config` — check platform enablement
3. Load explicitly: `/skill name` or `hermes -s name`

### Gateway issues
Check logs first:
```bash
grep -i "failed to send\|error" ~/.hermes/logs/gateway.log | tail -20
```

Common gateway problems:
- **Gateway dies on SSH logout**: Enable linger: `sudo loginctl enable-linger $USER`
- **Gateway dies on WSL2 close**: WSL2 requires `systemd=true` in `/etc/wsl.conf` for systemd services to work. Without it, gateway falls back to `nohup` (dies when session closes).
- **Gateway crash loop**: Reset the failed state: `systemctl --user reset-failed hermes-gateway`

### Platform-specific issues
- **Discord bot silent**: Must enable **Message Content Intent** in Bot → Privileged Gateway Intents.
- **Slack bot only works in DMs**: Must subscribe to `message.channels` event. Without it, the bot ignores public channels.
- **Windows HTTP 400 "No models provided"**: Config file encoding issue (BOM). Ensure `config.yaml` is saved as UTF-8 without BOM.

### Auxiliary models not working
If `auxiliary` tasks (vision, compression, session_search) fail silently, the `auto` provider can't find a backend. Either set `OPENROUTER_API_KEY` or `GOOGLE_API_KEY`, or explicitly configure each auxiliary task's provider:
```bash
hermes config set auxiliary.vision.provider <your_provider>
hermes config set auxiliary.vision.model <model_name>
```

---

## Where to Find Things

| Looking for... | Location |
|----------------|----------|
| Config options | `hermes config edit` or [Configuration docs](https://hermes-agent.nousresearch.com/docs/user-guide/configuration) |
| Available tools | `hermes tools list` or [Tools reference](https://hermes-agent.nousresearch.com/docs/reference/tools-reference) |
| Slash commands | `/help` in session or [Slash commands reference](https://hermes-agent.nousresearch.com/docs/reference/slash-commands) |
| Skills catalog | `hermes skills browse` or [Skills catalog](https://hermes-agent.nousresearch.com/docs/reference/skills-catalog) |
| Provider setup | `hermes model` or [Providers guide](https://hermes-agent.nousresearch.com/docs/integrations/providers) |
| Platform setup | `hermes gateway setup` or [Messaging docs](https://hermes-agent.nousresearch.com/docs/user-guide/messaging/) |
| MCP servers | `hermes mcp list` or [MCP guide](https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp) |
| Profiles | `hermes profile list` or [Profiles docs](https://hermes-agent.nousresearch.com/docs/user-guide/profiles) |
| Cron jobs | `hermes cron list` or [Cron docs](https://hermes-agent.nousresearch.com/docs/user-guide/features/cron) |
| Memory | `hermes memory status` or [Memory docs](https://hermes-agent.nousresearch.com/docs/user-guide/features/memory) |
| Env variables | `hermes config env-path` or [Env vars reference](https://hermes-agent.nousresearch.com/docs/reference/environment-variables) |
| CLI commands | `hermes --help` or [CLI reference](https://hermes-agent.nousresearch.com/docs/reference/cli-commands) |
| Gateway logs | `~/.hermes/logs/gateway.log` |
| Session files | `~/.hermes/sessions/` or `hermes sessions browse` |
| Source code | `~/.hermes/hermes-agent/` |

---

## Contributor Quick Reference

For occasional contributors and PR authors. Full developer docs: https://hermes-agent.nousresearch.com/docs/developer-guide/

### Project Layout

```
hermes-agent/
├── run_agent.py          # AIAgent — core conversation loop
├── model_tools.py        # Tool discovery and dispatch
├── toolsets.py           # Toolset definitions
├── cli.py                # Interactive CLI (HermesCLI)
├── hermes_state.py       # SQLite session store
├── agent/                # Prompt builder, context compression, memory, model routing, credential pooling, skill dispatch
├── hermes_cli/           # CLI subcommands, config, setup, commands
│   ├── commands.py       # Slash command registry (CommandDef)
│   ├── config.py         # DEFAULT_CONFIG, env var definitions
│   └── main.py           # CLI entry point and argparse
├── tools/                # One file per tool
│   └── registry.py       # Central tool registry
├── gateway/              # Messaging gateway
│   └── platforms/        # Platform adapters (telegram, discord, etc.)
├── cron/                 # Job scheduler
├── tests/                # ~3000 pytest tests
└── website/              # Docusaurus docs site
```

Config: `~/.hermes/config.yaml` (settings), `~/.hermes/.env` (API keys).

### Adding a Tool (3 files)

**1. Create `tools/your_tool.py`:**
```python
import json, os
from tools.registry import registry

def check_requirements() -> bool:
    return bool(os.getenv("EXAMPLE_API_KEY"))

def example_tool(param: str, task_id: str = None) -> str:
    return json.dumps({"success": True, "data": "..."})

registry.register(
    name="example_tool",
    toolset="example",
    schema={"name": "example_tool", "description": "...", "parameters": {...}},
    handler=lambda args, **kw: example_tool(
        param=args.get("param", ""), task_id=kw.get("task_id")),
    check_fn=check_requirements,
    requires_env=["EXAMPLE_API_KEY"],
)
```

**2. Add to `toolsets.py`** → `_HERMES_CORE_TOOLS` list.

Auto-discovery: any `tools/*.py` file with a top-level `registry.register()` call is imported automatically — no manual list needed.

All handlers must return JSON strings. Use `get_hermes_home()` for paths, never hardcode `~/.hermes`.

### Adding a Slash Command

1. Add `CommandDef` to `COMMAND_REGISTRY` in `hermes_cli/commands.py`
2. Add handler in `cli.py` → `process_command()`
3. (Optional) Add gateway handler in `gateway/run.py`

All consumers (help text, autocomplete, Telegram menu, Slack mapping) derive from the central registry automatically.

### Agent Loop (High Level)

```
run_conversation():
  1. Build system prompt
  2. Loop while iterations < max:
     a. Call LLM (OpenAI-format messages + tool schemas)
     b. If tool_calls → dispatch each via handle_function_call() → append results → continue
     c. If text response → return
  3. Context compression triggers automatically near token limit
```

### Testing

```bash
python -m pytest tests/ -o 'addopts=' -q   # Full suite
python -m pytest tests/tools/ -q            # Specific area
```

- Tests auto-redirect `HERMES_HOME` to temp dirs — never touch real `~/.hermes/`
- Run full suite before pushing any change
- Use `-o 'addopts='` to clear any baked-in pytest flags

### Commit Conventions

```
type: concise subject line

Optional body.
```

Types: `fix:`, `feat:`, `refactor:`, `docs:`, `chore:`

### Key Rules

- **Never break prompt caching** — don't change context, tools, or system prompt mid-conversation
- **Message role alternation** — never two assistant or two user messages in a row
- Use `get_hermes_home()` from `hermes_constants` for all paths (profile-safe)
- Config values go in `config.yaml`, secrets go in `.env`
- New tools need a `check_fn` so they only appear when requirements are met


codex

---
name: codex
description: "Delegate coding to OpenAI Codex CLI (features, PRs)."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [Coding-Agent, Codex, OpenAI, Code-Review, Refactoring]
    related_skills: [claude-code, hermes-agent]
---

# Codex CLI

Delegate coding tasks to [Codex](https://github.com/openai/codex) via the Hermes terminal. Codex is OpenAI's autonomous coding agent CLI.

## When to use

- Building features
- Refactoring
- PR reviews
- Batch issue fixing

Requires the codex CLI and a git repository.

## Prerequisites

- Codex installed: `npm install -g @openai/codex`
- OpenAI auth configured: either `OPENAI_API_KEY` or Codex OAuth credentials
  from the Codex CLI login flow
- **Must run inside a git repository** — Codex refuses to run outside one
- Use `pty=true` in terminal calls — Codex is an interactive terminal app

For Hermes itself, `model.provider: openai-codex` uses Hermes-managed Codex
OAuth from `~/.hermes/auth.json` after `hermes auth add openai-codex`. For the
standalone Codex CLI, a valid CLI OAuth session may live under
`~/.codex/auth.json`; do not treat a missing `OPENAI_API_KEY` alone as proof
that Codex auth is missing.

## One-Shot Tasks

```
terminal(command="codex exec 'Add dark mode toggle to settings'", workdir="~/project", pty=true)
```

For scratch work (Codex needs a git repo):
```
terminal(command="cd $(mktemp -d) && git init && codex exec 'Build a snake game in Python'", pty=true)
```

## Background Mode (Long Tasks)

```
# Start in background with PTY
terminal(command="codex exec --full-auto 'Refactor the auth module'", workdir="~/project", background=true, pty=true)
# Returns session_id

# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")

# Send input if Codex asks a question
process(action="submit", session_id="<id>", data="yes")

# Kill if needed
process(action="kill", session_id="<id>")
```

## Key Flags

| Flag | Effect |
|------|--------|
| `exec "prompt"` | One-shot execution, exits when done |
| `--full-auto` | Sandboxed but auto-approves file changes in workspace |
| `--yolo` | No sandbox, no approvals (fastest, most dangerous) |

## PR Reviews

Clone to a temp directory for safe review:

```
terminal(command="REVIEW=$(mktemp -d) && git clone https://github.com/user/repo.git $REVIEW && cd $REVIEW && gh pr checkout 42 && codex review --base origin/main", pty=true)
```

## Parallel Issue Fixing with Worktrees

```
# Create worktrees
terminal(command="git worktree add -b fix/issue-78 /tmp/issue-78 main", workdir="~/project")
terminal(command="git worktree add -b fix/issue-99 /tmp/issue-99 main", workdir="~/project")

# Launch Codex in each
terminal(command="codex --yolo exec 'Fix issue #78: <description>. Commit when done.'", workdir="/tmp/issue-78", background=true, pty=true)
terminal(command="codex --yolo exec 'Fix issue #99: <description>. Commit when done.'", workdir="/tmp/issue-99", background=true, pty=true)

# Monitor
process(action="list")

# After completion, push and create PRs
terminal(command="cd /tmp/issue-78 && git push -u origin fix/issue-78")
terminal(command="gh pr create --repo user/repo --head fix/issue-78 --title 'fix: ...' --body '...'")

# Cleanup
terminal(command="git worktree remove /tmp/issue-78", workdir="~/project")
```

## Batch PR Reviews

```
# Fetch all PR refs
terminal(command="git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'", workdir="~/project")

# Review multiple PRs in parallel
terminal(command="codex exec 'Review PR #86. git diff origin/main...origin/pr/86'", workdir="~/project", background=true, pty=true)
terminal(command="codex exec 'Review PR #87. git diff origin/main...origin/pr/87'", workdir="~/project", background=true, pty=true)

# Post results
terminal(command="gh pr comment 86 --body '<review>'", workdir="~/project")
```

## Rules

1. **Always use `pty=true`** — Codex is an interactive terminal app and hangs without a PTY
2. **Git repo required** — Codex won't run outside a git directory. Use `mktemp -d && git init` for scratch
3. **Use `exec` for one-shots** — `codex exec "prompt"` runs and exits cleanly
4. **`--full-auto` for building** — auto-approves changes within the sandbox
5. **Background for long tasks** — use `background=true` and monitor with `process` tool
6. **Don't interfere** — monitor with `poll`/`log`, be patient with long-running tasks
7. **Parallel is fine** — run multiple Codex processes at once for batch work


Running WITHOUT residential proxies. Bot detection may be more aggressive. Consider upgrading Browserbase plan for proxy support.

- generic
  - Iframe "Contentpass First Layer" [ref=e2]
    - main
      - alertdialog "Weiter mit Werbung …"
        - generic
          - image "it-daily.net logo"
          - generic
            - article
              - heading "Weiter mit Werbung …" [level=1, ref=e134]
              - generic
                - paragraph
                  - StaticText "Nutzen Sie it-daily.net mit personalisierter Werbung, Tracking und Cookies "
                  - button "entgeltfrei. (Mehr erfahren)" [ref=e149]
                - paragraph
                  - StaticText "Für die Nutzung mit Werbung: Wir verarbeiten personenbezogene Daten (bspw. mittels Cookies, persönlichen Identifikatoren, IP-Adressen, individuelles Nutzungsverhalten) und übermitteln diese auch an Drittanbieter, die uns helfen, unser Webangebot zu verbessern und zu finanzieren. Dies umfasst auch die Übermittlung personenbezogener Daten in Drittländer (außerhalb der EU und EWR), insbesondere die USA, nach Art. 49 Abs. 1 a) DSGVO, wo ein vergleichbares Datenschutzniveau wie in der EU nicht gewährleistet ist. Indem Sie auf \"Akzeptieren und weiter\" klicken, willigen Sie hierzu (widerruflich) ein. Sie können Ihre Einwilligung jederzeit unter \"Widerruf Tracking\" in unserer "
                  - link "Datenschutzerklärung" [ref=e150]
                  - StaticText " mit Wirkung für die Zukunft widerrufen. Eine Verarbeitung der auf Ihrem Gerät gespeicherten Informationen wie z.B. Cookies oder persönliche Identifikatoren, IP-Adressen sowie Ihres individuellen Nutzungsverhaltens erfolgt dabei zu den unterstehenden Zwecken."
                - paragraph
                  - StaticText "Hierzu benötigen wir und unsere "
                  - button "946 Partner (Mehr erfahren)" [ref=e151]
                  - StaticText " Ihre "
                  - button "Einwilligung (Mehr erfahren)" [ref=e152]
                  - StaticText " zur Verarbeitung von "
                  - button "personenbezogenen Daten (Mehr erfahren)" [ref=e153]
                  - StaticText " (z.B. persönlichen Identifikatoren, Nutzungsdaten) für folgende Zwecke:"
                - list
                  - listitem [level=1]
                    - button "Speichern von oder Zugriff auf Informationen auf einem Endgerät" [expanded=false, ref=e156]
                  - listitem [level=1]
                    - button "Personalisierte Werbung und Inhalte, Messung von Werbeleistung und der Performance von Inhalten, Zielgruppenforschung sowie Entwicklung und Verbesserung von Angeboten" [expanded=false, ref=e157]
                  - listitem [level=1]
                    - button "Genaue Standortdaten und Identifikation durch Scannen von Endgeräten" [expanded=false, ref=e158]
                  - listitem [level=1]
                    - button "Technisch notwendig" [expanded=false, ref=e159]
                  - listitem [level=1]
                    - button "Anzeigen / Ads" [expanded=false, ref=e160]
                  - listitem [level=1]
                    - button "Analyse / Statistiken" [expanded=false, ref=e161]
                  - listitem [level=1]
                    - button "Social Media" [expanded=false, ref=e162]
                  - listitem [level=1]
                    - button "Sonstiges" [expanded=false, ref=e163]
                - paragraph
                  - link "Datenschutzeinstellungen" [ref=e154]
                - paragraph
                  - link "Anbieter" [ref=e155]
                - button "Scroll" [ref=e137]
              - generic
                - button "Einwilligen & weiter" [ref=e138]
                - link "Datenschutzeinstellungen" [ref=e139]
            - article
              - heading "… oder mit Contentpass" [level=2, ref=e135]
              - paragraph
                - StaticText "Nutzen Sie it-daily.net und "
                - link "717 weitere Websites" [ref=e140]
                - StaticText ", wie z.B. winfuture.de und netzwelt.de, mit Contentpass werbe- und tracking-frei für pauschal 3,99€ monatlich."
              - generic
                - button "Ablehnen & abonnieren" [ref=e141]
                - image
                - link "Mit Contentpass einloggen" [ref=e142]
          - sectionfooter
            - navigation
              - button "DE" [ref=e136]
                - image "DE"
            - navigation
              - list
                - listitem [level=1]
                  - link "Impressum" [ref=e143]
                - listitem [level=1]
                  - link "Datenschutz" [ref=e144]
                - listitem [level=1]
                  - link "Kontakt" [ref=e145]
                - listitem [level=1]
                  - link "AGB" [ref=e146]
                - listitem [level=1]
                  - link "FAQ" [ref=e147]
                - listitem [level=1]
                  - link "contentpass FAQ" [ref=e148]
  - generic
    - generic
      - link "Anzeige" [ref=e3]
    - generic
      - banner
        - banner
          - list
            - listitem [level=1]
              - link "Award" [ref=e39]
                - image
                - StaticText "Award"
            - listitem [level=1]
              - link "Mediadaten" [ref=e40]
                - StaticText "Mediadaten"
            - listitem [level=1]
              - link "Magazin" [ref=e41]
                - StaticText "Magazin"
          - link "it-daily Startseite" [ref=e16]
          - link "Header Ausgabe 0506 2026" [ref=e17]
            - image "Header Ausgabe 0506 2026"
          - generic
            - link "Registrieren" [ref=e18]
              - StaticText "Registrieren"
            - link "Anmelden" [ref=e19]
              - StaticText "Anmelden"
            - list
              - listitem [level=1]
                - link "Newsletter" [ref=e42]
                  - StaticText "Newsletter"
            - generic
              - link "English Version" [ref=e30]
                - image "English Version"
              - list
                - listitem [level=1]
                  - link "Linkedin" [ref=e56]
                    - StaticText "Linkedin"
                - listitem [level=1]
                  - link "Instagram" [ref=e57]
                    - StaticText "Instagram"
                - listitem [level=1]
                  - link "Facebook" [ref=e58]
                    - StaticText "Facebook"
                - listitem [level=1]
                  - link "Twitter X" [ref=e59]
                    - StaticText "Twitter X"
                    - image
                - listitem [level=1]
                  - link "Youtube" [ref=e60]
                    - StaticText "Youtube"
        - button "Open/Close Menu" [expanded=false, ref=e43]
          - image
          - StaticText "Menü"
        - navigation
          - generic
            - link "Newsticker" [ref=e44]
              - StaticText "Newsticker"
            - link "NIS2" [ref=e45]
              - StaticText "NIS2"
            - link "Quanten Computing" [ref=e46]
              - StaticText "Quanten Computing"
            - link "KI" [ref=e47]
              - StaticText "KI"
            - link "IT-Recht" [ref=e48]
              - StaticText "IT-Recht"
            - link "Monthly Spezial" [ref=e49]
              - StaticText "Monthly Spezial"
        - search
          - LabelText [ref=e50] clickable [cursor:pointer]
            - StaticText "Suche"
          - generic
            - StaticText "Suche"
          - searchbox "Suche" [ref=e51]
      - main
        - article
          - StaticText "Per API nutzbar"
          - heading "KI-Bildgenerierung: OpenAI stellt ChatGPT Images 2.0 vor" [level=1, ref=e6]
          - list
            - listitem [level=1]
              - time
                - StaticText "22. April, 2026"
            - listitem [level=1]
              - time
                - StaticText "15:55"
          - image "Chatgpt"

[... 287 more lines truncated, use browser_snapshot for full content]


- generic
  - Iframe "Contentpass First Layer" [ref=e2]
    - main
      - alertdialog "Weiter mit Werbung …"
        - generic
          - image "it-daily.net logo"
          - generic
            - article
              - heading "Weiter mit Werbung …" [level=1, ref=e134]
              - generic
                - paragraph
                  - StaticText "Nutzen Sie it-daily.net mit personalisierter Werbung, Tracking und Cookies "
                  - button "entgeltfrei. (Mehr erfahren)" [ref=e149]
                    - StaticText "entgeltfrei."
                    - image
                - paragraph
                  - StaticText "Für die Nutzung mit Werbung: Wir verarbeiten personenbezogene Daten (bspw. mittels Cookies, persönlichen Identifikatoren, IP-Adressen, individuelles Nutzungsverhalten) und übermitteln diese auch an Drittanbieter, die uns helfen, unser Webangebot zu verbessern und zu finanzieren. Dies umfasst auch die Übermittlung personenbezogener Daten in Drittländer (außerhalb der EU und EWR), insbesondere die USA, nach Art. 49 Abs. 1 a) DSGVO, wo ein vergleichbares Datenschutzniveau wie in der EU nicht gewährleistet ist. Indem Sie auf \"Akzeptieren und weiter\" klicken, willigen Sie hierzu (widerruflich) ein. Sie können Ihre Einwilligung jederzeit unter \"Widerruf Tracking\" in unserer "
                  - link "Datenschutzerklärung" [ref=e150]
                  - StaticText " mit Wirkung für die Zukunft widerrufen. Eine Verarbeitung der auf Ihrem Gerät gespeicherten Informationen wie z.B. Cookies oder persönliche Identifikatoren, IP-Adressen sowie Ihres individuellen Nutzungsverhaltens erfolgt dabei zu den unterstehenden Zwecken."
                - paragraph
                  - StaticText "Hierzu benötigen wir und unsere "
                  - button "946 Partner (Mehr erfahren)" [ref=e151]
                    - StaticText "946 Partner"
                    - image
                  - StaticText " Ihre "
                  - button "Einwilligung (Mehr erfahren)" [ref=e152]
                    - StaticText "Einwilligung"
                    - image
                  - StaticText " zur Verarbeitung von "
                  - button "personenbezogenen Daten (Mehr erfahren)" [ref=e153]
                    - StaticText "personenbezogenen Daten"
                    - image
                  - StaticText " (z.B. persönlichen Identifikatoren, Nutzungsdaten) für folgende Zwecke:"
                - list
                  - listitem [level=1]
                    - button "Speichern von oder Zugriff auf Informationen auf einem Endgerät" [expanded=false, ref=e156]
                      - image
                      - StaticText "Speichern von oder Zugriff auf Informationen auf einem Endgerät"
                  - listitem [level=1]
                    - button "Personalisierte Werbung und Inhalte, Messung von Werbeleistung und der Performance von Inhalten, Zielgruppenforschung sowie Entwicklung und Verbesserung von Angeboten" [expanded=false, ref=e157]
                      - image
                      - StaticText "Personalisierte Werbung und Inhalte, Messung von Werbeleistung und der Performance von Inhalten, Zielgruppenforschung sowie Entwicklung und Verbesserung von Angeboten"
                  - listitem [level=1]
                    - button "Genaue Standortdaten und Identifikation durch Scannen von Endgeräten" [expanded=false, ref=e158]
                      - image
                      - StaticText "Genaue Standortdaten und Identifikation durch Scannen von Endgeräten"
                  - listitem [level=1]
                    - button "Technisch notwendig" [expanded=false, ref=e159]
                      - image
                      - StaticText "Technisch notwendig"
                  - listitem [level=1]
                    - button "Anzeigen / Ads" [expanded=false, ref=e160]
                      - image
                      - StaticText "Anzeigen / Ads"
                  - listitem [level=1]
                    - button "Analyse / Statistiken" [expanded=false, ref=e161]
                      - image
                      - StaticText "Analyse / Statistiken"
                  - listitem [level=1]
                    - button "Social Media" [expanded=false, ref=e162]
                      - image
                      - StaticText "Social Media"
                  - listitem [level=1]
                    - button "Sonstiges" [expanded=false, ref=e163]
                      - image
                      - StaticText "Sonstiges"
                - paragraph
                  - StaticText "Ihre Einwilligung gilt nur für diese Website und Sie können sie jederzeit in den "
                  - link "Datenschutzeinstellungen" [ref=e154]
                  - StaticText " ändern oder widerrufen."
                - paragraph
                  - StaticText "Bitte beachten Sie, dass einige "
                  - link "Anbieter" [ref=e155]
                  - StaticText " Ihre personenbezogenen Daten auf Grundlage von berechtigtem Interesses verarbeiten können und nicht um Ihre Einwilligung bitten."
                - button "Scroll" [ref=e137]
                  - image
              - generic
                - button "Einwilligen & weiter" [ref=e138]
                  - StaticText "Einwilligen & weiter"
                - link "Datenschutzeinstellungen" [ref=e139]
            - article
              - heading "… oder mit Contentpass" [level=2, ref=e135]
              - paragraph
                - StaticText "Nutzen Sie it-daily.net und "
                - link "717 weitere Websites" [ref=e140]
                - StaticText ", wie z.B. winfuture.de und netzwelt.de, mit Contentpass werbe- und tracking-frei für pauschal 3,99€ monatlich."
              - generic
                - button "Ablehnen & abonnieren" [ref=e141]
                  - StaticText "Ablehnen & abonnieren"
                - image
                - link "Mit Contentpass einloggen" [ref=e142]
          - sectionfooter
            - navigation
              - button "DE" [ref=e136]
                - image "DE"
            - navigation
              - list
                - listitem [level=1]
                  - link "Impressum" [ref=e143]
                - listitem [level=1]
                  - link "Datenschutz" [ref=e144]
                - listitem [level=1]
                  - link "Kontakt" [ref=e145]
                - listitem [level=1]
                  - link "AGB" [ref=e146]
                - listitem [level=1]
                  - link "FAQ" [ref=e147]
                - listitem [level=1]
                  - link "contentpass FAQ" [ref=e148]
    - image
    - image
    - image
    - image
  - generic
    - generic
      - link "Anzeige" [ref=e3]
    - generic
      - banner
        - banner
          - list
            - listitem [level=1]
              - link "Award" [ref=e39]
                - image
                - StaticText "Award"
            - listitem [level=1]
              - link "Mediadaten" [ref=e40]
                - StaticText "Mediadaten"
            - listitem [level=1]
              - link "Magazin" [ref=e41]
                - StaticText "Magazin"
          - link "it-daily Startseite" [ref=e16]
          - link "Header Ausgabe 0506 2026" [ref=e17]
            - image "Header Ausgabe 0506 2026"
          - generic
            - link "Registrieren" [ref=e18]
              - StaticText "Registrieren"
            - link "Anmelden" [ref=e19]
              - StaticText "Anmelden"
            - list
              - listitem [level=1]
                - link "Newsletter" [ref=e42]
                  - StaticText "Newsletter"
            - generic
              - link "English Version" [ref=e30]
                - image "English Version"
              - list
                - listitem [level=1]
                  - link "Linkedin" [ref=e56]
                    - StaticText "Linkedin"

[... 347 more lines truncated, use browser_snapshot for full content]


Per API nutzbar
KI-Bildgenerierung: OpenAI stellt ChatGPT Images 2.0 vor
22. April, 2026
15:55
Bildquelle: jackpress / Shutterstock.com
Facebook
X
LinkedIn
Reddit
WhatsApp

Mit ChatGPT Images 2.0 und dem Modell gpt-image-2 aktualisiert OpenAI seine KI-Bildgenerierung, mit mehr Präzision, neuen Ausgabeformaten und API-Zugang für Entwickler.

OpenAI hat ChatGPT Images 2.0 veröffentlicht, ein aktualisiertes Bildgenerierungsmodell, das in ChatGPT und Codex integriert ist. Erstmals steht das zugrundeliegende Modell gpt-image-2 auch über eine API bereit. Laut OpenAI können Entwickler damit „Bildgenerierung und -bearbeitung direkt in ihre Produkte und Workflows integrieren.“

Anzeige

Images 2.0 soll komplexe Anweisungen deutlich zuverlässiger als die Vorgängerversion bearbeiten. Verbessert wurden die Darstellung kleiner Textelemente und UI-Komponenten, die Objektpositionierung sowie die Unterstützung von Seitenverhältnissen zwischen 3:1 und 1:3.

Thinking-Funktion und Mehrfachausgabe

Pro Anfrage kann das Modell bis zu acht inhaltlich zusammenhängende Bilder ausgeben, laut OpenAI „ideal für Poster-Sets, Storyboards, Comics oder Multi-Format-Kampagnen.“

Für Nutzer mit Plus-, Pro-, Business- oder Enterprise-Tarif steht zusätzlich eine Thinking-Funktion bereit. Das Modell kann dabei „Aufgaben durchdenken, bei Bedarf das Web nutzen und aus einem einzigen Prompt mehrere unterschiedliche Bilder generieren.“ Alle anderen ChatGPT-Nutzer haben weiterhin Zugang zu den Basisfunktionen.

Verfügbarkeit im Überblick
Basisfunktionen: alle ChatGPT- und Codex-Nutzer
Thinking-Funktionen: Plus-, Pro-, Business- und Enterprise-Tarif
API-Zugang: über gpt-image-2 für Entwickler verfügbar

Technische Details und Preismodell hat OpenAI im zugehörigen Blogpost veröffentlicht.

ChatGPT
OpenAI

Lars
Becker

Stellvertretender Chefredakteur

IT Verlag GmbH

Anzeige
24. Mai 2026
Ransomware – Viele CISOs würden Lösegeld zahlen
24. Mai 2026
10 Jahre DS-GVO: Wachsende Bürokratie und KI-Hürden belasten Wirtschaft
24. Mai 2026
Betrugsmasche CypherLoc setzt Nutzer mit Browser-Sperren unter Druck
24. Mai 2026
Energiesparwunder am Edge: Prozessoren im Takt des menschlichen Gehirns
Weitere Artikel
10 Jahre DS-GVO: Wachsende Bürokratie und KI-Hürden belasten Wirtschaft
Satelliten-Kommunikation: Europa testet Laser-Datenübertragung
Betrugsanzeigen: Meta, Google und TikTok löschen gemeldete Werbung kaum
Cyberangriff auf Patientendaten der Uniklinik Düsseldorf
Newsletter Box
Jetzt die smarten News aus der IT-Welt abonnieren! 💌
Jetzt Anmelden!
 it management it security it-daily Redaktion

Mit Klick auf den Button "Jetzt Anmelden" stimme ich der Datenschutzerklärung zu.


{"total_count": 0}

[Subdirectory context discovered: .hermes/hermes-agent/AGENTS.md]
# Hermes Agent - Development Guide

Instructions for AI coding assistants and developers working on the hermes-agent codebase.

## Development Environment

```bash
# Prefer .venv; fall back to venv if that's what your checkout has.
source .venv/bin/activate   # or: source venv/bin/activate
```

`scripts/run_tests.sh` probes `.venv` first, then `venv`, then
`$HOME/.hermes/hermes-agent/venv` (for worktrees that share a venv with the
main checkout).

## Project Structure

File counts shift constantly — don't treat the tree below as exhaustive.
The canonical source is the filesystem. The notes call out the load-bearing
entry points you'll actually edit.

```
hermes-agent/
├── run_agent.py          # AIAgent class — core conversation loop (~12k LOC)
├── model_tools.py        # Tool orchestration, discover_builtin_tools(), handle_function_call()
├── toolsets.py           # Toolset definitions, _HERMES_CORE_TOOLS list
├── cli.py                # HermesCLI class — interactive CLI orchestrator (~11k LOC)
├── hermes_state.py       # SessionDB — SQLite session store (FTS5 search)
├── hermes_constants.py   # get_hermes_home(), display_hermes_home() — profile-aware paths
├── hermes_logging.py     # setup_logging() — agent.log / errors.log / gateway.log (profile-aware)
├── batch_runner.py       # Parallel batch processing
├── agent/                # Agent internals (provider adapters, memory, caching, compression, etc.)
├── hermes_cli/           # CLI subcommands, setup wizard, plugins loader, skin engine
├── tools/                # Tool implementations — auto-discovered via tools/registry.py
│   └── environments/     # Terminal backends (local, docker, ssh, modal, daytona, singularity)
├── gateway/              # Messaging gateway — run.py + session.py + platforms/
│   ├── platforms/        # Adapter per platform (telegram, discord, slack, whatsapp,
│   │                     #   homeassistant, signal, matrix, mattermost, email, sms,
│   │                     #   dingtalk, wecom, weixin, feishu, qqbot, bluebubbles,
│   │                     #   yuanbao, webhook, api_server, ...). See ADDING_A_PLATFORM.md.
│   └── builtin_hooks/    # Extension point for always-registered gateway hooks (none shipped)
├── plugins/              # Plugin system (see "Plugins" section below)
│   ├── memory/           # Memory-provider plugins (honcho, mem0, supermemory, ...)
│   ├── context_engine/   # Context-engine plugins
│   ├── model-providers/  # Inference backend plugins (openrouter, anthropic, gmi, ...)
│   ├── kanban/           # Multi-agent board dispatcher + worker plugin
│   ├── hermes-achievements/  # Gamified achievement tracking
│   ├── observability/    # Metrics / traces / logs plugin
│   ├── image_gen/        # Image-generation providers
│   └── <others>/         # disk-cleanup, example-dashboard, google_meet, platforms,
│                         #   spotify, strike-freedom-cockpit, ...
├── optional-skills/      # Heavier/niche skills shipped but NOT active by default
├── skills/               # Built-in skills bundled with the repo
├── ui-tui/               # Ink (React) terminal UI — `hermes --tui`
│   └── src/              # entry.tsx, app.tsx, gatewayClient.ts + app/components/hooks/lib
├── tui_gateway/          # Python JSON-RPC backend for the TUI
├── acp_adapter/          # ACP server (VS Code / Zed / JetBrains integration)
├── cron/                 # Scheduler — jobs.py, scheduler.py
├── scripts/              # run_tests.sh, release.py, auxiliary scripts
├── website/              # Docusaurus docs site
└── tests/                # Pytest suite (~17k tests across ~900 files as of May 2026)
```

**User config:** `~/.hermes/config.yaml` (settings), `~/.hermes/.env` (API keys only).
**Logs:** `~/.hermes/logs/` — `agent.log` (INFO+), `errors.log` (WARNING+),
`gateway.log` when running the gateway. Profile-aware via `get_hermes_home()`.
Browse with `hermes logs [--follow] [--level ...] [--session ...]`.

## File Dependency Chain

```
tools/registry.py  (no deps — imported by all tool files)
       ↑
tools/*.py  (each calls registry.register() at import time)
       ↑
model_tools.py  (imports tools/registry + triggers tool discovery)
       ↑
run_agent.py, cli.py, batch_runner.py, environments/
```

---

## AIAgent Class (run_agent.py)

The real `AIAgent.__init__` takes ~60 parameters (credentials, routing, callbacks,
session context, budget, credential pool, etc.). The signature below is the
minimum subset you'll usually touch — read `run_agent.py` for the full list.

```python
class AIAgent:
    def __init__(self,
        base_url: str = None,
        api_key: str = None,
        provider: str = None,
        api_mode: str = None,              # "chat_completions" | "codex_responses" | ...
        model: str = "",                   # empty → resolved from config/provider later
        max_iterations: int = 90,          # tool-calling iterations (shared with subagents)
        enabled_toolsets: list = None,
        disabled_toolsets: list = None,
        quiet_mode: bool = False,
        save_trajectories: bool = False,
        platform: str = None,              # "cli", "telegram", etc.
        session_id: str = None,
        skip_context_files: bool = False,
        skip_memory: bool = False,
        credential_pool=None,
        # ... plus callbacks, thread/user/chat IDs, iteration_budget, fallback_model,
        # checkpoints config, prefill_messages, service_tier, reasoning_config, etc.
    ): ...

    def chat(self, message: str) -> str:
        """Simple interface — returns final response string."""

    def run_conversation(self, user_message: str, system_message: str = None,
                         conversation_history: list = None, task_id: str = None) -> dict:
        """Full interface — returns dict with final_response + messages."""
```

### Agent Loop

The core loop is inside `run_conversation()` — entirely synchronous, with
interrupt checks, budget tracking, and a one-turn grace call:

```python
while (api_call_count < self.max_iterations and self.iteration_budget.remaining > 0) \
        or self._budget_grace_call:
    if self._interrupt_requested: break
    response = client.chat.completions.create(model=model, messages=messages, tools=tool_schemas)
    if response.tool_calls:
        for tool_call in response.tool_calls:
            result = handle_function_call(tool_call.name, tool_call.args, task_id)
            messages.append(tool_result_message(result))
        api_call_count += 1
    else:
        return response.content
```

Messages follow OpenAI format: `{"role": "system/user/assistant/tool", ...}`.
Reasoning content is stored in `assistant_msg["reasoning"]`.

---

## CLI Architecture (cli.py)

- **Rich** for banner/panels, **prompt_toolkit** for input with autocomplete
- **KawaiiSpinner** (`agent/display.py`) — animated faces during API calls, `┊` activity feed for tool results
- `load_cli_config()` in cli.py merges hardcoded defaults + user config YAML
- **Skin engine** (`hermes_cli/skin_engine.py`) — data-driven CLI theming; initialized from `display.skin` config key at startup; skins customize banner colors, spinner faces/verbs/wings, tool prefix, response box, branding text
- `process_command()` is a method on `HermesCLI` — dispatches on canonical command name resolved via `resolve_command()` from the central registry
- Skill slash commands: `agent/skill_commands.py` scans `~/.hermes/skills/`, injects as **user message** (not system prompt) to preserve prompt caching

### Slash Command Registry (`hermes_cli/commands.py`)

All slash commands are defined in a central `COMMAND_REGISTRY` list of `CommandDef` objects. Every downstream consumer derives from this registry automatically:

- **CLI** — `process_command()` resolves aliases via `resolve_command()`, dispatches on canonical name
- **Gateway** — `GATEWAY_KNOWN_COMMANDS` frozenset for hook emission, `resolve_command()` for dispatch
- **Gateway help** — `gateway_help_lines()` generat

[...truncated AGENTS.md: 50,982 chars total]


     1|#!/usr/bin/env python3
     2|"""
     3|Image Generation Tools Module
     4|
     5|Provides image generation via FAL.ai. Multiple FAL models are supported and
     6|selectable via ``hermes tools`` → Image Generation; the active model is
     7|persisted to ``image_gen.model`` in ``config.yaml``.
     8|
     9|Architecture:
    10|- ``FAL_MODELS`` is a catalog of supported models with per-model metadata
    11|  (size-style family, defaults, ``supports`` whitelist, upscaler flag).
    12|- ``_build_fal_payload()`` translates the agent's unified inputs (prompt +
    13|  aspect_ratio) into the model-specific payload and filters to the
    14|  ``supports`` whitelist so models never receive rejected keys.
    15|- Upscaling via FAL's Clarity Upscaler is gated per-model via the ``upscale``
    16|  flag — on for FLUX 2 Pro (backward-compat), off for all faster/newer models
    17|  where upscaling would either hurt latency or add marginal quality.
    18|
    19|Pricing shown in UI strings is as-of the initial commit; we accept drift and
    20|update when it's noticed.
    21|"""
    22|
    23|import json
    24|import logging
    25|import os
    26|import datetime
    27|import threading
    28|import uuid
    29|from typing import Any, Dict, Optional, Union
    30|from urllib.parse import urlencode
    31|
    32|# fal_client is imported lazily — see _load_fal_client(). Pulling it
    33|# eagerly added ~64 ms to every CLI cold start because
    34|# discover_builtin_tools() imports this module unconditionally during
    35|# the registry walk, even when image generation is never used.
    36|#
    37|# Tests that monkeypatch this attribute (e.g.
    38|# ``monkeypatch.setattr(image_tool, "fal_client", fake_fal_client)``)
    39|# still work: _load_fal_client() short-circuits when the attribute is
    40|# anything truthy, so a test-installed mock is not overwritten by a
    41|# subsequent real import.
    42|fal_client: Any = None
    43|
    44|
    45|def _load_fal_client() -> Any:
    46|    """Lazily import fal_client and rebind the module global on first use.
    47|
    48|    Idempotent. Returns the (now-loaded) ``fal_client`` module reference.
    49|    Skips the import if the global is already truthy — this preserves the
    50|    test pattern of monkeypatching the module global to install a mock.
    51|    """
    52|    global fal_client
    53|    if fal_client is not None:
    54|        return fal_client
    55|    try:
    56|        from tools.lazy_deps import ensure as _lazy_ensure
    57|        _lazy_ensure("image.fal", prompt=False)
    58|    except ImportError:
    59|        pass
    60|    except Exception as e:
    61|        raise ImportError(str(e))
    62|    import fal_client as _fal_client  # noqa: F811 — module-global rebind
    63|    fal_client = _fal_client
    64|    return fal_client
    65|
    66|
    67|from tools.debug_helpers import DebugSession
    68|from tools.managed_tool_gateway import resolve_managed_tool_gateway
    69|from tools.tool_backend_helpers import (
    70|    fal_ke...ured,
    71|    managed_nous_tools_enabled,
    72|    prefers_gateway,
    73|)
    74|
    75|logger = logging.getLogger(__name__)
    76|
    77|
    78|# ---------------------------------------------------------------------------
    79|# FAL model catalog
    80|# ---------------------------------------------------------------------------
    81|#
    82|# Each entry declares how to translate our unified inputs into the model's
    83|# native payload shape. Size specification falls into three families:
    84|#
    85|#   "image_size_preset" — preset enum ("square_hd", "landscape_16_9", ...)
    86|#                          used by the flux family, z-image, qwen, recraft,
    87|#                          ideogram.
    88|#   "aspect_ratio"      — aspect ratio enum ("16:9", "1:1", ...) used by
    89|#                          nano-banana (Gemini).
    90|#   "gpt_literal"       — literal dimension strings ("1024x1024", etc.)
    91|#                          used by gpt-image-1.5.
    92|#
    93|# ``supports`` is a whitelist of keys allowed in the outgoing payload — any
    94|# key outside this set is stripped before submission so models never receive
    95|# rejected parameters (each FAL model rejects unknown keys differently).
    96|#
    97|# ``upscale`` controls whether to chain Clarity Upscaler after generation.
    98|
    99|FAL_MODELS: Dict[str, Dict[str, Any]] = {
   100|    "fal-ai/flux-2/klein/9b": {
   101|        "display": "FLUX 2 Klein 9B",
   102|        "speed": "<1s",
   103|        "strengths": "Fast, crisp text",
   104|        "price": "$0.006/MP",
   105|        "size_style": "image_size_preset",
   106|        "sizes": {
   107|            "landscape": "landscape_16_9",
   108|            "square": "square_hd",
   109|            "portrait": "portrait_16_9",
   110|        },
   111|        "defaults": {
   112|            "num_inference_steps": 4,
   113|            "output_format": "png",
   114|            "enable_safety_checker": False,
   115|        },
   116|        "supports": {
   117|            "prompt", "image_size", "num_inference_steps", "seed",
   118|            "output_format", "enable_safety_checker",
   119|        },
   120|        "upscale": False,
   121|    },
   122|    "fal-ai/flux-2-pro": {
   123|        "display": "FLUX 2 Pro",
   124|        "speed": "~6s",
   125|        "strengths": "Studio photorealism",
   126|        "price": "$0.03/MP",
   127|        "size_style": "image_size_preset",
   128|        "sizes": {
   129|            "landscape": "landscape_16_9",
   130|            "square": "square_hd",
   131|            "portrait": "portrait_16_9",
   132|        },
   133|        "defaults": {
   134|            "num_inference_steps": 50,
   135|            "guidance_scale": 4.5,
   136|            "num_images": 1,
   137|            "output_format": "png",
   138|            "enable_safety_checker": False,
   139|            "safety_tolerance": "5",
   140|            "sync_mode": True,
   141|        },
   142|        "supports": {
   143|            "prompt", "image_size", "num_inference_steps", "guidance_scale",
   144|            "num_images", "output_format", "enable_safety_checker",
   145|            "safety_tolerance", "sync_mode", "seed",
   146|        },
   147|        "upscale": True,   # Backward-compat: current default behavior.
   148|    },
   149|    "fal-ai/z-image/turbo": {
   150|        "display": "Z-Image Turbo",
   151|        "speed": "~2s",
   152|        "strengths": "Bilingual EN/CN, 6B",
   153|        "price": "$0.005/MP",
   154|        "size_style": "image_size_preset",
   155|        "sizes": {
   156|            "landscape": "landscape_16_9",
   157|            "square": "square_hd",
   158|            "portrait": "portrait_16_9",
   159|        },
   160|        "defaults": {
   161|            "num_inference_steps": 8,
   162|            "num_images": 1,
   163|            "output_format": "png",
   164|            "enable_safety_checker": False,
   165|            "enable_prompt_expansion": False,  # avoid the extra per-request charge
   166|        },
   167|        "supports": {
   168|            "prompt", "image_size", "num_inference_steps", "num_images",
   169|            "seed", "output_format", "enable_safety_checker",
   170|            "enable_prompt_expansion",
   171|        },
   172|        "upscale": False,
   173|    },
   174|    "fal-ai/nano-banana-pro": {
   175|        "display": "Nano Banana Pro (Gemini 3 Pro Image)",
   176|        "speed": "~8s",
   177|        "strengths": "Gemini 3 Pro, reasoning depth, text rendering",
   178|        "price": "$0.15/image (1K)",
   179|        "size_style": "aspect_ratio",
   180|        "sizes": {
   181|            "landscape": "16:9",
   182|            "square": "1:1",
   183|            "portrait": "9:16",
   184|        },
   185|        "defaults": {
   186|            "num_images": 1,
   187|            "output_format": "png",
   188|            "safety_tolerance": "5",
   189|            # "1K" is the cheapest tier; 4K doubles the per-image cost.
   190|            # Users on Nous Subscription should stay at 1K for predictable billing.
   191|            "resolution": "1K",
   192|        },
   193|        "supports": {
   194|            "prompt", "aspect_ratio", "num_images", "output_format",
   195|            "safety_tolerance", "seed", "sync_mode", "resolution",
   196|            "enable_web_search", "limit_generations",
   197|        },
   198|        "upscale": False,
   199|    },
   200|    "fal-ai/gpt-image-1.5": {
   201|        "display": "GPT Image 1.5",
   202|        "speed": "~15s",
   203|        "strengths": "Prompt adherence",
   204|        "price": "$0.034/image",
   205|        "size_style": "gpt_literal",
   206|        "sizes": {
   207|            "landscape": "1536x1024",
   208|            "square": "1024x1024",
   209|            "portrait": "1024x1536",
   210|        },
   211|        "defaults": {
   212|            # Quality is pinned to medium to keep portal billing predictable
   213|            # across all users (low is too rough, high is 4-6x more expensive).
   214|            "quality": "medium",
   215|            "num_images": 1,
   216|            "output_format": "png",
   217|        },
   218|        "supports": {
   219|            "prompt", "image_size", "quality", "num_images", "output_format",
   220|            "background", "sync_mode",
   221|

Use offset=221 to continue reading (showing 1-220 of 1098 lines)


   220|            "background", "sync_mode",
   221|        },
   222|        "upscale": False,
   223|    },
   224|    "fal-ai/gpt-image-2": {
   225|        "display": "GPT Image 2",
   226|        "speed": "~20s",
   227|        "strengths": "SOTA text rendering + CJK, world-aware photorealism",
   228|        "price": "$0.04–0.06/image",
   229|        # GPT Image 2 uses FAL's standard preset enum (unlike 1.5's literal
   230|        # dimensions). We map to the 4:3 variants — the 16:9 presets
   231|        # (1024x576) fall below GPT-Image-2's 655,360 min-pixel requirement
   232|        # and would be rejected. 4:3 keeps us above the minimum on all
   233|        # three aspect ratios.
   234|        "size_style": "image_size_preset",
   235|        "sizes": {
   236|            "landscape": "landscape_4_3",   # 1024x768
   237|            "square": "square_hd",            # 1024x1024
   238|            "portrait": "portrait_4_3",       # 768x1024
   239|        },
   240|        "defaults": {
   241|            # Same quality pinning as gpt-image-1.5: medium keeps Nous
   242|            # Portal billing predictable. "high" is 3-4x the per-image
   243|            # cost at the same size; "low" is too rough for production use.
   244|            "quality": "medium",
   245|            "num_images": 1,
   246|            "output_format": "png",
   247|        },
   248|        "supports": {
   249|            "prompt", "image_size", "quality", "num_images", "output_format",
   250|            "sync_mode",
   251|            # openai_api_key (BYOK) intentionally omitted — all users go
   252|            # through the shared FAL billing path.
   253|        },
   254|        "upscale": False,
   255|    },
   256|    "fal-ai/ideogram/v3": {
   257|        "display": "Ideogram V3",
   258|        "speed": "~5s",
   259|        "strengths": "Best typography",
   260|        "price": "$0.03-0.09/image",
   261|        "size_style": "image_size_preset",
   262|        "sizes": {
   263|            "landscape": "landscape_16_9",
   264|            "square": "square_hd",
   265|            "portrait": "portrait_16_9",
   266|        },
   267|        "defaults": {
   268|            "rendering_speed": "BALANCED",
   269|            "expand_prompt": True,
   270|            "style": "AUTO",
   271|        },
   272|        "supports": {
   273|            "prompt", "image_size", "rendering_speed", "expand_prompt",
   274|            "style", "seed",
   275|        },
   276|        "upscale": False,
   277|    },
   278|    "fal-ai/recraft/v4/pro/text-to-image": {
   279|        "display": "Recraft V4 Pro",
   280|        "speed": "~8s",
   281|        "strengths": "Design, brand systems, production-ready",
   282|        "price": "$0.25/image",
   283|        "size_style": "image_size_preset",
   284|        "sizes": {
   285|            "landscape": "landscape_16_9",
   286|            "square": "square_hd",
   287|            "portrait": "portrait_16_9",
   288|        },
   289|        "defaults": {
   290|            # V4 Pro dropped V3's required `style` enum — defaults handle taste now.
   291|            "enable_safety_checker": False,
   292|        },
   293|        "supports": {
   294|            "prompt", "image_size", "enable_safety_checker",
   295|            "colors", "background_color",
   296|        },
   297|        "upscale": False,
   298|    },
   299|    "fal-ai/qwen-image": {
   300|        "display": "Qwen Image",
   301|        "speed": "~12s",
   302|        "strengths": "LLM-based, complex text",
   303|        "price": "$0.02/MP",
   304|        "size_style": "image_size_preset",
   305|        "sizes": {
   306|            "landscape": "landscape_16_9",
   307|            "square": "square_hd",
   308|            "portrait": "portrait_16_9",
   309|        },
   310|        "defaults": {
   311|            "num_inference_steps": 30,
   312|            "guidance_scale": 2.5,
   313|            "num_images": 1,
   314|            "output_format": "png",
   315|            "acceleration": "regular",
   316|        },
   317|        "supports": {
   318|            "prompt", "image_size", "num_inference_steps", "guidance_scale",
   319|            "num_images", "output_format", "acceleration", "seed", "sync_mode",
   320|        },
   321|        "upscale": False,
   322|    },
   323|}
   324|
   325|# Default model is the fastest reasonable option. Kept cheap and sub-1s.
   326|DEFAULT_MODEL = "fal-ai/flux-2/klein/9b"
   327|
   328|DEFAULT_ASPECT_RATIO = "landscape"
   329|VALID_ASPECT_RATIOS = ("landscape", "square", "portrait")
   330|
   331|
   332|# ---------------------------------------------------------------------------
   333|# Upscaler (Clarity Upscaler — unchanged from previous implementation)
   334|# ---------------------------------------------------------------------------
   335|UPSCALER_MODEL = "fal-ai/clarity-upscaler"
   336|UPSCALER_FACTOR = 2
   337|UPSCALER_SAFETY_CHECKER = False
   338|UPSCALER_DEFAULT_PROMPT = "masterpiece, best quality, highres"
   339|UPSCALER_NEGATIVE_PROMPT = "(worst quality, low quality, normal quality:2)"
   340|UPSCALER_CREATIVITY = 0.35
   341|UPSCALER_RESEMBLANCE = 0.6
   342|UPSCALER_GUIDANCE_SCALE = 4
   343|UPSCALER_NUM_INFERENCE_STEPS = 18
   344|
   345|
   346|_debug = DebugSession("image_tools", env_var="IMAGE_TOOLS_DEBUG")
   347|_managed_fal_client = None
   348|_managed_fal_client_config = None
   349|_managed_fal_client_lock = threading.Lock()
   350|
   351|
   352|# ---------------------------------------------------------------------------
   353|# Managed FAL gateway (Nous Subscription)
   354|# ---------------------------------------------------------------------------
   355|def _resolve_managed_fal_gateway():
   356|    """Return managed fal-queue gateway config when the user prefers the gateway
   357|    or direct FAL credentials are absent."""
   358|    if fal_ke...ured() and not prefers_gateway("image_gen"):
   359|        return None
   360|    return resolve_managed_tool_gateway("fal-queue")
   361|
   362|
   363|def _normalize_fal_queue_url_format(queue_run_origin: str) -> str:
   364|    normalized_origin = str(queue_run_origin or "").strip().rstrip("/")
   365|    if not normalized_origin:
   366|        raise ValueError("Managed FAL queue origin is required")
   367|    return f"{normalized_origin}/"
   368|
   369|
   370|class _ManagedFalSyncClient:
   371|    """Small per-instance wrapper around fal_client.SyncClient for managed queue hosts."""
   372|
   373|    def __init__(self, *, key: str, queue_run_origin: str):
   374|        # Trigger the lazy import on first construction. Idempotent — the
   375|        # placeholder is overwritten with the real module on first call.
   376|        _load_fal_client()
   377|        sync_client_class = getattr(fal_client, "SyncClient", None)
   378|        if sync_client_class is None:
   379|            raise RuntimeError("fal_client.SyncClient is required for managed FAL gateway mode")
   380|
   381|        client_module = getattr(fal_client, "client", None)
   382|        if client_module is None:
   383|            raise RuntimeError("fal_client.client is required for managed FAL gateway mode")
   384|
   385|        self._queue_url_format = _normalize_fal_queue_url_format(queue_run_origin)
   386|        self._sync_client = sync_client_class(key=key)
   387|        self._http_client = getattr(self._sync_client, "_client", None)
   388|        self._maybe_retry_request = getattr(client_module, "_maybe_retry_request", None)
   389|        self._raise_for_status = getattr(client_module, "_raise_for_status", None)
   390|        self._request_handle_class = getattr(client_module, "SyncRequestHandle", None)
   391|        self._add_hint_header = getattr(client_module, "add_hint_header", None)
   392|        self._add_priority_header = getattr(client_module, "add_priority_header", None)
   393|        self._add_timeout_header = getattr(client_module, "add_timeout_header", None)
   394|
   395|        if self._http_client is None:
   396|            raise RuntimeError("fal_client.SyncClient._client is required for managed FAL gateway mode")
   397|        if self._maybe_retry_request is None or self._raise_for_status is None:
   398|            raise RuntimeError("fal_client.client request helpers are required for managed FAL gateway mode")
   399|        if self._request_handle_class is None:
   400|

Use offset=400 to continue reading (showing 220-399 of 1098 lines)


Explanation:
**Inspecting image setup**

I'm noticing that there’s already a gpt-image-2 via FAL, which is fascinating! I need to figure out how to set this up properly. It sounds like a good idea to inspect the configuration for image generation. I want to ensure everything is configured correctly so that I can help with whatever comes next. Let’s make sure I’ve got all the necessary details to proceed!


Explanation:
**Investigating search functionality**

I’m considering that the search might be broken or ignoring certain commands. I wonder if I should try using the terminal for grep instead, but the rules say to stick with search. However, it seems like the search isn’t finding information due to something. I might need to explore the options to read more or check the registered schema and configuration commands related to model selection. Let's see where that leads!