Conversation
…ojects `campfire list --in <project>` routed through `getDockToolID` which errors with CodeAmbiguous when a project has more than one campfire. Rewrite the project-scoped list path to fetch the dock directly and return all enabled chat entries (mirroring the `todosets list` pattern). Thread the `-c` flag into the list command so `campfire list -c <id>` works. Update agent_notes to reflect that projects may have multiple campfires.
Cover the new campfire list flow: multiple campfires returned without ambiguous error, -c flag filtering to a single campfire, not-found when no chat entries exist, and disabled-campfire hint.
There was a problem hiding this comment.
Pull request overview
This PR fixes campfire list --in <project> failing with CodeAmbiguous on projects with multiple campfires. The root cause was that the list command routed through getDockToolID, which errors when multiple dock entries match.
Changes:
- Rewrote the project-scoped campfire list path to fetch the dock directly and return all enabled chat entries (mirroring the
todosets listpattern) - Threaded the
-cflag intonewCampfireListCmdsocampfire list -c <id>works to filter to a single campfire - Added comprehensive tests for multi-campfire, single campfire flag, no campfires, and disabled campfire scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/commands/campfire.go | Rewrote runCampfireList to fetch project dock directly, iterate over all chat entries, and support -c flag filtering; extracted campfireTitle and campfireListBreadcrumbs helpers; updated agent_notes annotation |
| internal/commands/campfire_test.go | Added 4 tests covering multi-campfire listing, -c flag, no campfires, and disabled campfire error cases; added reusable newTestAppWithTransport helper and mock transports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
3 issues found across 2 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/campfire_test.go">
<violation number="1" location="internal/commands/campfire_test.go:333">
P2: `assert.Len` does not halt the test on failure. If `Data` has fewer than 2 elements, the next line panics with an index-out-of-range instead of a clean failure. Use `require.Len` here since subsequent lines depend on the length.</violation>
<violation number="2" location="internal/commands/campfire_test.go:353">
P2: Same issue: `assert.Len` won't halt the test, and the next line indexes into `Data[0]` unconditionally. Use `require.Len` to guard against a panic.</violation>
</file>
<file name="internal/commands/campfire.go">
<violation number="1" location="internal/commands/campfire.go:146">
P3: Reuse the existing `DockTool` type from helpers.go instead of re-declaring an identical anonymous struct. The same package already defines and exports this type with identical fields.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Use the existing DockTool type from helpers.go instead of redeclaring an identical anonymous struct. Switch assert.Len to require.Len where subsequent lines index into the result, preventing panics on failure.
Review carefully before merging. Consider a major version bump. |
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
campfire list --in <project>failed withCodeAmbiguouson projects with multiple campfires because it routed throughgetDockToolID, which requires a single matchtodosets listpattern)-cflag intonewCampfireListCmdsocampfire list -c <id>worksagent_notesto reflect that projects may have multiple campfiresFixes card
Design note
campfire listintentionally bypassesgetDockToolIDbecause listing must enumerate all chat dock entries in a project. Single-campfire commands (messages,post,upload,line,delete) still use the existinggetCampfireID→getDockToolIDdisambiguation path, which requires-cwhen multiple campfires exist.Test plan
bin/cigreenTestCampfireListMultipleCampfires— 2 campfires returned, no ambiguous errorTestCampfireListWithCampfireFlag—-c <id>filters to single campfireTestCampfireListNoCampfires— not-found error with "no campfire" hintTestCampfireListDisabledCampfire— not-found error with "disabled" hintbasecamp campfire list --in 37331921 --json— returns both Fizzy campfiresbasecamp campfire list -c 9301300227 --in 37331921 --json— returns only "Chatter"