Skip to content

Shared Executor

All 54 active agents run through ge-executor (2 replicas, HPA 2-5). No individual agent pods.

Source of truth: k8s/base/agents/executor.yaml

Image & Build

  • Image: docker.io/library/ge-bootstrap-agent-executor:latest
  • Build script: ge-ops/infrastructure/local/k3s/executor/build-executor.sh
  • Base: Python 3.12-slim + Node.js 20
  • CLIs baked in: @anthropic-ai/claude-code, @openai/codex, @google/gemini-cli
  • Python packages baked in: ge_agent/, ge_engine/, ge_common/, ge_comm/, ge_orchestrator/

Deploy code changes: always rebuild the image. Never kubectl cp. See Rebuild Executor.

Execution Flow

TaskService → Redis XADD to triggers.{agent}
→ executor consumer group picks up (group: executor-group, consumer: $POD_NAME)
→ fetches agent config from admin-ui API → loads identity (complexity-based tiers)
→ builds prompt (constitution + identity + task + JIT learnings)
→ provider adapter builds CLI command → PTY captures output
→ completion file written to ge-ops/system/completions/
→ host cron syncs COMP files to DB (XADD to ge:work:completed is PLANNED, not yet implemented)

Consumer Groups

  • Group: executor-group (shared across all pods)
  • Consumer: $POD_NAME (unique per pod, from k8s downward API)
  • Delivery: each trigger delivered to exactly one pod
  • Orphan recovery: on startup, claims/ACKs messages from dead consumers idle > 60s
  • Dedup: exec_dedup:{work_item_id} with 5-min TTL

Probe Configuration (fixed 2026-02-15)

  • Startup: HTTP /health, 12x10s = 120s max boot time
  • Liveness: exec kill -0 1 (process check, not HTTP — event loop blocks during PTY sessions), period=30s, failureThreshold=6 (180s tolerance)
  • Readiness: HTTP /ready, period=10s, failureThreshold=3

The health server shares the asyncio event loop with agent execution. HTTP probes timeout during PTY sessions. The exec liveness probe checks PID 1 instead.

Key Entry Points

File Purpose
ge_agent/runner.py Main entry (python -m ge_agent.runner listen)
ge_agent/listener.py Redis consumer loop, trigger handling
ge_agent/execution/pty_executor.py PTY execution engine
ge_agent/execution/provider_config.py Provider profile loading
ge_agent/identity/prompts.py Prompt builder
ge_agent/execution/cost_gate.py Cost enforcement