Skip to content

DRU-1112 -- Run Chat end to end with Playwright on every pull request - #1173

Open
czpython wants to merge 1 commit into
mainfrom
claude/dru-1112-chat-e2e-lane-7891f3
Open

czpython wants to merge 1 commit into
mainfrom
claude/dru-1112-chat-e2e-lane-7891f3

Conversation

@czpython

Copy link
Copy Markdown
Owner

Chat now runs end to end in a Playwright lane on every pull request. Only the model is fake: a scripted Anthropic API in the Playwright process serves api.anthropic.com with a certificate from a test CA. The box, the secrets proxy, the sandbox image, and the claude CLI are real.

The lane

  • The On Pull Request E2E workflow builds the Druks image from the pull request and installs it with scripts/install.sh on the docker provider.
  • frontend/e2e/install-stack.sh makes the test CA, installs the stack, and builds the sandbox templates. A Compose override points api.anthropic.com at the mock for web and for the secrets proxy.
  • The lane runs on Linux and on macOS with Docker Desktop. The mock listens on every interface, and E2E_MOCK_ADDRESS names the address where a container reaches the host.
  • npm --prefix frontend run test:e2e runs the lane. docs/development.md describes a local run.

The specs

  • Two turns and a reload.
  • A Stop in the middle of a stream.
  • A Druks restart in the middle of a turn.

Each spec checks that the page shows each saved message once and in order, that each reply is what the mock streamed, that the second turn carries the first, and that every model request carries the real token.

Bugs the lane found

  • druks setup refused the [providers.anthropic] table that docs/configuration.md tells an operator to add, so the next install failed. Setup now keeps a [providers] table, like [apps] and [services].
  • The bridge saves the session files as soon as a turn ends, but the claude CLI writes its transcript 60 to 120 ms later. So each saved archive missed the latest turn, and a fast turn failed with "The session files are missing". Chat now runs the CLI with CLAUDE_CODE_EAGER_FLUSH, and the CLI writes the transcript before it reports the result.
  • Only hosted installs ran the drukbox janitor. On the docker provider nothing deleted an expired sandbox, and a template build that a drukbox restart cut off stayed "building" with no end, so each later build waited on it. Every install shape now runs the janitor.

The On Pull Request E2E workflow builds the Druks image from the pull request
and installs it with scripts/install.sh on the docker provider. Only the model
is fake: a scripted Anthropic API in the Playwright process serves
api.anthropic.com with a certificate from a test CA. The box, the secrets
proxy, the sandbox image, and the claude CLI are real.

The lane runs on Linux and on macOS with Docker Desktop. The mock listens on
every interface, and E2E_MOCK_ADDRESS names the address where a container
reaches the host.

Three specs cover two turns and a reload, a Stop in the middle of a stream,
and a Druks restart in the middle of a turn. Each spec checks that the page
shows each saved message once and in order, that each reply is what the mock
streamed, that the second turn carries the first, and that every model
request carries the real token.

The lane found three bugs, and this change fixes them:

- druks setup refused the [providers.anthropic] table that
  docs/configuration.md tells an operator to add, so the next install failed.
  Setup now keeps a [providers] table, like [apps] and [services].
- The bridge saves the session files as soon as a turn ends, but the claude
  CLI writes its transcript 60 to 120 ms later. So each saved archive missed
  the latest turn, and a fast turn failed with "The session files are
  missing". Chat now runs the CLI with CLAUDE_CODE_EAGER_FLUSH, and the CLI
  writes the transcript before it reports the result.
- Only hosted installs ran the drukbox janitor. On the docker provider
  nothing deleted an expired sandbox, and a template build that a drukbox
  restart cut off stayed "building" with no end, so each later build waited
  on it. Every install shape now runs the janitor.
@mintlify

mintlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
druks 🟢 Ready View Preview Nov 10, 2026, 5:40 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

This branch was successfully deployed

1 active deployment
staging - docs — 1f2a026d Deployed Nov 10, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant