feat(chat): add chat update command for editing campfire messages#462
feat(chat): add chat update command for editing campfire messages#462nnemirovsky wants to merge 1 commit intobasecamp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new basecamp chat update / basecamp campfire update command so existing campfire lines can be edited in place, extending the chat command set to cover the SDK’s new UpdateLine capability.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Adds the new chat update subcommand, including project/room resolution, optional rich-text content type handling, and mention resolution behavior aligned with
chat post. - Updates command metadata and generated CLI surface/docs so the new action appears in help, skill docs, and smoke coverage.
- Temporarily swaps the SDK dependency to a forked revision that exposes
CampfiresService.UpdateLine.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
skills/basecamp/SKILL.md |
Adds a chat update example to the Basecamp skill docs. |
internal/commands/commands.go |
Registers update in the chat command catalog. |
internal/commands/chat.go |
Implements the new chat line update command and wires it into chat. |
internal/commands/chat_test.go |
Adds unit coverage for update request payloads and empty-content rejection. |
go.sum |
Updates module checksums for the temporary SDK fork. |
go.mod |
Adds the temporary replace to the forked SDK revision. |
e2e/smoke/smoke_campfire.bats |
Adds smoke coverage for editing an existing campfire message. |
e2e/chat.bats |
Adds a CLI error-path test for missing chat update arguments. |
.surface |
Regenerates command/flag surface metadata for the new subcommand. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
2 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="e2e/smoke/smoke_campfire.bats">
<violation number="1" location="e2e/smoke/smoke_campfire.bats:57">
P3: The new update smoke test does not verify that the message body actually changed, so a no-op update could still pass.</violation>
</file>
<file name="e2e/chat.bats">
<violation number="1" location="e2e/chat.bats:103">
P2: Missing-argument test is under-specified: it only checks for a non-zero exit, so unrelated failures would still make it pass.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
91d7567 to
ce934ec
Compare
ce934ec to
112e6fd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
112e6fd to
6aaf95b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6aaf95b to
96cf589
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds 'basecamp chat update <id|url> [content]' for editing existing
campfire lines in place via PUT /chats/{c}/lines/{l}. Mirrors 'chat post'
shape: positional content or --content flag, --content-type for HTML,
@mention resolution with auto-promotion to text/html.
Backed by basecamp-sdk CampfiresService.UpdateLine. While the SDK
addition is in flight, go.mod has a temporary replace pinning to a
fork branch carrying just that operation; the replace is dropped
once an SDK release with UpdateLine ships.
Wires up surface snapshot, smoke + e2e coverage, and the basecamp
skill documentation.
96cf589 to
a0dd509
Compare
Summary
Adds
basecamp chat update <id|url> [content]for editing existing campfire lines in place, mirroring the shape ofchat post. Until now the CLI could only post or delete chat lines — editing required deleting and reposting, which bumps the message and is disruptive in active rooms.Verified live: PUT against a real campfire line returns 204 and content updates; the new command round-trips an edit and restores it cleanly.
Changes
internal/commands/chat.go: newnewChatLineUpdateCmd, registered inNewChatCmd(). Same project/room resolution aschat lineandchat delete(URL → flag → config → interactive). @mention resolution mirrorschat postand auto-promotes totext/htmlwhen mentions resolve.internal/commands/commands.go: catalog updated.chat_test.go(PUT body verification + empty-content rejection), 1 e2e ine2e/chat.bats, 1 smoke ine2e/smoke/smoke_campfire.bats..surfaceregenerated.skills/basecamp/SKILL.md: documented under chat examples.SDK dependency
Backed by
CampfiresService.UpdateLine— an SDK addition in flight at basecamp/basecamp-sdk#295. While that's unreleased,go.modcarries a temporaryreplacepointing at a fork branch that adds onlyUpdateLineon top of the same SDK commitmainis currently pinned to:Once a tagged SDK release containing
UpdateLineships, thereplaceis dropped andgo.modbumps to that version. This PR is best held as draft until the SDK PR merges and releases.Test plan
bin/ci— all checks pass (unit, e2e, surface, skill drift, smoke coverage, tidy)go install ./cmd/basecampfrommain(which integrates this branch) —basecamp chat update --helpshows the new command(merged)suffix, restored to originalRelated
SDK op: basecamp/basecamp-sdk#295
Summary by cubic
Add
basecamp chat update <id|url> [content]to edit Campfire messages in place, mirroringchat post. Also available asbasecamp campfire update.New Features
updatesubcommand: accepts ID or chat-line URL (/chats/{c}/lines/{l}or/chats/{c}@{l}); extracts chat+line IDs; URL wins over--room; rejects non chat-line URLs.--content; supports--content-type; forbids empty content.text/plaindisables mention resolution; resolves @mentions likechat postand auto-promotes totext/htmlwhen mentions resolve.{"updated": true}if refetch fails..surface, command catalog, API coverage, docs; adds tests for PUT body, mention promotion, plain-text opt-out, URL parsing, empty-content rejection, a no-args error, and a smoke test verifying content changes.Dependencies
CampfiresService.UpdateLine.replaceingo.modtogithub.com/nnemirovsky/basecamp-sdk/go v0.5.1-0.20260504111141-62d09023dc73; remove after the upstream SDK release includesUpdateLine.Written for commit a0dd509. Summary will update on new commits.