Skip to content

Add recovery-only drain for gateway demo cutover - #86

Closed
randomblocker wants to merge 5 commits into
mainfrom
agent/gateway-demo-recovery-drain
Closed

randomblocker wants to merge 5 commits into
mainfrom
agent/gateway-demo-recovery-drain

Conversation

@randomblocker

@randomblocker randomblocker commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Add recovery-only drain for gateway demo cutover

Summary

  • adds an exact build-time recovery-only mode (NEXT_PUBLIC_GATEWAY_DEMO_RECOVERY_ONLY=1) for the retiring Community-hosted buyer demo
  • blocks fresh runs in newly loaded recovery-only pages at both the UI and client dispatch boundary; the rollout requires gateway enforcement for already-open tabs
  • preserves origin-scoped, read-only Check & resume for records with a gateway job id, including one another tab learned; records without a job id are never re-POSTed, stay stored, and show their run id and a reconciliation request link
  • adds a separate recovery-only Playwright pass with four cases, including direct dispatch-handler invocation; the default config excludes that spec

Why

Browser recovery state cannot move between origins. The old Community page needs a bounded drain phase that preserves read-only recovery for known job ids and provides an operator handoff for other records while the buyer demo moves to its gateway-owned UI.

Rollout

Follow the cutover procedure:

  1. Keep this PR draft until the gateway-owned UI is deployed and smoke-tested, and an operator can look up jobs by Idempotency-Key (the browser's run id).
  2. Before or atomically with the Community drain deployment, enable gateway enforcement that prevents the retiring Community origin from creating Butler/procurement work while preserving read-only lookup by known job id. Verify fresh starts and unknown-key replays create no jobs, retain browser recovery records, and remain blocked with cached preflights. Community's mocked tests do not verify this external gate.
  3. Build and deploy Community with NEXT_PUBLIC_GATEWAY_DEMO_RECOVERY_ONLY=1. next build inlines the flag, so changes require a rebuild. Tabs loaded before deployment keep their previous JavaScript until reloaded; the gateway gate must cover them.
  4. Wait at least 12 minutes, reconcile gateway jobs and reported no-job-id run ids, and check again for Community-origin jobs immediately before removing the old pages.
  5. Only then merge/deploy Community PR Separate the gateway demo from the Community Directory #84. Keep the gateway gate active after page removal.

Validation

Head fad9954, based on 6c530ac, with main d1de29d already merged:

  • git diff --check: clean
  • focused unit checks: 16/16 pass; corresponding base tests on d1de29d: 13/13 pass
  • Playwright discovery: default config lists 21 tests without the recovery spec; recovery config lists exactly four cases
  • recovery browser pass attempted with one worker: Next stops before assertions because the offline sandbox denies os.networkInterfaces() (uv_interface_addresses); the corresponding base browser pass fails at the same startup step
  • typecheck: 96 identical diagnostics on head and base, with the private SDK unavailable; none in the changed files
  • successful build, provisioned typecheck, and browser assertions need CI on this head before merge; gateway enforcement and operator lookup need separate deployment verification

The author reported 202 passing unit/integration tests, passing typecheck/build, and the original single Chromium recovery case at 803bffb. Those historical results do not validate the current four browser cases.

random block and others added 3 commits August 18, 2026 15:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In recovery-only mode, Check & resume on a stored record with no jobId
re-POSTed /demo/procurement under the stored key. If the original POST
never reached the gateway, that created and paid for a new job after the
drain had paused new purchases (review round 1, P1/P2).

resumeDispatchDecision now takes { recoveryOnly } and returns
manual-reconcile instead of post for such a record. A job id learned by
another tab is still read. TryDacs keeps the record and shows its run id
for the operator.

Also from review: the default Playwright config ignores the recovery
spec, the recovery spec checks every fresh-start button plus the no-jobId
and raced-jobId cases, and the README and e2e/README note that the flag
is build-time and describe the second e2e pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
randomblocker and others added 2 commits October 13, 2026 19:32
Add the gateway cutover procedure, accurate bundle and validation guidance, and a reconciliation request link. Exercise runAgent directly despite disabled controls in the recovery browser pass.

Co-Authored-By: Codex <noreply@openai.com>
@randomblocker

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #84, which removes the gateway demo from the Community Directory entirely. The Butler-based demo is no longer used, so a drain phase before cutover isn't needed.

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