Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 522185f

Browse files
authored
test(e2e): route agent e2e through the ci gateway product (#3206)
1 parent df9a4cc commit 522185f

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎packages/agent/e2e/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ arm self-skips if it is missing).
9191

9292
| Var | Default | Notes |
9393
| --- | --- | --- |
94-
| `POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY` | — | Required. A token the gateway accepts — the `llm_gateway` product takes a personal API key (no OAuth). Without it every arm skips. `run-e2e.sh` reads the local dev key. |
95-
| `POSTHOG_CODE_E2E_GATEWAY_URL` | `http://localhost:3308/llm_gateway` | Gateway base (codex appends `/v1`). `llm_gateway` accepts a personal API key; `posthog_code` is OAuth-only. |
94+
| `POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY` | — | Required. A token the gateway accepts — the `ci` product takes a personal API key (no OAuth). Without it every arm skips. `run-e2e.sh` reads the local dev key. |
95+
| `POSTHOG_CODE_E2E_GATEWAY_URL` | `http://localhost:3308/ci` | Gateway base (codex appends `/v1`). `ci` accepts a personal API key; `posthog_code` is OAuth-only. |
9696
| `POSTHOG_CODE_E2E_CLAUDE_MODEL` | `claude-haiku-4-5` | Override if the gateway serves a different cheap Claude id. |
9797
| `POSTHOG_CODE_E2E_CODEX_MODEL` | `gpt-5-mini` | Cheapest codex id the local gateway serves; override if needed. |
9898
| `POSTHOG_CODE_E2E_CLAUDE_STRONG_MODEL` | `claude-sonnet-4-5` | Stronger Claude id for tests the cheap model can't handle (structured output). |

‎packages/agent/e2e/config.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ export type Adapter = "claude" | "codex";
66
/**
77
* Live e2e configuration, resolved entirely from the environment so no secret is
88
* committed. Needs a local llm-gateway and a token in `POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY`; targets
9-
* the `llm_gateway` product, which accepts a personal API key (no OAuth mint,
10-
* unlike prod's `posthog_code`). Without the token every arm self-skips.
9+
* the `ci` product, which accepts a personal API key (no OAuth mint,
10+
* unlike prod's `posthog_code`) and keeps e2e traffic attributed to its own
11+
* `ai_product` rather than the catch-all `llm_gateway` bucket. Without the token
12+
* every arm self-skips.
1113
*/
1214
// `||` not `??`: CI sets unset vars to "" which should fall back to the default.
1315
const GATEWAY_URL =
14-
process.env.POSTHOG_CODE_E2E_GATEWAY_URL ||
15-
"http://localhost:3308/llm_gateway";
16+
process.env.POSTHOG_CODE_E2E_GATEWAY_URL || "http://localhost:3308/ci";
1617
const TOKEN = process.env.POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY ?? "";
1718

1819
// This checkout's bundled codex binaries, relative to packages/agent/e2e.

‎packages/agent/e2e/run-e2e.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Run the live golden-path e2e for both adapters (claude + codex).
33
#
44
# Needs a local llm-gateway (run `./bin/start` in the posthog repo) and a token.
5-
# The suite targets the gateway's `llm_gateway` product, which accepts a personal
5+
# The suite targets the gateway's `ci` product, which accepts a personal
66
# API key (no OAuth), so if POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY is unset this reads the repo's
77
# hardcoded local dev key from ee/settings.py (override the repo with POSTHOG_REPO).
88
# That key must be registered in the local DB — run `python manage.py
@@ -25,7 +25,7 @@ if [[ -z "${POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY:-}" ]]; then
2525
echo "Set POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY, or POSTHOG_REPO to the posthog checkout." >&2
2626
exit 1
2727
fi
28-
# The `llm_gateway` product accepts personal API keys, so no OAuth mint needed.
28+
# The `ci` product accepts personal API keys, so no OAuth mint needed.
2929
POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY="$(grep -E '^DEV_API_KEY[[:space:]]*=' "$SETTINGS" | head -1 | sed -E 's/^DEV_API_KEY[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/')"
3030
fi
3131

@@ -36,6 +36,6 @@ if [[ -z "${POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY:-}" ]]; then
3636
fi
3737

3838
export POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY
39-
echo "token: ${POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY:0:8}… gateway: ${POSTHOG_CODE_E2E_GATEWAY_URL:-http://localhost:3308/llm_gateway}"
39+
echo "token: ${POSTHOG_CODE_E2E_GATEWAY_PERSONAL_API_KEY:0:8}… gateway: ${POSTHOG_CODE_E2E_GATEWAY_URL:-http://localhost:3308/ci}"
4040
cd "$AGENT_DIR"
4141
pnpm test:e2e "$@"

0 commit comments

Comments
 (0)