Skip to content

Fix campfire messages returning stale messages#371

Merged
jeremy merged 2 commits intomainfrom
decorous-general
Mar 25, 2026
Merged

Fix campfire messages returning stale messages#371
jeremy merged 2 commits intomainfrom
decorous-general

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 24, 2026

Summary

  • Bug: chat messages returned months-old messages for active campfires. The SDK's ListLines with nil options fetches from page 1 (oldest), caps at 100, then the CLI reverse-sliced the last N of that stale batch.
  • Fix: Pass Sort: "created_at", Direction: "desc" to ListLines so the API returns newest messages first, let the SDK handle the limit, and reverse to chronological display order.
  • Test: Regression test verifies sort/direction query params are sent and output is in chronological order.

Known debt: TUI paths (hub_global.go:444,509, hub.go:729) also call ListLines(..., nil) with incorrect "newest-first" comments. Out of scope — TUI is shelved.

Fixes #284

Test plan

  • Rebase onto main with bumped SDK
  • bin/ci passes (excluding pre-existing check-smoke-coverage failure on main)
  • Manual: basecamp chat messages --limit 3 --json returns March 2026 messages in chronological order

Copilot AI review requested due to automatic review settings March 24, 2026 20:06
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) bug Something isn't working labels Mar 24, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99caed71b0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy jeremy force-pushed the decorous-general branch from 99caed7 to 79992d2 Compare March 24, 2026 20:12
@jeremy jeremy changed the title Fix campfire messages returning stale messages Draft: Fix campfire messages returning stale messages Mar 24, 2026
@jeremy jeremy force-pushed the decorous-general branch from 79992d2 to 05843bd Compare March 24, 2026 20:36
@github-actions github-actions bot added tui Terminal UI sdk SDK wrapper and provenance docs deps labels Mar 24, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05843bd78a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy jeremy changed the title Draft: Fix campfire messages returning stale messages Fix campfire messages returning stale messages Mar 24, 2026
@jeremy jeremy changed the base branch from main to sdk-0.7.0 March 24, 2026 20:52
@jeremy jeremy force-pushed the sdk-0.7.0 branch 4 times, most recently from d6a2cae to 6ea302a Compare March 25, 2026 07:07
@jeremy jeremy force-pushed the decorous-general branch from 05843bd to c592c71 Compare March 25, 2026 07:10
@github-actions github-actions bot removed tui Terminal UI sdk SDK wrapper and provenance docs deps labels Mar 25, 2026
@jeremy jeremy force-pushed the sdk-0.7.0 branch 2 times, most recently from d2df13a to 6c0bca3 Compare March 25, 2026 07:34
Base automatically changed from sdk-0.7.0 to main March 25, 2026 07:37
jeremy added 2 commits March 25, 2026 00:38
The chat messages command called ListLines with nil options, which fetches
from page 1 (oldest messages) and caps at 100. The client-side reverse-slice
then took the last N of the oldest 100 — yielding months-old messages for
active campfires.

Pass Sort/Direction options to request newest-first from the API, let the
SDK handle the limit, and reverse to chronological order for display.

Fixes #284
Verifies that chat messages sends sort=created_at&direction=desc to the
API, respects --limit for truncation, and renders the response in
chronological order (oldest to newest).
@jeremy jeremy force-pushed the decorous-general branch from c592c71 to 9e4309f Compare March 25, 2026 07:38
@jeremy jeremy merged commit a142e7e into main Mar 25, 2026
26 checks passed
@jeremy jeremy deleted the decorous-general branch March 25, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working commands CLI command implementations tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

campfire messages returns stale/old messages instead of latest

1 participant