Skip to content

fix(cli): CODEDB_NO_CLI_DAEMON gates the proxy path, not just the auto-spawn#566

Merged
justrach merged 1 commit into
release/0.2.5825from
fix/no-cli-daemon-gates-proxy
Jun 10, 2026
Merged

fix(cli): CODEDB_NO_CLI_DAEMON gates the proxy path, not just the auto-spawn#566
justrach merged 1 commit into
release/0.2.5825from
fix/no-cli-daemon-gates-proxy

Conversation

@justrach

Copy link
Copy Markdown
Owner

Problem

CODEDB_NO_CLI_DAEMON only gated the cli-daemon auto-spawn (main.zig); cliTryProxy ran unconditionally for query commands, so a pre-existing daemon still answered despite the variable. Found while profiling #564: a stray cli-daemon served search in 944µs with the variable set, silently contaminating in-process benchmarks (the variable's documented purpose).

Fix

Hoist the env check to gate the whole thin-client block — proxy attempt and spawn.

Validation

Live A/B with a daemon running for openclaw:

  • env unset → proxied (no loaded snapshot line)
  • CODEDB_NO_CLI_DAEMON=1 → in-process path (✓ loaded snapshot 13654 files 39.4ms)

zig build test: all green. No issue filed: a faithful failing test needs a live Unix-socket daemon fixture, disproportionate to the 3-line gate per the failing-test rule — the live repro above stands in.

🤖 Generated with Claude Code

… just the auto-spawn

The env var gated only the cli-daemon spawn; cliTryProxy still ran, so
a pre-existing daemon answered query commands despite the variable.
Observed while profiling #564: a stray cli-daemon served 'search' in
944µs with CODEDB_NO_CLI_DAEMON=1 set, contaminating in-process
measurements. Hoist the check to gate both the proxy attempt and the
spawn so the variable pins the in-process path as documented.

Verified live: daemon running, env set -> 'loaded snapshot' in-process
path; env unset -> proxied. Suite green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 103878 103438 -0.42% -440 OK
codedb_changes 10324 10627 +2.93% +303 OK
codedb_context 1108007 1140038 +2.89% +32031 OK
codedb_deps 310 323 +4.19% +13 OK
codedb_edit 52039 44557 -14.38% -7482 OK
codedb_find 9854 9525 -3.34% -329 OK
codedb_hot 24261 26587 +9.59% +2326 OK
codedb_outline 40199 35101 -12.68% -5098 OK
codedb_read 16544 16983 +2.65% +439 OK
codedb_search 26278 26093 -0.70% -185 OK
codedb_snapshot 73503 64338 -12.47% -9165 OK
codedb_status 9375 9179 -2.09% -196 OK
codedb_symbol 50190 49984 -0.41% -206 OK
codedb_tree 24382 22993 -5.70% -1389 OK
codedb_word 11826 12133 +2.60% +307 OK

@justrach justrach merged commit 51c3c39 into release/0.2.5825 Jun 10, 2026
2 checks passed
@justrach justrach deleted the fix/no-cli-daemon-gates-proxy branch June 10, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant