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
46 changes: 46 additions & 0 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,78 @@ on:
description: "run forge phase (needs BILI_CODEX_COMPACT support in master)"
type: boolean
default: false
# #1296 note ④ hardening: routing/pipeline changes (#1284/#1290 class) got
# real-client coverage only when someone remembered to dispatch manually.
# Auto-run on request-pipeline hot files (AGENTS.md §E2E: server.ts,
# src/loop/, adapters, preflight/compact) instead. Everything else stays
# covered by the regular test/build workflows.
pull_request:
branches: [master]
paths:
- "src/server.ts"
- "src/server/**"
- "src/loop/**"
- "src/compress-loop*.ts"
- "src/stream*.ts"
- "src/persist.ts"
- "src/agent/**"
- "tests/e2e/**"
# acp-kernel is pinned exactly and bundled INLINE into the pipeline —
# a pin bump IS a pipeline change (#1289-class guard).
- "package-lock.json"
- ".github/workflows/ci-e2e.yml"

# One run per ref: a fresh push cancels the superseded in-flight run — the
# suite spends real upstream tokens, never run it twice in parallel.
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
# Secrets are only injected for same-repo PRs and manual dispatch
# (fork PRs see none). Skip gracefully instead of failing red —
# the maintainer dispatches manually for fork contributions.
- name: Gate on E2E upstream secrets
env:
E2E_UPSTREAM_URL: ${{ secrets.E2E_UPSTREAM_URL }}
E2E_UPSTREAM_KEY: ${{ secrets.E2E_UPSTREAM_KEY }}
run: |
if [ -z "$E2E_UPSTREAM_URL" ] || [ -z "$E2E_UPSTREAM_KEY" ]; then
echo "::notice::E2E_UPSTREAM_URL / E2E_UPSTREAM_KEY unavailable for this event — skipping the real-client e2e run."
echo "E2E_SKIP=1" >> "$GITHUB_ENV"
fi
- uses: actions/checkout@v4
if: env.E2E_SKIP != '1'
- uses: actions/setup-node@v4
if: env.E2E_SKIP != '1'
with:
node-version: 22
# Pinned (#815): an unpinned @latest let a codex release change the
# baseline system-prompt size and break the deterministic overflow phase.
# Bump deliberately after re-running this suite locally on the new version.
- name: Install codex CLI
if: env.E2E_SKIP != '1'
run: npm install -g @openai/codex@0.147.0

- name: Print codex version
if: env.E2E_SKIP != '1'
run: codex --version
- run: npm ci
if: env.E2E_SKIP != '1'
- run: npm run build
if: env.E2E_SKIP != '1'
- name: Preflight
if: env.E2E_SKIP != '1'
run: E2E_CHECK=1 node --import tsx --test tests/e2e/e2e-codex.test.ts
env:
E2E_UPSTREAM_URL: ${{ secrets.E2E_UPSTREAM_URL }}
E2E_UPSTREAM_KEY: ${{ secrets.E2E_UPSTREAM_KEY }}
- name: E2E suite
if: env.E2E_SKIP != '1'
run: ACP_TEST_E2E=1 node --import tsx --test tests/e2e/e2e-codex.test.ts
env:
E2E_UPSTREAM_URL: ${{ secrets.E2E_UPSTREAM_URL }}
Expand Down
10 changes: 7 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,13 @@ Rules:
- Any Responses-compatible upstream works via `E2E_UPSTREAM_URL` /
`E2E_UPSTREAM_KEY`; the provider is configured as `name = "OpenAI"` so codex
stays on the remote compaction (V2) path — do not "fix" this.
- CI (`.github/workflows/ci-e2e.yml`) is manual-dispatch only and needs repo
secrets `E2E_UPSTREAM_URL` / `E2E_UPSTREAM_KEY`; a hosted runner cannot
reach `127.0.0.1` upstreams.
- CI (`.github/workflows/ci-e2e.yml`) auto-runs on PRs whose diff touches the
request-pipeline hot files (`src/server.ts`, `src/server/**`, `src/loop/**`,
`src/agent/**`, adapters/stream/persist, `tests/e2e/**`, `package-lock.json`
— an acp-kernel pin bump IS a pipeline change) plus manual dispatch for
anything else. It needs repo secrets `E2E_UPSTREAM_URL` / `E2E_UPSTREAM_KEY`;
a hosted runner cannot reach `127.0.0.1` upstreams, and events without
secret access (fork PRs) skip the run gracefully instead of failing.

### Code Quality

Expand Down
10 changes: 7 additions & 3 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ prints codex version, dist path, and an upstream `/models` probe.

`.github/workflows/ci-e2e.yml` runs the suite on `workflow_dispatch` with
`E2E_UPSTREAM_URL` / `E2E_UPSTREAM_KEY` from repository secrets, against the
repo's own `dist` (i.e. whatever is on master at dispatch time). The forge
phase is enabled via a repository variable `E2E_FORGE` so it can be turned on
once interception ships.
repo's own `dist` (i.e. whatever is on master at dispatch time). It also
auto-runs on PRs whose diff touches the request-pipeline hot files
(`src/server.ts`, `src/server/**`, `src/loop/**`, `src/agent/**`, adapters/
stream/persist, `tests/e2e/**`, `package-lock.json`); events without secret
access (fork PRs) skip the run gracefully with a notice instead of failing.
The forge phase is enabled via the dispatch input `forge` (which sets the
`E2E_FORGE` env var) so it can be turned on once interception ships.

---

Expand Down
Loading