Skip to content

chore(e2e): tag suite traffic with x-client-type: test - #283

Merged
vreshch merged 1 commit into
masterfrom
chore/e2e-client-type-header
Aug 14, 2026
Merged

chore(e2e): tag suite traffic with x-client-type: test#283
vreshch merged 1 commit into
masterfrom
chore/e2e-client-type-header

Conversation

@vreshch

@vreshch vreshch commented Aug 14, 2026

Copy link
Copy Markdown
Member

Why

Estate test-traffic contract: every e2e/synthetic request must carry x-client-type: test. The edge classifier (Traefik -> Vector) and @agentage/observability span stamping key on exactly this header; UA sniffing is only a fallback. This suite signs up throwaway accounts against a live Better Auth AS (auth.<AGENTAGE_SITE_FQDN>), all of it untagged today.

What

  • New e2e/client-type.ts - single source for the header (local const; no shared package here).
  • playwright.config.ts gains a use.extraHTTPHeaders default (the config had no use block at all).
  • e2e/helpers.ts newBrowserContext(): apiRequest.newContext passes its own extraHTTPHeaders (Origin), which REPLACES the config default per key - so it spreads the tag explicitly.
  • The daemon MCP RPC helpers in mcp-contract.test.ts / mcp-daemon.test.ts tag their fetch too (loopback today, but keeps the contract uniform).

Known gap

Requests the CLI subprocess makes to the live stack (OAuth, sync over git smart-HTTP) still go out untagged - the test harness cannot inject a header into the built binary. Closing that needs a client-side hook in the CLI itself (e.g. honoring an AGENTAGE_CLIENT_TYPE env var); flagged, not fixed here.

Verified

prettier --check clean; playwright test --list loads the config (44 tests in 11 files). No suite run against a deployed stack.

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: ea43502a1080b06b5e8043825b4c1bcb4e2ed902
Branch: chore/e2e-client-type-header

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-08-14T16:54:30.665Z

@vreshch
vreshch marked this pull request as ready for review August 14, 2026 16:56
@vreshch
vreshch merged commit 34f3a20 into master Aug 14, 2026
3 checks passed
@vreshch
vreshch deleted the chore/e2e-client-type-header branch August 14, 2026 17:05
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