Skip to content

fix(dbt-tools): Fusion advice and Fusion fallbacks in Fusion mode, and the rest of the #1757 review - #1825

Draft
ralphstodomingo wants to merge 7 commits into
mainfrom
fix/1756-dbt-tools-fusion-followups
Draft

ralphstodomingo wants to merge 7 commits into
mainfrom
fix/1756-dbt-tools-fusion-followups

Conversation

@ralphstodomingo

@ralphstodomingo ralphstodomingo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #1756

Follow-up to #1757: the review items it left open, plus the next dbt-integration release.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

From the #1757 review:

  1. In Fusion mode, an adapter that doesn't start or load now gets Fusion advice (the 2.x binary and where it was looked for, altimate-dbt doctor, or switching to core), not virtualenv advice. Other modes are unchanged.
  2. In Fusion mode the dbt-cli fallbacks run the Fusion binary the check and the adapter pick, not the first dbt found (possibly dbt Core). With no Fusion they fail and start nothing.
  3. Doctor's usage says what it checks per mode; the not-found message names the interpreter's folder only when it was searched.
  4. Schema-verify's stale-manifest note now leads the reason line.
  5. Tests: Fusion's empty Python path, parents on a stale manifest, and a doctor test that reports a crashed run.

dbt-integration 0.3.20 → 0.3.21. dbt-tools uses none of what changed; a fresh checkout installs with a frozen lockfile.

Separate flake fix (own commit): the adapter-access timer-cleanup test counted a timer from a fiber an earlier file left running, which failed main twice. It now counts only the adapter's own timers, and still fails if one leaks.

How did you verify your code works?

  • Each new test fails on the old code.
  • dbt-tools 132 pass; its e2e on dbt 1.10.23 15 pass. opencode adapter-access 49 and validators 817 pass; typecheck 13/13.
  • The flake reproduced with the files CI shard 1 runs before it in one process (1 fail), 0 after.
  • Fusion 2.0.0-preview.175 accepts the fallbacks' flags and they answer correctly on a fixture project.

Claims, residuals and Codex review log: #1825 (comment).

Cost side effects

None.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi


Summary by cubic

Fixes Fusion-mode handling in dbt-tools and opencode: when Fusion fails, users now get advice about the Fusion binary instead of Python, and the CLI fallbacks run the Fusion binary rather than a possibly Core/Cloud dbt. Also closes the rest of the #1757 review items.

  • In Fusion mode, adapter failure refusals now advise running altimate-dbt doctor, installing dbt Fusion, or switching to core, and only name the interpreter's folder when it was searched.
  • dbt-cli fallbacks and the prerequisite check now use the same Fusion binary lookup as the adapter; without a Fusion binary they fail instead of running another dbt.
  • Doctor's usage text and not-found message now match each mode.
  • Schema-verify's stale-manifest note now leads the reason field, since the session prints reason before fix hint.
  • Bump @altimateai/dbt-integration to 0.3.21 (no functional changes used).
  • Fixed a flaky timer-cleanup test to count only the adapter's own timers.

Written for commit 0dcad86. Summary will update on new commits.

View guided diff Turn on auto-fix

ralphstodomingo and others added 7 commits November 23, 2026 22:29
…p test

A timer another fiber sets in the window (an Effect sleep an earlier file left running) fires by itself and was counted as a leak. Count only timers set from `dbt-adapter-access.ts`, and assert all four were seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
In Fusion mode the "didn't start"/"didn't load" refusals said to fix a Python. They now say Fusion needs a dbt 2.x binary, where the lookup searched, and to run `altimate-dbt doctor`. Other modes' text is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
USAGE says `doctor` checks Fusion and the project in Fusion mode. The not-found message names the interpreter's folder only for a path, as the lookup does. The CLI doctor tests reuse `config()`, report a crash's output, and skip both where `~/.local/bin/dbt` is Fusion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
`create` hands dbt-integration an empty interpreter for a Fusion config with no `pythonPath` (dropping `?? ""` now fails). The e2e stale-manifest test covers `parents` as well as `children`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
The fallbacks took `resolveDbt`'s first `dbt`, which can be dbt Core or the dbt Cloud CLI. In Fusion mode they now run the Fusion binary that the check and the adapter find, and fail without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
The session prints a validator's reason before its fix hint, so the agent read "column-shape mismatch" before learning the spec came from a stale manifest. The note now leads the reason; the fix hint is as before the note existed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ralphstodomingo

ralphstodomingo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review log

Claims (each falsifiable by a concrete trace):

  • C1. The timer-cleanup test in dbt-adapter-access.test.ts never counts a timer set by code other than dbt-adapter-access.ts; it counts every timer dbtAdapterFor sets (four), and fails if any of them isn't passed to clearTimeout.
  • C2. When the adapter's start attempt read dbtIntegration: "fusion", the not_started and not_loaded reasons contain no virtualenv or "Set pythonPath" advice, and name the places the Fusion lookup searched.
  • C3. For any other mode, or none, both reasons are byte-identical to main.
  • C4. fusionPlaces(p) names the interpreter's folder if and only if dbt-integration's interpreter-adjacent candidate would search it (p absolute, or containing / or \).
  • C5. The doctor not-found message and the Fusion refusal both build their places with fusionPlaces.
  • C6. In Fusion mode every dbt-cli fallback run() executes the binary findFusion returned; findFusion calls the lookup with the same options as the prerequisite check; ALTIMATE_DBT_PATH and resolveDbt are not consulted.
  • C7. In Fusion mode with no Fusion binary, no dbt process starts, and each fallback run fails with "dbt Fusion was not found…". (Reworded after round 1: compile's existing manifest fallback still answers from an earlier compiled manifest; see R10.)
  • C8. In every other mode the fallbacks resolve dbt exactly as on main, and the Fusion lookup never runs.
  • C9. A configure() with a new options object during an in-flight Fusion lookup is not overwritten when the lookup finishes. (Reworded after round 1; see R11.)
  • C10. For an answer from a stale manifest, schema-verify's reason starts with the stale note (once) and fixHint is the text it had before the note; for a current manifest both are unchanged.
  • C11. create hands dbt-integration pythonPath === "" for a config without a pythonPath key.
  • C12. The dbt-integration bump changes nothing dbt-tools relies on, and bun install --frozen-lockfile passes on a fresh checkout.

Disclosed residuals (accepted, not findings):

  • R1. index.ts passing dbtIntegration to configure() has no test (reaching a fallback end to end needs the adapter to throw); typecheck and review only.
  • R2. Fusion-mode fallbacks ignore ALTIMATE_DBT_PATH, as the adapter does. A behaviour change for anyone who pointed it at Fusion.
  • R3. A fallback runs the Fusion lookup again (one --version per candidate) after the check's.
  • R4. Fusion flags and output were checked on 2.0.0-preview.175 only, not on CI's pinned version.
  • R5. The Fusion not_loaded advice is about a missing binary; if the binary is found but can't parse the project, doctor passes and the advice doesn't say what failed.
  • R6. A manifest Fusion wrote from a failed parse (marked partial by dbt-integration 0.3.21) isn't flagged by dbt-tools, so children/parents can answer from it without a note. Unchanged from main, where it wasn't marked at all.
  • R7. The cleanup test identifies its own timers by stack frame; if Bun's stack layout changes, the "four timers seen" assertion fails the test rather than letting it pass.
  • R8. Out of scope: dbt-integration's PATH lookup (a non-executable dbt earlier on PATH hides Fusion) belongs to that library.
  • R9. Pre-existing: the e2e-real-dbt-* validator tests run altimate-dbt init with the real HOME, so a full local test/altimate/ run on a machine with dbt rewrites ~/.altimate-code/dbt.json. Tracked separately.
  • R10. execDbtCompile keeps its manifest fallback, which tolerates a failed dbt run by design (a prior compile may have left usable compiled code). So in Fusion mode with no binary, compile can still answer from an earlier target/manifest.json with no process started, as it does in every mode when dbt fails.
  • R11. configure() keeps the caller's options object by reference, so a caller that mutates the same object and passes it again mid-lookup isn't detected as a new configure. The only caller (index.ts) passes a fresh object once per process.

Rounds

  • Round 1, 0dcad86, local Codex CLI (read-only; in-memory checks, dbt-tools typecheck and 34 stale/schema tests ran; filesystem-dependent tests hit the sandbox's read-only FS, so C12's fresh install is verified by the author only): C1–C6, C8, C10, C11 verified, including non-Fusion refusal text byte-identical to main over 48 cases. It falsified C7 with compile's manifest fallback answering from an earlier manifest, and C9 with a configure() that re-passes a mutated options object. Both are behaviour outside what this PR set out to change (the fallback is deliberate and pre-existing; the only caller passes a fresh object), so C7 and C9 are worded to match and the cases are recorded as R10 and R11. No code change. Review ends here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt-tools: pin the stale-manifest fixes, describe the stale shape, let Fusion skip the Python check

1 participant