omi icon indicating copy to clipboard operation
omi copied to clipboard

CLI action-item get stops early when the API filters locked records from a page

Open PlayerBC opened this issue 2 months ago • 1 comments

omi action-item get <id> can report an accessible item as missing before reaching the 1,000-item limit. The developer API paginates database records and then removes locked records, while the CLI interprets a short or empty response as exhaustion.

Reproduction with 201 ordered records (IDs a0–a200):

  • Lock one of the first 200 records. GET /v1/dev/user/action-items?limit=200&offset=0 returns 199 items; offset=200 returns accessible a200.
  • Run the CLI lookup for a200. It stops after offset=0 and raises NotFoundError.
  • Lock all first 200 records: the empty first response produces the same failure. With no locked records, the lookup reaches offset=200 and succeeds.

I reproduced these cases using the unchanged function bodies extracted from backend/routers/developer.py (blob 6bfe6c65ff0c738c3a95e6008c800729cde5c497) and sdks/python-cli/omi_cli/commands/action_item.py (blob 5b62a7081a220061dcd0a3d766481d0dc6403dee), with an in-memory database/client and valid-record validation stub. Three reproduction/control tests passed; these confirm the existing defect, not a fix. I have not run Firestore/HTTP integration, the full application suite, or repo preflight.

This differs from #12951: it happens at offset 200, and PR #12957 retains both short/empty-page stopping conditions. Expected: later accessible records remain discoverable without exposing locked records. A safe correction needs a pagination/lookup contract that distinguishes filtered pages from exhaustion; simply removing the short-page break does not resolve fully locked pages.

@josancamon19 Would you consider a US$10 bounty for a focused correction and repository regression tests, subject to agreeing the intended API/CLI contract first? This is a proposed reward, not an existing funded bounty. No PR or completed fix is claimed.

PlayerBC avatar Sep 08 '26 21:09 PlayerBC

Opened PR #13520. action-item get continues after short pages (locked-record filtering) until an empty page.

Nukeys avatar Sep 11 '26 19:09 Nukeys