0ef5fcb1c5
Security / Dependency audit (pip-audit) (push) Has been cancelled
Security / CodeQL (javascript-typescript) (push) Has been cancelled
Security / CodeQL (python) (push) Has been cancelled
Security / Secret scan (gitleaks) (push) Has been cancelled
rust / test (ubuntu) (push) Has been cancelled
rust / simulator e2e (macos-latest) (push) Has been cancelled
rust / simulator e2e (ubuntu-latest) (push) Has been cancelled
rust / simulator e2e (windows-latest) (push) Has been cancelled
rust / wheels (aarch64-apple-darwin) (push) Has been cancelled
rust / wheels (x86_64-unknown-linux-gnu) (push) Has been cancelled
rust / wheels (x86_64-apple-darwin) (push) Has been cancelled
rust / audit (push) Has been cancelled
rust / parity (nightly, allowed to fail during Phase 0) (push) Has been cancelled
CI / commitlint (push) Has been skipped
Dev Containers / validate (.devcontainer/devcontainer.json, default) (push) Failing after 0s
Dev Containers / validate (.devcontainer/memory-stack/devcontainer.json, memory-stack) (push) Failing after 0s
Dev Containers / validate-worktree (push) Failing after 0s
CI / changes (push) Failing after 4s
Deploy Documentation / validate (push) Has been skipped
Deploy Documentation / deploy (push) Failing after 1s
Init Native E2E / init-native (ubuntu-latest, claude) (push) Failing after 1s
Init Native E2E / init-native (ubuntu-latest, codex) (push) Failing after 1s
Install Native E2E / install-native (ubuntu-latest) (push) Failing after 1s
OpenCode Plugin / typecheck + build + test (push) Failing after 1s
Init Native E2E / init-native (ubuntu-latest, copilot) (push) Failing after 1s
Release Please / release-please (push) Failing after 1s
Wrap E2E / docker-wrap-e2e (push) Failing after 1s
Wrap Native E2E / wrap-native (ubuntu-latest) (push) Failing after 1s
Init E2E / docker-init-e2e (push) Failing after 4s
Merge Conflicts / merge-conflicts (push) Failing after 4s
CI / lint (push) Has been cancelled
CI / build-wheel (push) Has been cancelled
CI / build-wheel-windows (push) Has been cancelled
CI / prefetch-model (push) Has been cancelled
CI / test-dashboard-ui (push) Has been cancelled
CI / test (1) (push) Has been cancelled
CI / test (2) (push) Has been cancelled
CI / test (3) (push) Has been cancelled
CI / test (4) (push) Has been cancelled
CI / test-extras (push) Has been cancelled
CI / test-agno (push) Has been cancelled
CI / build (push) Has been cancelled
CI / workflow-validation (push) Has been cancelled
CI / docker-native-e2e (push) Has been cancelled
CI / windows-native-wrapper (push) Has been cancelled
CI / macos-native-wrapper (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-code-nonroot name:code-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-code-slim name:code-slim]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-code-slim-nonroot name:code-slim-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-nonroot name:nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-slim name:slim]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-slim-nonroot name:slim-nonroot]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime name:]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-code name:code]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-code-nonroot name:code-nonroot]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-code-slim name:code-slim]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-code-slim-nonroot name:code-slim-nonroot]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-nonroot name:nonroot]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-slim name:slim]) (push) Has been cancelled
Docker / docker-manifest (map[bake_target:runtime-slim-nonroot name:slim-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime name:]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-code name:code]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-code-nonroot name:code-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-code-slim name:code-slim]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-code-slim-nonroot name:code-slim-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-nonroot name:nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-slim name:slim]) (push) Has been cancelled
Docker / docker-build (map[name:amd64 platform:linux/amd64 runs_on:ubuntu-24.04], map[bake_target:runtime-slim-nonroot name:slim-nonroot]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime name:]) (push) Has been cancelled
Docker / docker-build (map[name:arm64 platform:linux/arm64 runs_on:ubuntu-24.04-arm], map[bake_target:runtime-code name:code]) (push) Has been cancelled
Docker / promote-latest (push) Has been cancelled
Init Native E2E / init-native (macos-latest, claude) (push) Has been cancelled
Init Native E2E / init-native (macos-latest, codex) (push) Has been cancelled
Init Native E2E / init-native (macos-latest, copilot) (push) Has been cancelled
Install Native E2E / install-native (macos-latest) (push) Has been cancelled
Wrap Native E2E / wrap-native (macos-latest) (push) Has been cancelled
76 lines
2.8 KiB
Markdown
76 lines
2.8 KiB
Markdown
# scripts/
|
|
|
|
Utility scripts bundled with the Headroom repo. Most are one-off operator
|
|
tools; a few are runnable as part of development workflows.
|
|
|
|
## Reproducing the reconnect storm
|
|
|
|
`repro_codex_replay.py` reproduces the multi-agent Codex reconnect/retry storm
|
|
against a local Headroom proxy (default `http://127.0.0.1:8787`). Use it to:
|
|
|
|
- Regression-check that `/livez` stays responsive under a cold-start storm.
|
|
- Empirically tune the Unit 4 pre-upstream semaphore default
|
|
(`HEADROOM_ANTHROPIC_PRE_UPSTREAM_CONCURRENCY`).
|
|
- Exercise the Codex WS lifecycle + Anthropic HTTP path simultaneously
|
|
without needing to replay captured production traffic.
|
|
|
|
### Run
|
|
|
|
```bash
|
|
# Default: 8 WS + 4 HTTP clients, 30s storm, p99 /livez must stay <= 500ms.
|
|
python scripts/repro_codex_replay.py
|
|
|
|
# Tighter budget, shorter run:
|
|
python scripts/repro_codex_replay.py \
|
|
--url http://127.0.0.1:8787 \
|
|
--ws-clients 16 \
|
|
--anthropic-clients 8 \
|
|
--duration 60 \
|
|
--livez-threshold-ms 100
|
|
|
|
# Dump the full summary as JSON for downstream tooling:
|
|
python scripts/repro_codex_replay.py --json
|
|
```
|
|
|
|
Exit code:
|
|
|
|
- `0` — warmup succeeded (or was skipped), storm ran for the requested
|
|
duration, and `/livez` p99 stayed under `--livez-threshold-ms`.
|
|
- `1` — soft assertion failed, proxy unreachable, or unhandled exception.
|
|
Proxy-unreachable is detected and reported within ~5 seconds.
|
|
|
|
### Fixtures
|
|
|
|
The script loads two hand-crafted, fully synthetic JSON fixtures:
|
|
|
|
- `scripts/fixtures/anthropic_replay_body.json` — shape of a large agent
|
|
reconnect replay `/v1/messages?beta=true` POST body.
|
|
- `scripts/fixtures/codex_response_create_frame.json` — first Codex WS frame
|
|
with the `{"type": "response.create", "response": {...}}` envelope.
|
|
|
|
Override via `--ws-frame-fixture` / `--anthropic-body-fixture` if you have
|
|
captured traffic to replay instead.
|
|
|
|
### Interpretation
|
|
|
|
- `/livez p99` under threshold means the event loop is not starved during the
|
|
storm. If it rises with the semaphore unbounded
|
|
(`HEADROOM_ANTHROPIC_PRE_UPSTREAM_CONCURRENCY=10000`) and drops back under
|
|
the default, Unit 4's backpressure is working.
|
|
- `Codex WS: opened` should equal `--ws-clients`. `response.completed`
|
|
typically stays low when upstream auth isn't configured locally — the goal
|
|
is handshake + relay wiring, not real upstream traffic.
|
|
- `Anthropic HTTP: ok_2xx + non_2xx + timed_out + errors` should roughly equal
|
|
`attempted`. Sustained non-zero `timed_out` during the storm is the failure
|
|
signal the plan targets.
|
|
|
|
A smoke test at `tests/test_scripts/test_repro_codex_replay_smoke.py`
|
|
exercises the script against a mock FastAPI server on every PR.
|
|
|
|
## Install scripts
|
|
|
|
- `install.sh` — POSIX installer.
|
|
- `install.ps1` — Windows PowerShell installer.
|
|
|
|
These are generated by the release pipeline; edit with care.
|