Skip to content

Commit 03fb39c

Browse files
anandgupta42claude
andcommitted
fix: make dbt profile paths OS-dependent in tool descriptions and messages
Use `os.homedir()` + `path.join()` to compute the default `.dbt` directory at runtime instead of hardcoding `~/.dbt/`. This renders correct paths on both Unix (`/Users/x/.dbt`) and Windows (`C:\Users\x\.dbt`). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 99c28a1 commit 03fb39c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/opencode/src/altimate/tools/dbt-profiles.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import z from "zod"
2+
import { homedir } from "os"
3+
import { join } from "path"
24
import { Tool } from "../../tool/tool"
35
import { Dispatcher } from "../native"
46
import { isSensitiveField } from "../native/connections/credential-store"
57

8+
const DEFAULT_DBT_DIR = join(homedir(), ".dbt")
9+
610
export const DbtProfilesTool = Tool.define("dbt_profiles", {
711
description:
8-
"Discover dbt profiles from profiles.yml and map them to warehouse connections. Auto-detects Snowflake, BigQuery, Databricks, Postgres, Redshift, MySQL, DuckDB configurations. Searches: explicit path > DBT_PROFILES_DIR env var > project-local profiles.yml > ~/.dbt/profiles.yml.",
12+
`Discover dbt profiles from profiles.yml and map them to warehouse connections. Auto-detects Snowflake, BigQuery, Databricks, Postgres, Redshift, MySQL, DuckDB configurations. Searches: explicit path > DBT_PROFILES_DIR env var > project-local profiles.yml > ${DEFAULT_DBT_DIR}/profiles.yml.`,
913
parameters: z.object({
10-
path: z.string().optional().describe("Explicit path to profiles.yml. If omitted, checks DBT_PROFILES_DIR, then project directory, then ~/.dbt/profiles.yml"),
14+
path: z.string().optional().describe(`Explicit path to profiles.yml. If omitted, checks DBT_PROFILES_DIR, then project directory, then ${DEFAULT_DBT_DIR}/profiles.yml`),
1115
projectDir: z.string().optional().describe("dbt project root directory. Used to find project-local profiles.yml next to dbt_project.yml"),
1216
}),
1317
async execute(args, ctx) {
@@ -30,7 +34,7 @@ export const DbtProfilesTool = Tool.define("dbt_profiles", {
3034
return {
3135
title: "dbt Profiles: No connections found",
3236
metadata: { success: true, connection_count: 0 },
33-
output: "No dbt profiles found. Ensure profiles.yml exists in your project directory, DBT_PROFILES_DIR, or ~/.dbt/.",
37+
output: `No dbt profiles found. Ensure profiles.yml exists in your project directory, DBT_PROFILES_DIR, or ${DEFAULT_DBT_DIR}/.`,
3438
}
3539
}
3640

0 commit comments

Comments
 (0)