Skip to content

Distinguish disabled tools from missing tools in errors#247

Merged
jeremy merged 2 commits intomainfrom
disabled-tool-errors
Mar 11, 2026
Merged

Distinguish disabled tools from missing tools in errors#247
jeremy merged 2 commits intomainfrom
disabled-tool-errors

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • When a dock tool exists but is disabled, shows "X is disabled for this project" instead of the generic "Project has no X"
  • Fixes both the CLI path (getDockToolID in helpers.go) and the TUI path (fetchDockTools/DockTool in resolve/dock.go)
  • Adds Enabled filter to getDockToolID (previously returned disabled tools that would fail opaquely downstream)
  • fetchDockTools now returns (enabled, allDock, error) so the caller can distinguish disabled from absent without a second API call
  • Adds unit tests for both disabled-only and absent-tool branches
  • Fixes mock dock data in existing tests to include enabled: true

Context

DHH feedback card 9661172355 — unhelpful error messages when running commands against projects with disabled tools.

Test plan

  • bin/ci passes
  • TestGetDockToolID_DisabledToolShowsDisabledError — CLI path
  • TestGetDockToolID_AbsentToolShowsNotFoundError — CLI path
  • TestDockToolDisabledOnlyShowsDisabledError — TUI path

Summary by cubic

Show clear errors when a dock tool exists but is disabled, instead of saying the project has none. Applies to both CLI and TUI, and avoids opaque failures by filtering out disabled tools.

  • Bug Fixes
    • CLI: getDockToolID now filters for enabled tools and returns “X is disabled for this project” when applicable.
    • TUI: DockTool distinguishes disabled vs. missing tools; fetchDockTools returns (enabledMatches, allDock, error) to support this.
    • Tests: Added coverage for disabled-only and absent-tool cases; updated all dock test fixtures to include enabled: true to match the API.

Written for commit 97ffc19. Summary will update on new commits.

@jeremy jeremy requested a review from a team as a code owner March 11, 2026 03:24
Copilot AI review requested due to automatic review settings March 11, 2026 03:24
@github-actions github-actions bot added commands CLI command implementations tui Terminal UI tests Tests (unit and e2e) bug Something isn't working labels Mar 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves dock tool resolution so users get a specific “tool is disabled for this project” error when a tool exists but is disabled, instead of the generic “Project has no X”, across both CLI and TUI resolution paths.

Changes:

  • CLI: getDockToolID now filters to enabled dock tools and surfaces a disabled-specific not-found hint.
  • TUI: fetchDockTools returns both enabled matches and the full dock list so DockTool can differentiate disabled vs absent without an extra API call.
  • Tests: adds new unit coverage for disabled-only vs absent-tool branches and updates some mocked dock JSON to include enabled: true.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/commands/helpers.go Filters dock tool matches by Enabled and emits a disabled-specific hint when applicable.
internal/tui/resolve/dock.go Returns both enabled matches + full dock list; improves disabled vs missing error reporting in the resolver.
internal/commands/helpers_test.go Adds CLI-path tests for disabled-only and absent-tool error branches.
internal/tui/resolve/dock_test.go Adds TUI-path test ensuring disabled-only projects produce the disabled-specific hint.
internal/commands/messages_test.go Updates mocked dock tool JSON to include enabled: true.
internal/commands/campfire_test.go Updates mocked dock tool JSON to include enabled: true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 2 commits March 10, 2026 21:46
When a dock tool (campfire, message board, etc.) exists but is disabled
for the project, show "X is disabled for this project" instead of the
generic "Project has no X". Applies to both the CLI helpers.go path
and the TUI resolve/dock.go path.

Also filters on Enabled in getDockToolID (CLI path), which previously
returned disabled tools that would fail opaquely downstream. Adds
test coverage for both disabled-only and absent-tool branches,
and fixes mock dock data in existing tests to include enabled: true.
Ensures all test dock data matches the real API response shape, which
always includes the enabled field.
Copilot AI review requested due to automatic review settings March 11, 2026 04:49
@jeremy jeremy force-pushed the disabled-tool-errors branch from c17f48d to 97ffc19 Compare March 11, 2026 04:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit 0203766 into main Mar 11, 2026
29 checks passed
@jeremy jeremy deleted the disabled-tool-errors branch March 11, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working commands CLI command implementations tests Tests (unit and e2e) tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants