fix: Clear error messages with structured errors and suggestions#364
Open
whitmo wants to merge 1 commit intodlorenc:mainfrom
Open
fix: Clear error messages with structured errors and suggestions#364whitmo wants to merge 1 commit intodlorenc:mainfrom
whitmo wants to merge 1 commit intodlorenc:mainfrom
Conversation
Audit and improve error messages in cli.go and daemon.go for the P0 "Clear error messages" roadmap item. Every failure now tells the user what went wrong and how to fix it. Changes: - Add 7 new error constructors: ClaudeStartupFailed, DaemonAlreadyRunning, AgentRestartFailed, PromptWriteFailed, LogFileNotFound, WorkspaceAlreadyExists, RepoAlreadyInitialized - Convert ~70 raw fmt.Errorf calls in cli.go to use structured errors with categories, messages, and actionable suggestions - Improve daemon.go socket error responses with recovery hints - Focus on most common failure paths: daemon communication, agent/worker not found, worktree issues, tmux failures, Claude binary not found - Add tests for all new error constructors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 7, 2026
Author
Triage ReviewPriority: P0 (Clear error messages - roadmap item) Changes:
Recommendation: Merge AFTER #360 and #362 to avoid conflicts, then rebase. |
5 tasks
Author
Local CI Verification (2026-03-12)
CI Status: No GitHub Actions checks are running — this is expected for first-time fork PRs. GitHub requires a maintainer to approve workflow runs for PRs from forks. Branch is rebased on |
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.
Summary
internal/cli/cli.go(~5500 lines) andinternal/daemon/daemon.gofor raw errors lacking user contextfmt.Errorfcalls to use structuredinternal/errorsconstructors with categories, messages, and actionable suggestionsKey improvements by failure path:
DaemonCommunicationFailed()with "multiclaude daemon start" suggestion (replaces"failed to X: %w (is daemon running?)")AgentNotFound()used more consistently, newAgentRestartFailed()WorktreeCreationFailed()used in all paths, cleanup suggestionsTmuxOperationFailed()with manual cleanup commandsClaudeNotFound()and newClaudeStartupFailed()with install linkInvalidArgument()for all flag validation (--mq-track, --ps-enabled, etc.)New error constructors:
ClaudeStartupFailed,DaemonAlreadyRunning,AgentRestartFailed,PromptWriteFailed,LogFileNotFound,WorkspaceAlreadyExists,RepoAlreadyInitializedTest plan
go test ./...)Format()tests🤖 Generated with Claude Code