Skip to content

refactor(browser): use Express 5 async routes - #106964

Merged
steipete merged 1 commit into
mainfrom
codex/express-5-native-async-routes
Jul 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/express-5-native-async-routes

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Browser routes carried a no-op async-handler wrapper that added nesting across every endpoint even though the supported Express runtime already handles rejected promises natively.

Why This Change Was Made

Register all 47 async Browser handlers directly, delete the redundant wrapper, and disable the lint rule whose own contract targets Express versions before v5. The Express pin remains exact at 5.2.1, and the in-process dispatcher continues to await the same returned promises.

User Impact

No user-visible behavior change. Browser route behavior, error propagation, methods, paths, and response bodies stay the same while 175 lines of adapter boilerplate disappear.

Evidence

  • Exact installed contract inspected: Express 5.2.1, router 2.2.0 promise rejection forwarding, Express request-handler types, Browser registrar, and in-process dispatcher.
  • AST equivalence probe: all 47 wrapper calls transformed; all 10 TypeScript files structurally identical after accounting for wrapper, import, and helper deletion.
  • Blacksmith Testbox tbx_01kxf29krg5r5qjza3rgexz4w8: 188 Browser route/server tests passed; exact-file check:changed passed formatting, extension/test type lanes, extension/script lint, boundary guards, and import-cycle checks; full pnpm build passed.
  • Rebased exact-head Blacksmith Testbox tbx_01kxf32ytqte6nnjyxs0h495qf: 188/188 focused tests passed again.
  • Stable patch-id preserved across the final clean rebase over unrelated main changes.
  • git diff --check passed. Two fresh autoreview runs reported no accepted/actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added size: XL maintainer Maintainer-authored PR labels Jul 14, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready at 9eff385529d2511ed630f16be70f25dc8935d51d.

Work completed:

  • Removed the no-op asyncBrowserRoute layer from all 47 Browser route registrations.
  • Deleted the helper/imports and disabled the pre-v5 Express lint rule.
  • Verified the transformed TypeScript ASTs differ only by those removals; net change is 175 fewer lines.

Proof:

  • Testbox tbx_01kxf29krg5r5qjza3rgexz4w8: corepack pnpm test extensions/browser/src/browser/routes extensions/browser/src/browser/server-middleware.test.ts extensions/browser/src/browser/server.agent-contract-core.test.ts extensions/browser/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts — 188 tests passed.
  • Same Testbox: exact-file check:changed — formatting, extension/test type lanes, extension/script lint, guards, and import-cycle check passed.
  • Same Testbox: corepack pnpm build passed.
  • Rebased Testbox tbx_01kxf32ytqte6nnjyxs0h495qf: the same focused command passed 188/188 again.
  • git diff --check passed.
  • Fresh local and branch autoreview runs: no accepted/actionable findings.

Known gap: hosted CI was not awaited per maintainer instruction. Main advanced only in unrelated wizard, agent, and UI files; the final rebase preserved the stable patch-id byte-for-byte.

@steipete
steipete merged commit 3442825 into main Jul 14, 2026
106 of 111 checks passed
@steipete
steipete deleted the codex/express-5-native-async-routes branch July 14, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant