-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Bug
Dispatcher.reset() clears the handler map but doesn't clear _ensureRegistered (the lazy registration hook). When dbt-first-execution.test.ts runs before dispatcher.test.ts, the import side-effects call setRegistrationHook(). Then reset() clears handlers but leaves the hook alive. On the next call(), the hook fires, re-registers all handlers, and the "no handler" test passes unexpectedly.
Failing tests (flaky on main)
Dispatcher > call — no handler > throws when no native handler registereddbt Profiles Auto-Discovery > dbt.profiles dispatcher method returns connectionsdbt Profiles Auto-Discovery > warehouse.discover includes dbt profilesdbt Fallback Behavior > when dbt not configured, falls back to native driver silentlydbt Fallback Behavior > explicit warehouse param bypasses dbt entirelybuildTraceFile — status transitions > status progression
Fix
One-line change in packages/opencode/src/altimate/native/dispatcher.ts:
export function reset(): void {
nativeHandlers.clear()
_ensureRegistered = null // ← add this
}Verified locally: all 13 tests pass, 0 fail.
Context
Found during PR #467 CI investigation. These failures are pre-existing on main and surface non-deterministically based on Bun's test file ordering.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels