Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/architecture/credential-injection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Credential Injection

The gateway sidecar injects credentials at the proxy layer, ensuring the sandbox container has zero credential access. This covers GitHub (via git wrappers), Anthropic API (via `ANTHROPIC_BASE_URL`), and Atlassian/Jira/Confluence (via the `/api/v1/jira/*` and `/api/v1/confluence/*` REST endpoints) credentials.
The gateway sidecar injects credentials at the proxy layer, ensuring the sandbox container has zero credential access. This covers GitHub (via git wrappers), Anthropic API (via `ANTHROPIC_BASE_URL`), LiteLLM proxy (via `x-api-key` on sessions routed to the `litellm` upstream), and Atlassian/Jira/Confluence (via the `/api/v1/jira/*` and `/api/v1/confluence/*` REST endpoints) credentials.

**Key properties:**
- **Zero credential exposure**: Container never sees API keys, OAuth tokens, or GitHub tokens
Expand Down Expand Up @@ -147,6 +147,7 @@ Gateway enforcement cannot be bypassed because:
|------|--------|-----------------|
| API Key | `ANTHROPIC_API_KEY` in secrets.env | `x-api-key: <key>` |
| OAuth Token | `ANTHROPIC_OAUTH_TOKEN` in secrets.env | `Authorization: Bearer <token>` |
| LiteLLM Master Key | `LITELLM_MASTER_KEY` in secrets.env | `x-api-key: <key>` (LiteLLM upstream only) |
| Atlassian / Jira | `ATLASSIAN_*` (preferred) or `JIRA_*` triple in secrets.env | `Authorization: Basic <base64(username:token)>` |
| Atlassian / Confluence | `ATLASSIAN_*` (preferred) or `CONFLUENCE_*` triple in secrets.env | `Authorization: Basic <base64(username:token)>` |

Expand Down Expand Up @@ -222,7 +223,8 @@ This precedence (ATLASSIAN-wins, CONFLUENCE as back-compat fallback) matches the
| File | Purpose |
|------|---------|
| `gateway/gateway.py` | Anthropic proxy endpoints, `/api/v1/jira/*` and `/api/v1/confluence/*` routes, credential injection, tool filtering, `_reload_all_config()` hot-reload hook |
| `gateway/anthropic_credentials.py` | Anthropic credential loading from secrets.env |
| `gateway/upstream_registry.py` | Per-upstream registry of `(httpx.Client, credential_resolver)` pairs; lazily initialises the Anthropic and LiteLLM clients; validates `upstream` on session-create |
| `gateway/anthropic_credentials.py` | Anthropic credential loading from secrets.env; also provides `LiteLLMCredentialsManager` for the `LITELLM_MASTER_KEY` |
| `gateway/jira_credentials.py` | Atlassian credential loading from secrets.env for Jira (mtime refresh, basic-auth header helper, `ATLASSIAN_*` precedence) |
| `gateway/confluence_credentials.py` | Atlassian credential loading from secrets.env for Confluence (mtime refresh, `ATLASSIAN_*` precedence with `/wiki` derivation) |
| `gateway/jira_client.py` | Jira REST client + `validate_jira_api_path` regex allowlist + 429 retry + 404 envelope |
Expand Down
3 changes: 2 additions & 1 deletion docs/architecture/kubernetes-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Host Machine
k3s Cluster
├── Namespace: egg-system
│ ├── Deployment: orchestrator (+ Service :9849)
│ └── Deployment: gateway (+ Service :9848, :3129, :9851)
│ ├── Deployment: gateway (+ Service :9848, :3129, :9851)
│ └── Deployment: litellm (+ Service :4000) # non-Claude model proxy; no-op until model_list populated (#2769)
│
├── Namespace: egg-agents
│ ├── Job: agent-coder-{pipeline-id}
Expand Down
5 changes: 3 additions & 2 deletions docs/deploy/resource-sizing.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Pod resource sizing

Resource requests and limits for the three pod types in the egg stack, with the observed telemetry they were tuned against. See #1888 / #1895 for the right-sizing initiative.
Resource requests and limits for the four pod types in the egg stack. The `gateway`, `orchestrator`, and `egg-sandbox-*` allocations were tuned against the observed telemetry below; the `litellm` row was sized from `k8s/base/litellm-deployment.yaml` (it postdates the snapshots, so no telemetry exists for it yet). See #1888 / #1895 for the right-sizing initiative.

## Current allocations

| Pod | CPU request | CPU limit | Mem request | Mem limit | QoS |
|---|---|---|---|---|---|
| `gateway` (egg-system) | 200m | 2 | 2Gi | 4Gi | Burstable |
| `orchestrator` (egg-system) | 250m | 1 | 512Mi | 1Gi | Burstable |
| `litellm` (egg-system) | 100m | 1 | 256Mi | 1Gi | Burstable |
| `egg-sandbox-*` (egg-agents, per-agent) | 250m | 2 | 512Mi | 2Gi | Burstable |

Gateway/orchestrator values live in `k8s/base/gateway-deployment.yaml` and `k8s/base/orchestrator-deployment.yaml`. Sandbox defaults are applied programmatically in `orchestrator/kubernetes_client.py` (`create_container`); callers can override via `kwargs["resources"]`.
Expand Down Expand Up @@ -41,7 +42,7 @@ The sandbox tester peaks at 566Mi mem / 189m CPU — well inside the 2Gi / 2-cor

## QoS rationale

All three pod types are **Burstable** (`request < limit`). On a single-node k3s cluster, the ratio of idle:spike is wide enough that Guaranteed QoS (`request == limit`) would force large reservations that sit idle most of the time. Burstable lets the scheduler pack more pods per node while still giving each a guaranteed floor.
All four pod types are **Burstable** (`request < limit`). On a single-node k3s cluster, the ratio of idle:spike is wide enough that Guaranteed QoS (`request == limit`) would force large reservations that sit idle most of the time. Burstable lets the scheduler pack more pods per node while still giving each a guaranteed floor.

## Changes in this round

Expand Down
1 change: 1 addition & 0 deletions docs/guides/sdlc-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,7 @@ per-phase overrides unless that uniform behaviour is intended.
| `spawn_retry_initial_backoff_seconds` | float | `2.0` | Initial backoff between spawn retries. Subsequent attempts scale by 2.5× (e.g. 2 s, 5 s, 12.5 s). |
| `phase_spawn_max_retries` | int | `2` | Max phase-level retry attempts when one or more roles fail with a transient spawn error (e.g. gateway cold start). Total phase-level attempts = `phase_spawn_max_retries + 1`. Only failed roles are respawned; survivors continue running. Per-role retries (`spawn_max_retries`) run first; this outer budget covers longer outages (~30 s+). Set to `0` to disable. |
| `phase_spawn_retry_initial_backoff_seconds` | float | `30.0` | Initial backoff before the first phase-level spawn retry. Subsequent attempts scale by 3× (e.g. 30 s, 90 s). |
| `agent_models` | dict[str, str] | `{}` | Per-role model overrides keyed by AgentRole value (e.g. `{"refiner": "qwen3-coder-30b"}`). A Claude alias (`opus`, `opus[1m]`, `sonnet`, `sonnet[1m]`, `haiku`, `claude-*`) routes through the Anthropic upstream; any other string routes through the in-cluster LiteLLM proxy. Keys must be SDLC phase producer/reviewer roles — utility roles (overseer, autofixer) are rejected at construction time. See [Per-Agent Models](per-agent-models.md) and [#2769](https://github.com/jwbron/egg/issues/2769). |

All phases use concurrent BRC execution by default.

Expand Down
Loading