Problem
_dispatchMatchedRoute() now receives synchronous responses from fully synchronous middleware chains, but it still sends every middleware-bearing route through finishAsyncMatchedResponse(). The finalizer is declared async, so a synchronous middleware response regains a Promise boundary after the chain compiler removed the inner ones.
Proposed change
Finalize a synchronous middleware response directly. Keep promised responses on finishAsyncMatchedResponse(), preserve null-to-500 behavior, cookie application, synchronous and asynchronous custom error handling, middleware short circuits, and public builder overrides.
Acceptance criteria
- Keep cached route dispatch synchronous when the handler and every middleware layer finish synchronously.
- Preserve promised middleware, rejection, custom error, cookie, and empty-response behavior.
- Add deterministic regression coverage for synchronous and asynchronous middleware dispatch.
- Improve representative cached route and downstream Stacks request benchmarks on exact Bun 1.4.2.
- Pass the complete suite, typechecks, lint, and package build.
- Keep stable package publication pending explicit release approval.