Skip to content

Improve tool instance disambiguation format#329

Merged
jeremy merged 2 commits intomainfrom
fix/tool-instance-disambiguation
Mar 16, 2026
Merged

Improve tool instance disambiguation format#329
jeremy merged 2 commits intomainfrom
fix/tool-instance-disambiguation

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 16, 2026

Summary

  • Reformats multi-tool disambiguation errors so the ID comes first and is easy to copy-paste into --flag <id>:
    Multiple message boards found. Specify one with --board <id>:
      12345  General
      67890  Engineering
    
  • All three code paths that produce these errors now use the same format: getDockToolID, multiToolError (TUI resolver), and getCardTableID
  • Fixes pluralization for irregular nouns (inboxinboxes, not inboxs) via a pluralNoun helper
  • Removes the now-unused formatCardTableMatches function

Test plan

  • Existing tests updated for new format
  • New tests for inbox (irregular plural) on both command and TUI resolver paths
  • pluralNoun unit test covers all tool-related nouns
  • bin/ci passes

Summary by cubic

Standardizes multi-tool disambiguation errors to "Multiple found" with ID-first lines and a clear flag hint, making copy-paste easier in CLI and TUI. Consolidates pluralization into output.PluralNoun to fix cases like inbox → inboxes.

  • Refactors
    • Unified error format in getDockToolID, multiToolError, and getCardTableID: "Multiple found" + "Specify one with -- :" + lines like " <title>".
    • Moved pluralization to shared output.PluralNoun used by CLI and TUI.
    • Removed unused formatCardTableMatches; updated tests for new messages, hints, and pluralization.

Written for commit 312f254. Summary will update on new commits.

Put the ID first so it's easy to copy-paste into --flag <id>:

  Multiple message boards found. Specify one with --board <id>:
    12345  General
    67890  Engineering

Three code paths updated to the same format:
- getDockToolID (helpers.go)
- multiToolError (tui/resolve/dock.go)
- getCardTableID (cards.go)

Also fix pluralization for irregular nouns (inbox → inboxes, not
inboxs) via a pluralNoun helper, and remove the now-unused
formatCardTableMatches function.
@jeremy jeremy requested a review from a team as a code owner March 16, 2026 07:54
Copilot AI review requested due to automatic review settings March 16, 2026 07:54
@github-actions github-actions bot added commands CLI command implementations tui Terminal UI tests Tests (unit and e2e) enhancement New feature or request labels Mar 16, 2026
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

This PR standardizes ambiguous “multiple matches” errors for dock tools (commands + TUI resolver) and card tables so IDs appear first in a copy/paste-friendly list, and improves pluralization for tool nouns (including inboxinboxes).

Changes:

  • Reformats ambiguous multi-tool errors to: Multiple <plural> found + Specify one with --<flag> <id>: + <id> <title> entries.
  • Adds a small pluralization helper and tests to cover irregular plurals like “inboxes”.
  • Updates/extends tests and removes the now-unused formatCardTableMatches helper.

Reviewed changes

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

Show a summary per file
File Description
internal/tui/resolve/dock.go Updates TUI resolver ambiguous error formatting; adds pluralization helper for tool nouns.
internal/tui/resolve/dock_test.go Updates assertions for new format and adds inbox pluralization coverage.
internal/commands/helpers.go Updates getDockToolID ambiguous error formatting; adds pluralNoun.
internal/commands/helpers_test.go Updates assertions and adds tests for inbox plural + pluralNoun cases.
internal/commands/todos_test.go Updates ambiguous todoset error assertions to match the new format.
internal/commands/cards.go Updates multi-card-table ambiguity to match the standardized format; removes formatCardTableMatches.
internal/commands/cards_test.go Removes tests for deleted helper; updates ambiguity assertions for new card table format.

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

Comment thread internal/tui/resolve/dock.go Outdated
Comment thread internal/commands/helpers.go Outdated
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.

2 issues found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/tui/resolve/dock_test.go">

<violation number="1" location="internal/tui/resolve/dock_test.go:115">
P2: Missing `e.Code` assertion — the sibling `TestDockToolMultiNonInteractiveError` verifies `output.CodeAmbiguous` but this test does not. Add the same check so the error code is covered for the inbox path.</violation>
</file>

<file name="internal/tui/resolve/dock.go">

<violation number="1" location="internal/tui/resolve/dock.go:178">
P2: `pluralizeName` duplicates the identical `pluralNoun` function in `internal/commands/helpers.go`. Consider extracting this into a shared package (e.g., `internal/text` or `internal/output`) so both call sites use the same function and future pluralization fixes only need to be applied once.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/tui/resolve/dock_test.go
Comment thread internal/tui/resolve/dock.go Outdated
Move the pluralization helper to output.PluralNoun so commands and
TUI resolver share one implementation. Add missing e.Code assertion
to the inbox pluralization test.

Addresses review feedback from Copilot and Cubic.
@github-actions github-actions bot added the output Output formatting and presentation label Mar 16, 2026
@jeremy jeremy merged commit cca6df5 into main Mar 16, 2026
26 checks passed
@jeremy jeremy deleted the fix/tool-instance-disambiguation branch March 16, 2026 08:09
jeremy added a commit to brianevanmiller/basecamp-cli that referenced this pull request Mar 18, 2026
…evanmiller/feature-gap-analysis

* origin/main:
  Show full content in detail views instead of truncating at 40 chars (basecamp#338)
  Switch CODEOWNERS from sip to cli team (basecamp#346)
  Fix dock ordering and add --all flag to `projects show` (basecamp#333)
  Add file upload command to SKILL.md (basecamp#343)
  Replace "pending" with "incomplete" in todos output; omit from default view (basecamp#327)
  Add `--in` as global alias for `--project` (basecamp#334)
  Fix 3 post-QA issues on api command (basecamp#330)
  deps: bump the go-dependencies group with 2 updates (basecamp#331)
  Improve tool instance disambiguation format (basecamp#329)
  Fix emoji/CJK alignment in search results (basecamp#328)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request output Output formatting and presentation tests Tests (unit and e2e) tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants