Fix campfire messages returning stale messages#371
Conversation
There was a problem hiding this comment.
💡 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".
99caed7 to
79992d2
Compare
79992d2 to
05843bd
Compare
There was a problem hiding this comment.
💡 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".
d6a2cae to
6ea302a
Compare
05843bd to
c592c71
Compare
d2df13a to
6c0bca3
Compare
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).
c592c71 to
9e4309f
Compare
Summary
chat messagesreturned months-old messages for active campfires. The SDK'sListLineswith nil options fetches from page 1 (oldest), caps at 100, then the CLI reverse-sliced the last N of that stale batch.Sort: "created_at", Direction: "desc"toListLinesso the API returns newest messages first, let the SDK handle the limit, and reverse to chronological display order.Known debt: TUI paths (
hub_global.go:444,509,hub.go:729) also callListLines(..., nil)with incorrect "newest-first" comments. Out of scope — TUI is shelved.Fixes #284
Test plan
bin/cipasses (excluding pre-existingcheck-smoke-coveragefailure on main)basecamp chat messages --limit 3 --jsonreturns March 2026 messages in chronological order