Add todoset elicitation for multi-todoset projects#230
Conversation
Replace getTodosetID (which errored unhelpfully on multi-todoset projects) with ensureTodoset, which routes through Resolver.Todoset() for interactive picker support. Fix resolve/todolist.go's private getTodosetID to use the same path, preventing silent first-match selection on multi-todoset projects. Improve the non-interactive ambiguity hint in both dock.go and helpers.go to tell users the actual flag name (e.g. --todoset <id>) instead of the generic "Specify ID directly".
Wire --todoset/-t through todos list, todos sweep, todolists list, and todolists create so users can disambiguate multi-todoset projects. Scoped as a local flag on each command that needs it — not on show/update where it would be a silent no-op. Update help text in todolists and todosets to acknowledge that projects may have multiple todosets.
Resolver tests (dock_test.go): single auto-select, explicit ID bypass, multi-todoset non-interactive error with hint, none-found, disabled filtering, and todolist resolution through getTodosetID for both single and multi-todoset projects. Command tests (todos_test.go): multi-todoset ambiguous error for todos, todolists, and todolists create; explicit --todoset flag bypasses ambiguity.
There was a problem hiding this comment.
3 issues found across 9 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/commands/helpers.go">
<violation number="1" location="internal/commands/helpers.go:85">
P2: The hint references `--{flagName}` but `getDockToolID` is shared by many callers (campfire, vault, schedule, questionnaire, message board, inbox) that don't register a corresponding CLI flag. Users hitting this error on a multi-dock project would be told to use a non-existent flag. Consider accepting the flag name as a parameter so each caller can supply the correct one (or empty to fall back to a generic message).</violation>
</file>
<file name="internal/tui/resolve/dock.go">
<violation number="1" location="internal/tui/resolve/dock.go:159">
P2: Derived flag name `--message-board` doesn't match the actual CLI flag `--board`. When a project has multiple message boards in non-interactive mode, the error will suggest a flag that doesn't exist.
Consider accepting the flag name as a parameter to `DockTool`/`multiToolError` instead of deriving it from `friendlyName`, or maintain an explicit mapping.</violation>
</file>
<file name="internal/tui/resolve/todolist.go">
<violation number="1" location="internal/tui/resolve/todolist.go:151">
P1: `getTodosetID` always passes `""` as `explicitID`, so the `--todoset` flag is never forwarded when resolving todolists via `fetchTodolists`. On multi-todoset projects, `todolists` commands will still fail with an ambiguity error even when the user supplies `--todoset <id>`.
Consider threading the explicit todoset ID through `fetchTodolists` and `getTodosetID` so the flag value reaches `r.Todoset()`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Pull request overview
This PR adds proper support for Basecamp projects with multiple todosets, fixing issue #218 where users received an unhelpful error with no working disambiguation mechanism. The change routes todoset resolution through the interactive dock resolver (Resolver.Todoset() → DockTool()), adds a --todoset/-t flag to all relevant commands, and improves error messages to suggest the correct flag syntax.
Changes:
- Replaced the old
getTodosetIDhelpers (which silently picked the first match or gave unhelpful errors) withensureTodoset()that delegates toResolver.Todoset()for proper multi-todoset handling (auto-select single, interactive picker, or actionable error) - Added
--todoset/-tflag totodos,todos list,todos sweep,todolists,todolists list, andtodolists createcommands - Updated non-interactive ambiguity error messages in both the resolver and command-level helpers to suggest
Use --todoset <id>instead of the generic "Specify ID directly"
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/tui/resolve/dock.go |
Updated multiToolError to suggest --<tool> flag in error hint |
internal/tui/resolve/todolist.go |
Refactored private getTodosetID to route through Resolver.Todoset() |
internal/commands/helpers.go |
Replaced getTodosetID with ensureTodoset() wrapper; updated getDockToolID error hint |
internal/commands/todos.go |
Added --todoset flag to todos, todos list, todos sweep; plumbed through to ensureTodoset |
internal/commands/todolists.go |
Added --todoset flag to todolists, todolists list, todolists create; plumbed through to ensureTodoset |
internal/commands/todosets.go |
Updated help text; switched to ensureTodoset |
internal/tui/resolve/dock_test.go |
New tests for dock tool resolution: single/multi/none/disabled/explicit-ID/todolist paths |
internal/commands/todos_test.go |
New tests for multi-todoset ambiguous error and --todoset flag bypass |
.surface |
Added --todoset flag entries for all affected commands |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Revert getDockToolID hint to generic "Specify the ID directly" since derived flag names are wrong for most callers (e.g. --message-board) - Add explicit flagName parameter to DockTool() and multiToolError() so each convenience method supplies the correct CLI flag name - Thread explicitTodosetID through fetchTodolists and getTodosetID so the --todoset flag value reaches Resolver.Todoset()
Summary
Resolver.Todoset()) instead ofgetTodosetIDwhich errored unhelpfully on multi-todoset projects--todoset/-tflag totodos,todos list,todos sweep,todolists,todolists list, andtodolists createfor explicit disambiguationresolve/todolist.go's privategetTodosetIDwhich silently picked the first matching todoset — now routes through the same resolver for correct multi-todoset handlingUse --todoset <id>instead of the generic "Specify ID directly"Test plan
make checkpasses (fmt, vet, lint, unit tests, 263 e2e tests, surface snapshot, provenance)todos,todolists,todolists create; explicit--todosetflag bypasses ambiguitybasecamp todos --in <project>)Closes #218
Summary by cubic
Adds interactive todoset resolution for multi-todoset projects and a
--todosetflag to disambiguate, preventing silent selection and unhelpful errors. Also improves ambiguity hints and threads the flag through todolist resolution.New Features
--todoset/-ttotodos,todos list,todos sweep,todolists,todolists list, andtodolists createfor explicit selection.Resolver.Todoset()for auto-select on single, interactive pick on multiple, and direct ID bypass.Bug Fixes
getTodosetIDwithensureTodosetand updated todolist resolution to use the same path, fixing multi-todoset ambiguity and stopping silent first-match selection.--todosetvalue through todolist fetching and resolver so explicit IDs aren’t lost; kept helper hints generic (“Specify the ID directly”) to avoid wrong flag names.Written for commit 01fb00d. Summary will update on new commits.