fix(cli): CODEDB_NO_CLI_DAEMON gates the proxy path, not just the auto-spawn#566
Merged
Merged
Conversation
… 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>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
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.
Problem
CODEDB_NO_CLI_DAEMONonly gated the cli-daemon auto-spawn (main.zig);cliTryProxyran unconditionally for query commands, so a pre-existing daemon still answered despite the variable. Found while profiling #564: a straycli-daemonservedsearchin 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:
loaded snapshotline)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