{"id":49205542,"url":"https://github.com/calmingstorm/odin","last_synced_at":"2026-05-31T01:04:42.870Z","repository":{"id":352919747,"uuid":"1210492296","full_name":"Calmingstorm/Odin","owner":"Calmingstorm","description":"Autonomous execution agent on Discord — 71 tools, shell access, browser automation, scheduled tasks, sub-agents, knowledge base, 19-page web UI. Norse god of wisdom, stuck managing infrastructure.","archived":false,"fork":false,"pushed_at":"2026-04-23T16:42:11.000Z","size":2097,"stargazers_count":1,"open_issues_count":15,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-23T18:37:11.522Z","etag":null,"topics":["ai-agent","automation","devops","discord-bot","infrastructure"],"latest_commit_sha":null,"homepage":"https://odin-bot.net","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Calmingstorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T13:22:00.000Z","updated_at":"2026-04-23T16:41:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Calmingstorm/Odin","commit_stats":null,"previous_names":["calmingstorm/odin"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/Calmingstorm/Odin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calmingstorm%2FOdin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calmingstorm%2FOdin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calmingstorm%2FOdin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calmingstorm%2FOdin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Calmingstorm","download_url":"https://codeload.github.com/Calmingstorm/Odin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Calmingstorm%2FOdin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32274987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T18:29:39.964Z","status":"ssl_error","status_checked_at":"2026-04-25T18:29:32.149Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","automation","devops","discord-bot","infrastructure"],"created_at":"2026-04-23T18:01:29.504Z","updated_at":"2026-05-31T01:04:42.863Z","avatar_url":"https://github.com/Calmingstorm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Odin\n\nAn autonomous execution agent on Discord. Norse god of wisdom and war, stuck managing mortal infrastructure for eternity.\n\nOdin executes real work from Discord: incident response, deploys, investigations, code review, automation, and scheduled operations across 70 tools (25 core, 47 skill). It runs shell commands on managed hosts, uses browser automation, orchestrates agents and workflows, and verifies results automatically after service changes.\n\n## Why operators pick Odin\n\nMost AI bots stop at advice. Odin executes.\n\n- **Runs real systems** — SSH on managed hosts, Docker, Kubernetes, Terraform, browser automation, and file operations from chat.\n- **Finishes multi-step work** — scheduling, background workflows, autonomous loops, and sub-agents for fan-out tasks.\n- **Verifies outcomes** — `validate_action` auto-triggers after service restarts, deploys, and config changes. HMAC-signed audit trail for every tool call.\n- **Stays operationally useful** — persistent memory, knowledge search, web UI, and trajectory logging keep context attached to the work.\n\n## Quick examples\n\nTell Odin things like:\n\n- `@Odin restart nginx and verify the site is healthy`\n- `@Odin investigate why backups failed last night and summarize the root cause`\n- `@Odin deploy this branch to staging, run validation, and post the diff`\n- `@Odin schedule a disk check every 6 hours and alert if usage exceeds 85%`\n\n## What It Can Do\n\n**Infrastructure \u0026 DevOps**\n- Shell execution on managed hosts (`run_command`, `run_script`, `run_command_multi`)\n- Git operations, Docker management, kubectl, Terraform\n- HTTP endpoint probing with timing breakdown\n- Post-change validation (`validate_action`) — auto-verifies service health after restarts, deploys, config writes\n- Scheduled health checks, daily infrastructure digests\n\n**AI \u0026 Code**\n- Claude Code delegation for code generation, review, and analysis\n- Codex (GPT-5.5) conversation with full tool use\n- ComfyUI image generation\n- PDF analysis, image analysis, web search, browser automation\n\n**Automation**\n- Autonomous loops with stuck-detection and backoff\n- Sub-agent spawning (parallel, nested up to depth 2)\n- User-created Python skills with hot-reload and AST validation\n- Cron scheduling with webhook triggers (Gitea, Grafana, GitHub, GitLab)\n\n**Knowledge \u0026 Memory**\n- Persistent memory (per-user and global key-value notes)\n- Knowledge base with FTS5 + vector search, dedup, versioning\n- Conversation session management with adaptive compaction\n- Trajectory saving for every interaction (per-turn JSONL)\n\n**Security**\n- CommandGovernor: blocks destructive shell commands and exfiltration patterns before execution\n- Permission tiers (admin/user/guest) with per-tool RBAC\n- Per-user host access control with configurable defaults (WebUI-managed)\n- Secret scrubbing on all input/output paths (API keys, tokens, JWTs, AWS keys, database URIs)\n- SSRF validation on all URL-accepting endpoints\n- DOMPurify-sanitized markdown rendering in web UI\n- AST-based skill validation (no exec during validation)\n- Web API authentication with session isolation and CSRF protection\n\n**Web UI** (19 pages)\n- Dashboard, chat, sessions, tools, skills, knowledge\n- Schedules, loops, agents, processes, audit log\n- Config editor, memory viewer, traces, health, resources\n- Real-time tool execution viewer with streaming output\n\n## Architecture\n\n```\nDiscord ──\u003e OdinBot (client.py)\n               │\n               ├── Tool Executor ──\u003e 70 tools (shell, browser, git, docker, etc.)\n               │       │\n               │       ├── CommandGovernor (blocks dangerous commands)\n               │       ├── Risk Classifier (observability tags)\n               │       └── Bulkhead isolation (concurrency limits)\n               │\n               ├── Codex Client ──\u003e GPT-5.5 (tool loop with up to 500 iterations)\n               │       │\n               │       ├── Response Guards (fabrication, hedging, premature failure)\n               │       ├── Completion Classifier (fail-open)\n               │       └── Context Compressor (adaptive)\n               │\n               ├── Agent Manager ──\u003e Sub-agents (parallel, nested)\n               ├── Loop Manager ──\u003e Autonomous monitoring loops\n               ├── Scheduler ──\u003e Cron + one-shot + webhook triggers\n               ├── Skill Manager ──\u003e User-created Python tools\n               ├── Knowledge Store ──\u003e FTS5 + vector search\n               ├── Session Manager ──\u003e Per-channel history + compaction\n               ├── Browser (native Playwright) ──\u003e Screenshots, page reading, JS eval\n               └── Web API (aiohttp) ──\u003e 154 REST endpoints + WebSocket\n```\n\n## Quick Start\n\n```bash\n# 1. Clone and install\ngit clone https://github.com/Calmingstorm/Odin.git\ncd Odin\npip install -e \".[dev]\"\nplaywright install chromium\n\n# 2. Configure\ncp .env.example .env        # Add your Discord bot token\nedit config.yml              # Set hosts, Codex credentials, etc.\n\n# 3. Run\npython -m src\n```\n\nThe web UI starts automatically at the configured port (default 3000). Set `web.api_token` in config.yml to require authentication.\n\n## Codex Authentication\n\nOdin uses OpenAI Codex (ChatGPT subscription) for its LLM backend. Authentication requires a one-time OAuth login that generates tokens stored in `data/codex_auth.json`.\n\n**Browser login** (machine with a browser):\n```bash\npython scripts/codex_login.py\n```\n\n**Device login** (headless servers):\n```bash\npython scripts/codex_login.py --device\n```\nThis displays a code to enter at `https://auth.openai.com/codex/device` — no local browser needed.\n\n**WebUI**: System \u003e Codex Auth tab shows account status and supports device flow login.\n\n**Multi-account**: Store multiple credential sets as a JSON array in `data/codex_auth.json`. Odin rotates between them on rate limits automatically.\n\nTokens auto-refresh at runtime. Re-run the login script if the bot is offline for more than ~8 days (refresh token expiry).\n\n## Configuration\n\n| File | Purpose |\n|------|---------|\n| `config.yml` | Main config: Discord, tools, LLM, browser, scheduling, web UI, permissions |\n| `.env` | Secrets: `DISCORD_TOKEN` |\n| `data/codex_auth.json` | Codex OAuth credentials (generated via `scripts/codex_login.py`) |\n| `data/context/*.md` | Infrastructure context files injected into every LLM prompt |\n\n### Key Config Sections\n\n- **`discord`**: token, allowed users/channels, mention-only mode, bot interaction\n- **`openai_codex`**: model, max tokens, credentials, model routing, context compression\n- **`tools`**: SSH hosts, command timeout, per-tool timeout overrides, Claude Code host\n- **`browser`**: native Playwright (empty `cdp_url`) or remote CDP endpoint\n- **`web`**: port, API token, session timeout\n- **`permissions`**: default tier, per-user overrides\n\n## Tools (70)\n\n| Category | Tools |\n|----------|-------|\n| Shell \u0026 Files | `run_command`, `run_script`, `run_command_multi`, `read_file`, `write_file`, `generate_file`, `post_file`, `manage_process` |\n| Infrastructure | `git_ops`, `docker_ops`, `kubectl`, `terraform_ops`, `http_probe` |\n| Agents \u0026 Orchestration | `delegate_task`, `list_tasks`, `cancel_task`, `spawn_agent`, `send_to_agent`, `list_agents`, `kill_agent`, `get_agent_results`, `wait_for_agents`, `spawn_loop_agents`, `collect_loop_agents` |\n| Scheduling \u0026 Loops | `schedule_task`, `list_schedules`, `update_schedule`, `delete_schedule`, `parse_time`, `start_loop`, `stop_loop`, `list_loops` |\n| AI \u0026 Code | `claude_code`, `generate_image`, `analyze_image`, `analyze_pdf` |\n| Skills | `create_skill`, `edit_skill`, `delete_skill`, `list_skills`, `enable_skill`, `disable_skill`, `install_skill`, `export_skill`, `skill_status`, `invoke_skill` |\n| Knowledge \u0026 Memory | `memory_manage`, `manage_list`, `search_history`, `search_audit`, `search_knowledge`, `ingest_document`, `bulk_ingest_knowledge`, `list_knowledge`, `delete_knowledge` |\n| Web \u0026 Browser | `web_search`, `fetch_url`, `browser_screenshot`, `browser_read_page`, `browser_read_table`, `browser_click`, `browser_fill`, `browser_evaluate` |\n| Discord | `read_channel`, `add_reaction`, `create_poll`, `purge_messages` |\n| Validation \u0026 Security | `validate_action`, `set_permission`, `issue_tracker` |\n\n## Testing\n\n```bash\n# Full suite (105 files, ~3,584 test functions)\npytest tests/ -q\n\n# Skip slow/optional tests\npytest tests/ --ignore=tests/test_tools -q\n```\n\n## Project Structure\n\n```\nsrc/\n  __main__.py              Entry point\n  config/schema.py         Pydantic config models\n  discord/\n    client.py              OdinBot — main executor (~4800 lines)\n    response_guards.py     Fabrication, hedging, premature failure detection\n    tool_loop_helpers.py   Request preamble, topic change detection\n    cogs/                  9 moderation/utility cog extensions\n  tools/\n    executor.py            Tool dispatch + recovery\n    registry.py            72 tool definitions (25 core, 47 skill)\n    skill_manager.py       Skill CRUD + AST validation\n    risk_classifier.py    CommandGovernor + risk classification\n    post_validation.py     validate_action implementation\n    recovery.py            Error classification + retry\n    browser.py             Native Playwright browser\n  llm/\n    system_prompt.py       Identity, execution policy, tool hierarchy\n    openai_codex.py        Codex streaming client\n    auxiliary.py            Smart model routing (cheap/strong)\n    secret_scrubber.py     Secret detection and redaction\n    context_compressor.py  Adaptive context compression\n  async_utils.py           fire_and_forget helper for background tasks\n  permissions/\n    manager.py             Permission tiers + RBAC\n    host_access.py         Per-user host access control\n  agents/manager.py        Sub-agent lifecycle + state machine\n  scheduler/scheduler.py   Cron + one-shot + webhook triggers\n  sessions/manager.py      Per-channel history + compaction + topic detection\n  knowledge/store.py       FTS5 + vector knowledge base\n  health/server.py         aiohttp web server + auth middleware\n  web/\n    api.py                 154 REST endpoints\n    websocket.py           Live event streaming + WS chat\n  audit/logger.py          HMAC-chainable audit log\n  learning/reflector.py    Cross-conversation learning (90-day expiry)\n  trajectories/saver.py    Per-turn JSONL trajectory logging\n\nui/                        Vue 3 + Tailwind web dashboard (19 pages)\ntests/                     105 files, ~3,584 test functions\nconfig.yml                 Default configuration template\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalmingstorm%2Fodin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalmingstorm%2Fodin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalmingstorm%2Fodin/lists"}