CLI: silence noisy ENOENT log when daemon socket is absent#3322
Merged
youknowriad merged 1 commit intotrunkfrom May 3, 2026
Merged
CLI: silence noisy ENOENT log when daemon socket is absent#3322youknowriad merged 1 commit intotrunkfrom
youknowriad merged 1 commit intotrunkfrom
Conversation
isProcessRunning() logged every connect failure, including the recoverable ENOENT/ECONNREFUSED/EPIPE cases that just mean the process-manager daemon isn't running yet. That noise shows up mid-session in `studio code` (e.g. when the agent calls wp_cli_run before the site server is started). Skip the log for recoverable connect errors, matching the existing isRecoverableConnectError check used elsewhere in this file. The function still returns undefined either way, so the agent's user-facing "Site is not running" message is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing b7ca4c5 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
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.
Related issues
studio codeHow AI was used in this PR
Investigated the source of an in-session log line, identified the over-eager
console.errorinisProcessRunning, and gated it behind the existingisRecoverableConnectErrorhelper.Proposed Changes
apps/cli/lib/daemon-client.ts, suppress theconsole.errorinisProcessRunning()for recoverable connect errors (ENOENT/ECONNREFUSED/EPIPE). Non-recoverable errors still log. The function continues to returnundefinedeither way, so the agent's user-facing "Site is not running" message is unchanged.Why
When the process-manager daemon isn't running yet, attempting to connect to
~/.studio/daemon/daemon.sockfails withENOENT.connectToDaemon()already treats this as a recoverable condition and auto-spawns the daemon — but if the recovery path itself surfaces an error toisProcessRunning, that error gets logged asError checking if process studio-site-… is running: Error: connect ENOENT …. This noise shows up mid-session instudio code(e.g. when the agent callswp_cli_runand the site server isn't up yet), even though the situation is benign and the tool already returns a clear "Site is not running" message to the user.Testing Instructions
studio codeagainst a session where a site is not currently running, then ask the agent to run a WP-CLI command on that site (e.g.Run wp eval ...).Error checking if process studio-site-<id> is running: Error: connect ENOENT /Users/<you>/.studio/daemon/daemon.sockimmediately above the agent'sSite "<name>" is not running. Start it first using site_start.message.Site "<name>" is not runningmessage appears; no precedingconsole.errorline.npm test -- apps/cli/lib/tests/daemon-client.test.tscontinues to pass.Pre-merge Checklist
🤖 Generated with Claude Code