Skip to content

feat(coder-labs): add Omnigent multi-agent server module#925

Draft
matifali wants to merge 16 commits into
mainfrom
add-omnigent-module
Draft

feat(coder-labs): add Omnigent multi-agent server module#925
matifali wants to merge 16 commits into
mainfrom
add-omnigent-module

Conversation

@matifali

@matifali matifali commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Adds the Omnigent registry surface:

  • registry/coder-labs/modules/omnigent/ — installs Omnigent, starts the server, registers the workspace host, and exposes the Omnigent Coder app.
  • registry/coder-labs/templates/omnigent-workspace/ — Docker example workspace with Omnigent, Claude Code, Codex, Coder AI Gateway, and a shallow clone of github.com/coder/coder.
  • .icons/omnigent.svg — temporary placeholder icon until the official Omnigent SVG is available.

Changes

  • Install uv from the Omnigent module so fresh Ubuntu images work without pre-baked dependencies.
  • Run omnigent host --server "http://localhost:${port}" in the background so Coder startup reaches ready and the Coder app server has an online host for filesystem calls.
  • Trust the derived Coder app origins through OMNIGENT_WS_ALLOWED_ORIGINS so browser requests through Coder Apps pass Omnigent's CSRF origin checks.
  • Pass OPENAI_CODER_AIGATEWAY_SESSION_TOKEN through OMNIGENT_RUNNER_ENV_PASSTHROUGH when present so host-launched Codex runners can authenticate through Coder AI Gateway.
  • Harden script rendering by base64-encoding allowed origins, quoting server flags with a Bash array, clearing stale generated agent files, preserving existing runner env passthrough values, and using safe generated agent filenames.
  • Wire Claude Code and Codex through Coder AI Gateway; the template uses coder-labs/codex 5.2.1 so Codex writes env_key = "OPENAI_CODER_AIGATEWAY_SESSION_TOKEN".
  • Install shared workspace tool dependencies (curl, jq, tmux, bubblewrap, Node.js 22) before Claude Code, Codex, and Omnigent setup.

Validation

  • GitHub checks pass on 92a428e:
    • Validate README files
    • lint
    • Check for typos and unformatted code
    • Validate Terraform output
  • Local validation in /tmp/registry-pr-925:
    • terraform fmt -check -recursive registry/coder-labs/modules/omnigent registry/coder-labs/templates/omnigent-workspace
    • terraform test in registry/coder-labs/modules/omnigent: 22 passed, 0 failed
    • Rendered install.sh.tftpl and start.sh.tftpl; bash -n passed and shellcheck --severity=warning passed
    • MODULE_CHANGED_FILES='registry/coder-labs/modules/omnigent/main.tf registry/coder-labs/modules/omnigent/scripts/start.sh.tftpl registry/coder-labs/modules/omnigent/scripts/install.sh.tftpl' ./scripts/terraform_validate.sh passed
  • Full E2E in Coder workspace test-omnigent-pr-925-full using temp template version pr-925-runner-token-passthrough (a81a9875-ab14-4ed6-81e3-89e8ed298811):
    • Workspace build fix: update script path #6 succeeded and reached ready
    • GET /health returns { "status": "ok" }
    • GET /v1/hosts shows the workspace host online with Claude, Codex, native Claude, and native Codex configured
    • Host process env includes OMNIGENT_RUNNER_ENV_PASSTHROUGH and OPENAI_CODER_AIGATEWAY_SESSION_TOKEN
    • ~/.codex/config.toml uses env_key = "OPENAI_CODER_AIGATEWAY_SESSION_TOKEN"
    • Fresh Omnigent codex-native-ui session conv_caaaf498b6d74189bb2da43738b9e79b launched a Codex app-server with OPENAI_CODER_AIGATEWAY_SESSION_TOKEN in its env
    • Sending Reply with only: ok completed successfully with assistant output ok and last_task_error = null

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

matifali added 4 commits June 16, 2026 12:48
Blocking fixes:
- Add PATH export at top of start.sh so omnigent is found after install
- Separate server.log from start.log (nohup concurrent write conflict)
- Bump coder provider constraint from >= 2.12 to >= 2.13 (matches coder-utils)
- Base64-encode omnigent version in install.sh (injection hardening)
- Surface upgrade failures as warnings instead of silencing them

New inputs:
- server_config: inline YAML written to module dir and passed as -c
- server_config_path: path to existing config file, mutually exclusive with server_config
- agents: list of {name, content} pre-registered at startup via --agent flags
- pre_install_script / post_install_script: pass-through to coder-utils

New output: server_config_path (effective config path or empty string)

13/13 tests pass.
@matifali matifali marked this pull request as draft June 21, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant