Skip to content

feat(chat): add chat update command for editing campfire messages#462

Draft
nnemirovsky wants to merge 1 commit intobasecamp:mainfrom
nnemirovsky:feat/chat-update
Draft

feat(chat): add chat update command for editing campfire messages#462
nnemirovsky wants to merge 1 commit intobasecamp:mainfrom
nnemirovsky:feat/chat-update

Conversation

@nnemirovsky
Copy link
Copy Markdown
Contributor

@nnemirovsky nnemirovsky commented May 4, 2026

Summary

Adds basecamp chat update <id|url> [content] for editing existing campfire lines in place, mirroring the shape of chat 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: new newChatLineUpdateCmd, registered in NewChatCmd(). Same project/room resolution as chat line and chat delete (URL → flag → config → interactive). @mention resolution mirrors chat post and auto-promotes to text/html when mentions resolve.
  • internal/commands/commands.go: catalog updated.
  • Tests: 2 in chat_test.go (PUT body verification + empty-content rejection), 1 e2e in e2e/chat.bats, 1 smoke in e2e/smoke/smoke_campfire.bats.
  • .surface regenerated.
  • 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.mod carries a temporary replace pointing at a fork branch that adds only UpdateLine on top of the same SDK commit main is currently pinned to:

replace github.com/basecamp/basecamp-sdk/go => github.com/nnemirovsky/basecamp-sdk/go v0.5.1-0.20260504111141-62d09023dc73

Once a tagged SDK release containing UpdateLine ships, the replace is dropped and go.mod bumps 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/basecamp from main (which integrates this branch) — basecamp chat update --help shows the new command
  • Live edit round-trip against a real campfire line — added and removed (merged) suffix, restored to original

Related

SDK op: basecamp/basecamp-sdk#295


Summary by cubic

Add basecamp chat update <id|url> [content] to edit Campfire messages in place, mirroring chat post. Also available as basecamp campfire update.

  • New Features

    • New update subcommand: 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 via arg or --content; supports --content-type; forbids empty content. text/plain disables mention resolution; resolves @mentions like chat post and auto-promotes to text/html when mentions resolve.
    • Re-fetches and returns the updated line with breadcrumbs; falls back to {"updated": true} if refetch fails.
    • Updates .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

    • Uses SDK method CampfiresService.UpdateLine.
    • Temporary replace in go.mod to github.com/nnemirovsky/basecamp-sdk/go v0.5.1-0.20260504111141-62d09023dc73; remove after the upstream SDK release includes UpdateLine.

Written for commit a0dd509. Summary will update on new commits.

Copilot AI review requested due to automatic review settings May 4, 2026 10:32
@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) skills Agent skills deps labels May 4, 2026
@github-actions github-actions Bot added the enhancement New feature or request label May 4, 2026
@nnemirovsky nnemirovsky marked this pull request as ready for review May 4, 2026 10:34
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

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.

Comment thread internal/commands/chat.go Outdated
Comment thread go.mod Outdated
Comment thread go.mod Outdated
Comment thread internal/commands/chat_test.go
Comment thread go.mod 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 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.

Comment thread e2e/chat.bats
Comment thread e2e/smoke/smoke_campfire.bats
Copilot AI review requested due to automatic review settings May 4, 2026 11:06
@github-actions github-actions Bot added docs and removed deps labels May 4, 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

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.

Comment thread internal/commands/chat.go
Comment thread internal/commands/chat.go Outdated
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

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.

Comment thread internal/commands/chat.go Outdated
Comment thread internal/commands/chat.go Outdated
Comment thread go.mod
Comment thread go.mod
@github-actions github-actions Bot added the sdk SDK wrapper and provenance label May 4, 2026
@nnemirovsky nnemirovsky requested a review from Copilot May 4, 2026 11:53
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

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.

Comment thread internal/commands/chat.go Outdated
Comment thread go.mod
Comment thread API-COVERAGE.md
@nnemirovsky nnemirovsky marked this pull request as draft May 4, 2026 11:59
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations deps docs enhancement New feature or request sdk SDK wrapper and provenance skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants