Skip to content

feat(sdks/python-cli): add daily-summary list and get commands - #13354

Open
CreamPle wants to merge 2 commits into
BasedHardware:mainfrom
CreamPle:feat/daily-summary-cli
Open

feat(sdks/python-cli): add daily-summary list and get commands#13354
CreamPle wants to merge 2 commits into
BasedHardware:mainfrom
CreamPle:feat/daily-summary-cli

Conversation

@CreamPle

@CreamPle CreamPle commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements omi daily-summary list and omi daily-summary get <id> commands in omi-cli, exposing the stored daily recap endpoints from the Developer API (GET /v1/dev/user/daily-summaries and GET /v1/dev/user/daily-summaries/{summary_id}).

  • omi daily-summary list:
    • Supports --limit (1–100, default 30) and --offset (≥0, default 0) pagination.
    • Supports --start-date and --end-date filters validated as YYYY-MM-DD calendar dates before dispatching HTTP.
    • Formats tabular output with ID, date, day emoji, headline/overview, and created timestamp.
    • In --json mode, preserves the API's native {"summaries": [...]} envelope shape for scripting and agent consumption.
  • omi daily-summary get <id>:
    • Fetches the full structured recap object including day stats, highlights, action items, and knowledge nuggets.
    • Translates 404 responses to clean CLI not-found errors (exit_code = 5).

Resolves #13139

Changes

  • sdks/python-cli/omi_cli/commands/daily_summary.py: Subcommand module implementing list and get.
  • sdks/python-cli/omi_cli/main.py: Register daily-summary command group on the root Typer app.
  • sdks/python-cli/README.md: Document daily-summary commands in resource overview and command tree.
  • sdks/python-cli/tests/test_daily_summary.py: Full test suite covering tabular rendering, JSON shape retention, pagination/date parameters, date validation, and not-found error handling.

Verification

  • Unit tests in sdks/python-cli/tests/test_daily_summary.py pass (8/8).
  • Linter checks verified clean with ruff check.
  • Verified diff hygiene with git diff --check HEAD (clean).

Failure-Class: none

Review in cubic

Expose stored daily recaps via `omi daily-summary list` and `omi daily-summary get <id>`, supporting pagination, date boundaries, and preserving {"summaries": [...]} payload shape.

Resolves BasedHardware#13139

Co-authored-by: Kgruben0133 <326547184+Kgruben0133@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread sdks/python-cli/tests/test_daily_summary.py Outdated
Comment thread sdks/python-cli/README.md
Comment thread sdks/python-cli/tests/test_daily_summary.py Outdated
Comment thread sdks/python-cli/omi_cli/commands/daily_summary.py Outdated
…ntation (BasedHardware#13139)

- Wrap typer.Option declarations in commands/daily_summary.py to satisfy line length limit

- Read CliError assertions from result.stderr instead of result.output

- Verify full recap contract including highlights, action items, nuggets, and stats

- Update primary nouns count in README.md from four to five

Failure-Class: none

Co-authored-by: Kgruben0133 <198305047+Kgruben0133@users.noreply.github.com>
@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Thanks @CreamPle — this implements the CLI surface proposed in #13139 cleanly and follows the existing command-module conventions (goal/conversation) closely. Verified the wire contract against the current backend routes.

sdks/python-cli/omi_cli/commands/daily_summary.py

  • _validate_date runs before any HTTP dispatch, so malformed or impossible dates (2026-02-30) fail fast with a structured UsageError (exit 1) instead of burning a server round-trip — nicely stricter than the backend's shape-only regex, which is the right side for the stricter check to live on.
  • Pagination bounds (--limit 1–100 default 30, --offset ≥ 0) mirror backend/routers/developer.py exactly (Query(30, ge=1, le=100), Query(0, ge=0)), and the JSON path emits the raw payload so the {"summaries": [...]} envelope survives for scripting/agents.
  • The table path's defensive data.get("summaries", []) if isinstance(data, dict) else (data or []) plus the headlineoverview fallback keeps rows meaningful on partial data.
  • get leaning on the shared client's 404 → not-found mapping (exit 5) matches goal get / conversation get.

sdks/python-cli/omi_cli/main.py

  • Minimal, correctly placed registration; the help string matches sibling command groups.

sdks/python-cli/README.md

  • The four→five "primary nouns" fix plus the new bullet and command-tree lines keep the README internally consistent with the registry.

sdks/python-cli/tests/test_daily_summary.py

  • Good coverage matrix: table rendering, JSON envelope + actual request-param passthrough (limit/offset/start_date/end_date asserted on the wire), both date-validation failure modes, JSON-mode error envelope through the real main() path, and 404 → exit 5 in both pretty and JSON modes. All 8 pass in CI on this head.
  • One minor, non-blocking note: the fixtures render highlights / action_items / knowledge_nuggets as plain strings/dicts while the live API returns structured objects (DailySummaryTopicHighlight, DailySummaryKnowledgeNugget, …). Since get passes the payload through untouched it changes nothing today — just worth matching the real shapes if a future command ever formats those fields.

On the red matrix jobs (Windows ACL / Python 3.12, Linux / Python 3.12, Linux / Python 3.10): all three fail solely on tests/test_auth_api_key.py::test_transport_failure_during_login_leaves_saved_config_unchanged, which this PR doesn't touch and which fails identically on the latest main runs — pre-existing and unrelated, but it will need to clear before merge.

Leaving for human maintainer review and merge: new user-facing command group from a first-time contributor, with required checks red (for the pre-existing reason above), so the final merge call stays with a maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution python labels Sep 9, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feature (new daily-summary list/get commands), not a bug fix -> approve-only per policy. Well-tested, exposes existing Developer API endpoints.

@Git-on-my-level

Copy link
Copy Markdown
Collaborator

Follow-up on the red required checks from my earlier review: the only failing test (tests/test_auth_api_key.py::test_transport_failure_during_login_leaves_saved_config_unchanged) was fixed on main by #13436, so this branch's red matrix jobs (Windows ACL / Python 3.12, Linux / Python 3.12) are purely stale-base fallout. Updating the branch (or rebasing) should turn them green with no code changes here.

With the maintainer approval already on this head, that branch update is the only remaining step before merge. Thanks @CreamPle!


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

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

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI feature proposal: read stored daily summaries

3 participants