Skip to content

Add todoset elicitation for multi-todoset projects#230

Merged
jeremy merged 4 commits intomainfrom
todoset-elicit
Mar 10, 2026
Merged

Add todoset elicitation for multi-todoset projects#230
jeremy merged 4 commits intomainfrom
todoset-elicit

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 10, 2026

Summary

  • Route todoset resolution through the interactive dock resolver (Resolver.Todoset()) instead of getTodosetID which errored unhelpfully on multi-todoset projects
  • Add --todoset/-t flag to todos, todos list, todos sweep, todolists, todolists list, and todolists create for explicit disambiguation
  • Fix resolve/todolist.go's private getTodosetID which silently picked the first matching todoset — now routes through the same resolver for correct multi-todoset handling
  • Improve non-interactive ambiguity errors to say Use --todoset <id> instead of the generic "Specify ID directly"
  • Update help text to acknowledge projects may have multiple todosets

Test plan

  • make check passes (fmt, vet, lint, unit tests, 263 e2e tests, surface snapshot, provenance)
  • New resolver tests: single auto-select, explicit ID bypass, multi-todoset non-interactive error, none-found, disabled filtering, todolist resolution through single/multi-todoset
  • New command tests: multi-todoset ambiguous error for todos, todolists, todolists create; explicit --todoset flag bypasses ambiguity
  • Manual TTY picker test on a multi-todoset project (basecamp todos --in <project>)

Closes #218


Summary by cubic

Adds interactive todoset resolution for multi-todoset projects and a --todoset flag to disambiguate, preventing silent selection and unhelpful errors. Also improves ambiguity hints and threads the flag through todolist resolution.

  • New Features

    • Added --todoset/-t to todos, todos list, todos sweep, todolists, todolists list, and todolists create for explicit selection.
    • Routed todoset lookups through Resolver.Todoset() for auto-select on single, interactive pick on multiple, and direct ID bypass.
    • Resolver ambiguity errors now say “Use -- ” and list names/IDs; help text notes projects may have multiple todosets.
  • Bug Fixes

    • Replaced getTodosetID with ensureTodoset and updated todolist resolution to use the same path, fixing multi-todoset ambiguity and stopping silent first-match selection.
    • Threaded the --todoset value through todolist fetching and resolver so explicit IDs aren’t lost; kept helper hints generic (“Specify the ID directly”) to avoid wrong flag names.
    • Added tests for single vs multi-todoset, explicit flag bypass, none-found, disabled filtering, resolver hint text, and todolist resolution behavior.

Written for commit 01fb00d. Summary will update on new commits.

jeremy added 3 commits March 10, 2026 03:22
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.
@jeremy jeremy requested a review from a team as a code owner March 10, 2026 10:23
Copilot AI review requested due to automatic review settings March 10, 2026 10:23
@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 10, 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.

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.

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 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 getTodosetID helpers (which silently picked the first match or gave unhelpful errors) with ensureTodoset() that delegates to Resolver.Todoset() for proper multi-todoset handling (auto-select single, interactive picker, or actionable error)
  • Added --todoset/-t flag to todos, todos list, todos sweep, todolists, todolists list, and todolists create commands
  • 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()
@github-actions github-actions bot added enhancement New feature or request and removed bug Something isn't working labels Mar 10, 2026
@jeremy jeremy merged commit ac4920b into main Mar 10, 2026
25 checks passed
@jeremy jeremy deleted the todoset-elicit branch March 10, 2026 10:48
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 tests Tests (unit and e2e) tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for projects with multiple todosets

2 participants