Onboarding friction: non-git dbt projects log as project_id=global + schema_inspect fails before a warehouse is configured
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- git, typescript
- Lĩnh vực
- backend-api-design, cli, data-engineering, testing-qa
Hướng nghiên cứu
Chia công việc thành hai hướng: identity của project và onboarding schema. Đối với identity, đọc packages/opencode/src/project/project.ts, packages/opencode/src/session/prompt.ts và packages/opencode/src/altimate/fingerprint/index.ts, sau đó chạy proposed temp non-git dbt project test; được xem là hoàn tất khi tạo ra các ID deterministic, non-global từ các thư mục con. Đối với onboarding, bắt đầu từ packages/opencode/src/altimate/tools/schema-inspect.ts và so sánh builder.txt, analyst.txt với post-connect-suggestions.ts; thêm các test no-warehouse, invalid-argument và prompt/golden được liệt kê.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Two onboarding/activation bugs degrade the first-run experience when a user runs altimate-code
on a fresh dbt project — especially outside a git repository:
- Project not detected for non-git dbt projects →
project_idresolves to the
global/no-project bucket, so per-project context/state is never established. schema_inspectonboarding wall → the agent callsschema_inspectbefore a warehouse
is configured (or with a guessed argument) and gets a single generic error, so it retries the
same failing call instead of guiding the user to connect first.
Both are independently actionable and can be split into separate issues if preferred.
Failure mode 1 — Non-git dbt projects are not detected → project_id = "global"
Observed behavior
Running altimate-code inside a dbt project that is not a git repo (or opened from a
subdirectory, or in a fresh container/sandbox with no git) produces no stable project identity.
The session is bucketed under the global/no-project id even though the user is doing clearly
project-scoped dbt work (dbt_profiles → apply_patch on models → sql_analyze →
altimate_core_validate → dbt_lineage).
Root cause
Project identity is keyed on git/VCS, not on the dbt project:
packages/opencode/src/session/prompt.ts:365
WhenTelemetry.setContext({ sessionId: sessionID, projectId: Instance.project?.id ?? "" })Instance.projectis undefined,projectIdis empty and falls intoProjectID.global.packages/opencode/src/project/project.ts— sessions default toProjectID.globaland are
only re-homed to a real id on git init (initGit,if (input.project.vcs === "git") ...).
No git → staysglobal.packages/opencode/src/altimate/fingerprint/index.ts:81already detectsdbt_project.yml
(plusprofiles.yml, adapter type, etc.) and tags the sessiondbt/data-engineering—
but this detection is not used to establish project identity.
So a dbt project without a git repo gets no stable project id.
Impact
- Lost per-project context/state: anything keyed on project id (session continuity, memory,
cached schema/connection, per-project config) doesn't persist or carry across sessions →
every run feels cold. - Inconsistent identity between the data-engineering fingerprint (which does recognize the
dbt project) and the project/session layer (which does not).
Proposed fix
- When
Instance.projectis absent, derive a stable project identity from the
data-engineering fingerprint that already runs — anchor on the nearest ancestor directory
containingdbt_project.yml(hash of its absolute path, same shape as the existing project
id), and use that for bothTelemetry.setContextand session/project re-homing. - Treat "dbt project root" as a first-class project anchor alongside git root in
project.ts
(walk up to finddbt_project.ymlif VCS detection fails). - Keep
globalstrictly for genuinely no-project sessions.
Acceptance criteria
- Running altimate-code inside a non-git dbt project (with
dbt_project.yml) yields a
stable, non-globalproject_id, stable across sessions in the same directory. - Opening from a subdirectory of the dbt project resolves to the same id.
- Unit test: fingerprint detects
dbt_project.ymlin a temp non-git dir → project id is
non-empty and deterministic.
Failure mode 2 — schema_inspect onboarding wall (fails before/without a warehouse)
Observed behavior
When schema_inspect is called before any warehouse connection exists, or with a
guessed/invalid table/warehouse name, the tool fails with a single generic error. The agent
cannot distinguish "no warehouse configured" from "bad argument" from "permission denied", so it
retries the same failing call. A user wiring up a warehouse sees repeated schema_inspect errors
interleaved with warehouse_list / warehouse_add / warehouse_test.
Root cause
- No warehouse configured: the agent invokes
schema_inspectbefore a connection exists.
The tool returns a generic failure rather than guiding the user to connect first. - Guessed/invalid args:
schema_inspectis called with atable/warehousename the agent
invented, which fails argument validation. - Generic error surface —
packages/opencode/src/altimate/tools/schema-inspect.ts:64:
The same string is returned for "no warehouse configured", "bad table name", and "permissionoutput: `Failed to inspect schema: ${msg}\n\nEnsure the dispatcher is running and a warehouse connection is configured.`
denied", so the agent can't branch per cause and retries the same failing call. A
post-connect-suggestions.tsflow exists, but there is no pre-connect guardrail.
Proposed fix
- Preflight in
schema_inspect: if no warehouse is configured, short-circuit with a
distinct, actionable result (not a generic error) — e.g. "No warehouse connected. Connect a
warehouse withwarehouse_add, then retry" — and emit a consistentnot_configuredclass so
the agent branches into the connect flow instead of retrying. - Agent guidance (
builder.txt/analyst.txt): do not callschema_inspectuntil a
warehouse connection is confirmed; if not configured, switch to the connect flow. - Distinct, actionable errors surfaced to the model:
not_configuredvsvalidationvs
permissionvsconnection, each with its own recovery hint, instead of one generic string. - Arg validation: when
table/warehouseare not known/resolvable, prompt to discover
(warehouse_list/schema_index) rather than calling with a guessed name.
Acceptance criteria
- Calling
schema_inspectwith no warehouse configured returns a non-error, actionable
not_configuredresult; the agent responds by starting the connect flow rather than retrying. - Calling with an invalid
table/warehousereturns avalidationresult with a discovery
hint. - Tests: (a) no-warehouse → actionable
not_configured, no exception; (b) invalid arg →
validationwith a discovery hint; (c) prompt/golden test asserts the connect-first ordering.
Notes
- Surfaced from observed first-run behavior; the two failure modes are independent and can be
split into separate issues. - The known success-path-silent telemetry artifact for
read/edit/write/globis unrelated
to either failure mode here.
- Ngôn ngữ chính
- TypeScript
- Star
- 813
- Fork
- 134
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 65
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AltimateAI/altimate-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
AltimateAI/altimate-code#1359 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AltimateAI/altimate-code#1323 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AltimateAI/altimate-code#1288 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
AltimateAI/altimate-code#1284 ·
Tất cả issue của AltimateAI/altimate-code
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100