Skip to content

feat(cli): chat and message history commands - #14

Closed
purpshell wants to merge 2 commits into
devfrom
codex/hms-history-api
Closed

purpshell wants to merge 2 commits into
devfrom
codex/hms-history-api

Conversation

@purpshell

@purpshell purpshell commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Depends on polymorfa/sdks#270 and polymorfa/polymorfa#202.

Review dependency: @polymorfa/sdk is pinned to the SDK PR head c07ff14aecf2f6954dc971275a6e34af41cc92ff. Move the pin to the merged dev commit after polymorfa/sdks#270 merges.

Commands (message history beta)

  • polymorfa chat list --session <s> [--kind] [--active-since] [--active-before] [--limit] [--cursor] [--max-items] [--json] (chats:read)
  • polymorfa chat get <conversation> --session <s> (chats:read)
  • polymorfa message list --session <s> --conversation <id|+E164> [--direction inbound|outbound] [--type text,image] [--since] [--until] [--order desc|asc] [--limit] [--cursor] [--max-items] [--json] (messages:read)
  • polymorfa message get <message> --session <s> --conversation <c> (messages:read)

Credential handling: server API keys only. Client tokens are rejected with exit code 2 before any request, the same as other server-only commands. --json returns data, page.{hasMore,nextCursor,previousCursor}, dataRegion and metadata. Cursors must be reused with the same filters: the API binds cursors to filters, so these commands deliberately do not apply the list-filter/cursor exclusion. API errors, including hms_not_enabled, use the existing error presenter. The README replaces the old "the API does not expose message history" statement with a history section.

Verification

npm run verify passes: format, lint, typecheck, tests (59 files / 446 tests, including the new test/commands/history.test.ts), build, npm pack --dry-run, and prod audit (0 vulnerabilities). The tests run against a local HTTP server; no live API call was made.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Pins @polymorfa/sdk to polymorfa/sdks#270 head c07ff14 (moves after merge).
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 74 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: b6880efc-69b1-4a9b-a2e8-227dd4aeb718

📥 Commits

Reviewing files that changed from the base of the PR and between 9713a8d and d14aa98.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • README.md
  • package.json
  • src/commands/chat/get.ts
  • src/commands/chat/list.ts
  • src/commands/message/get.ts
  • src/commands/message/list.ts
  • src/input/time.ts
  • src/services/history.ts
  • test/commands/history.test.ts

Comment @coderabbitai help to get the list of available commands.

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T11:53:53.262169Z d14aa98 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: a4b4863775

ℹ️ 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".

Comment thread src/services/history.ts Resolved
Comment thread src/commands/chat/list.ts Resolved
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: d14aa98882

ℹ️ 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".

@purpshell
purpshell marked this pull request as ready for review September 23, 2026 12:07
@purpshell

Copy link
Copy Markdown
Member Author

Superseded by the HMS history commands already on dev (merged in #29). This branch now conflicts with the SDK pin and Calls work on dev, changes the established JSON response shape and project-token access, and its --max-items truncation can leave hasMore true without a resume cursor. Keeping the shipped beta commands; any automatic paging improvement needs a separate scoped change that preserves cursors and the SDK contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant