railyard/apps/relay/ui/AGENTS.md
caelum0x e50bce7591 test(relay-ui): skip upstream Autopilot e2e specs, cover the unavailable page
Relay turned Autopilot off (every /autopilot route renders the "not
available" page), so the five upstream specs in e2e_tests/autopilot/ are
skipped explicitly with that reason. New autopilot-unavailable.spec.ts
(runs in the default suite) asserts /autopilot, /autopilot/sessions,
/autopilot/sessions/new and a session URL answer 501 with the unavailable
heading, and that the home sidebar has no Autopilot links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 02:34:08 +03:00

64 lines
2.4 KiB
Markdown

- The UI uses React Router 7, Tailwind, Node, and pnpm.
- UI routes (pages & API) are defined in `./app/routes.ts`.
- Prefer `logger` from `~/utils/logger` over `console.error`, `console.warn`, `console.log`, `console.debug`.
- Prefer using React Router's `useFetcher` over direct calls to `fetch`. [Reference](https://reactrouter.com/api/hooks/useFetcher)
- After modifying UI code, run from the `ui/` directory: `pnpm run format`, `pnpm run lint`, `pnpm run typecheck`. All commands must pass.
## Autopilot Feature (Internal Only)
> **Relay:** Autopilot is turned off in Relay (every `/autopilot` route renders the "not available" page, see `app/routes/autopilot/layout.tsx`). The upstream specs in `e2e_tests/autopilot/` are explicitly skipped; `e2e_tests/autopilot-unavailable.spec.ts` covers the unavailable page. The notes below describe the upstream setup only.
> **Note for external contributors:** The Autopilot feature depends on a closed-source internal API. The tests in `e2e_tests/autopilot/` require access to the private `autopilot` repository and cannot be run by external contributors. These tests are run in CI via repository dispatch from the autopilot repo.
If you're an internal contributor with access to the autopilot repository:
### Setup
Set the `AUTOPILOT_REPO` environment variable to point to your local autopilot checkout:
```bash
export AUTOPILOT_REPO=/path/to/autopilot
```
### Running Autopilot Dependencies
```bash
docker compose --profile e2e up -d
```
Run from the `$AUTOPILOT_REPO` directory, or:
```bash
docker compose -f "$AUTOPILOT_REPO/docker-compose.yml" --profile e2e up -d
```
### Running the UI Dev Server with Autopilot
From the `ui/` directory:
```bash
TENSORZERO_UI_CONFIG_FILE="$AUTOPILOT_REPO/e2e_tests/fixtures/config/tensorzero.toml" \
TENSORZERO_GATEWAY_URL=http://localhost:3040 \
pnpm dev
```
### Running Autopilot E2E Tests
From the `ui/` directory:
```bash
TENSORZERO_UI_CONFIG_FILE="$AUTOPILOT_REPO/e2e_tests/fixtures/config/tensorzero.toml" \
TENSORZERO_GATEWAY_URL=http://localhost:3040 \
TENSORZERO_PLAYWRIGHT_INCLUDE_AUTOPILOT=1 \
pnpm exec playwright test e2e_tests/autopilot/
```
To run a specific test file:
```bash
TENSORZERO_UI_CONFIG_FILE="$AUTOPILOT_REPO/e2e_tests/fixtures/config/tensorzero.toml" \
TENSORZERO_GATEWAY_URL=http://localhost:3040 \
TENSORZERO_PLAYWRIGHT_INCLUDE_AUTOPILOT=1 \
pnpm exec playwright test e2e_tests/autopilot/autopilot.spec.ts
```