fix: resolve cortex_skill dir with flags.PROJECT_DIR for dbt Fusion - #35
Merged
Matts52 merged 1 commit intoSep 25, 2026
Merged
Conversation
…loses Matts52#32) dbt Fusion doesn't set the process cwd to the project root when executing PUT statements, so the relative path from model['original_file_path'] fails with "file does not exist" even though the directory is present. flags.PROJECT_DIR is populated in both dbt Core and Fusion (unlike model['root_path'], which resolves empty under Fusion), so build the absolute path from that instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32.
Problem
cortex_skill__resolve_skill_dir()(inmacros/relations/cortex_skill/create.sql) returns a path built frommodel['original_file_path'], which is relative to the project root. dbt Core sets its process cwd to the project root when executing the PUT, so the relative path resolves fine there — but dbt Fusion does not, so the PUT fails with:Fix
Build an absolute path from
flags.PROJECT_DIR ~ '/' ~ model['original_file_path'][:-4]instead.flags.PROJECT_DIRis populated in both dbt Core and dbt Fusion, whereasmodel['root_path']resolves to an empty string under Fusion (per the issue report), so it isn't a viable alternative.Also updated the doc comments in the same file that described the old relative-path behavior.
Test plan
integration_testsCI (DuckDB compile ofagent_*/example_mcp_*models) doesn't currently select the skill fixture, so this fix isn't independently re-verified by CI — flagging for the maintainer to confirm against a real Fusion run if desired🤖 Generated with Claude Code