Skip to content

kindling CLI: daemon-backed commands ignore the --db routing hint #139

Description

@joshuaboys

Severity: medium · Confidence: medium · Triage: contract-mismatch
APS: KINTEG-012 (plans/modules/06-downstream-integration-surface.aps.md)
Source: clawpatch/codex review of main, 2026-06-26. Deferred from #127; best scoped with the read/query API (KINTEG-003).

Where

crates/kindling/src/lib.rsbuild_client (~L188). Coverage gap in crates/kindling/tests/daemon.rs.

Problem

build_client is documented to honour --db as a socket-routing project hint, but the implementation accepts no DB argument and always constructs a default client. Daemon coverage only exercises --via-daemon log (no --db); the only --via-daemon + --db test is for import rejection. So daemon-backed commands given an explicit --db are silently routed by process cwd / the default client instead of the user-named database — potentially reading from or writing to a different project DB than the invocation names.

Recommendation

Thread the resolved common --db value into daemon-backed client construction and translate it into the daemon routing/project hint the API contract promises — or reject --via-daemon with --db for all affected commands with a clear error. Add a daemon test exercising --via-daemon <cmd> --db <path> that asserts routing to the named project (or a clean rejection).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions