From 91d9becdbe336110ec1934b77c9ded3019df2684 Mon Sep 17 00:00:00 2001 From: Malo Bourgon Date: Mon, 8 Jun 2026 15:13:23 -0700 Subject: [PATCH] Fix chats archive/unarchive hitting the wrong endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `chats archive` and `chats unarchive` called the generic chat-update endpoint (PATCH /v1/chats/{chatID} with { isArchived }), which returns 200 OK but silently ignores isArchived — so the command reported success while the chat's archive state never changed. Switch both commands to the dedicated archiveChat endpoint (POST /v1/chats/{chatID}/archive with { archived }) via the SDK's client.chats.archive(chatID, { archived }), so the state actually changes. Co-Authored-By: Claude Opus 4.8 (1M context) --- .changeset/fix-chats-archive-endpoint.md | 12 ++++++++++++ packages/cli/src/commands/chats/archive.ts | 3 ++- packages/cli/src/commands/chats/unarchive.ts | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/fix-chats-archive-endpoint.md diff --git a/.changeset/fix-chats-archive-endpoint.md b/.changeset/fix-chats-archive-endpoint.md new file mode 100644 index 00000000..a0239834 --- /dev/null +++ b/.changeset/fix-chats-archive-endpoint.md @@ -0,0 +1,12 @@ +--- +'@beeper/cli': patch +--- + +Fix `chats archive` and `chats unarchive` silently no-op'ing. + +Both commands called the generic chat-update endpoint (`PATCH /v1/chats/{chatID}` +with `{ isArchived }`), which returns `200 OK` but ignores `isArchived` — so the +command reported success while the chat was never archived or unarchived. They now +call the dedicated archive endpoint (`archiveChat`: `POST /v1/chats/{chatID}/archive` +with `{ archived }`) via `client.chats.archive(chatID, { archived })`, so the chat's +archive state actually changes. diff --git a/packages/cli/src/commands/chats/archive.ts b/packages/cli/src/commands/chats/archive.ts index 17b27e61..408eb4d3 100644 --- a/packages/cli/src/commands/chats/archive.ts +++ b/packages/cli/src/commands/chats/archive.ts @@ -14,6 +14,7 @@ export default class ChatsArchive extends BeeperCommand { const client = await createClient(flags) const chatID = await resolveChatID(client, flags.chat, { pick: flags.pick }) - await printData(await client.chats.update(chatID, { isArchived: true }), flags.json ? 'json' : 'human') + await client.chats.archive(chatID, { archived: true }) + await printSuccess({ message: 'Chat archived', data: { chatID, archived: true } }, flags.json ? 'json' : 'human') } } diff --git a/packages/cli/src/commands/chats/unarchive.ts b/packages/cli/src/commands/chats/unarchive.ts index 0da9088a..28a5527e 100644 --- a/packages/cli/src/commands/chats/unarchive.ts +++ b/packages/cli/src/commands/chats/unarchive.ts @@ -14,6 +14,7 @@ export default class ChatsUnarchive extends BeeperCommand { const client = await createClient(flags) const chatID = await resolveChatID(client, flags.chat, { pick: flags.pick }) - await printData(await client.chats.update(chatID, { isArchived: false }), flags.json ? 'json' : 'human') + await client.chats.archive(chatID, { archived: false }) + await printSuccess({ message: 'Chat unarchived', data: { chatID, archived: false } }, flags.json ? 'json' : 'human') } }