Repository navigation
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Git-on-my-level
left a comment
There was a problem hiding this comment.
Thanks for this — the structure is genuinely good: a guarded Invoke-OmiJson helper, no embedded credentials, auth documented separately, and offline tests are exactly the right instincts for an examples file. I'm requesting changes for one blocking issue that I verified by running the CLI built from this branch, plus a few smaller hardening items.
Blocking: every example passes --json after the verb, which the CLI rejects
--json is a root-level option (omi_cli/main.py, the _root callback: json_output: bool = typer.Option(False, "--json", ...)), not a subcommand option. Verified against the actual CLI from this branch:
$ omi memory list --json --limit 10
Usage: omi memory list [OPTIONS]
Error: No such option '--json'.
$ omi --json memory list --limit 10
{"error": "Not authenticated", ...} # parsed/handled correctly
Every executed call in shell_examples.ps1 uses the broken position: line 73 ($memories = Invoke-OmiJson @('memory', 'list', '--json', '--limit', '10')), the conversations block (lines 89–93), action items (line 106), goals (line 117), and the error-handling demo (line 133). Because Invoke-OmiJson checks $LASTEXITCODE before parsing (line 38), every example will throw with a usage error on a real machine — after successful auth, too. The fix is mechanical: move '--json' to the front of each args array, e.g. Invoke-OmiJson @('--json', 'memory', 'list', '--limit', '10'). The offline tests stub omi, which is why CI passes; if you want a regression net, one test invoking the real omi binary unauthenticated distinguishes the two positions (omi memory list --json fails to parse; omi --json memory list emits the auth JSON) without any network.
For completeness: the existing shell_examples.sh line 26 has the same latent issue (omi memory list --json --limit 50 | jq ...) — not something you introduced, but worth a follow-up issue since the README calls these runnable.
Smaller items (same files):
shell_examples.ps1:99—$_.structured.titleunderSet-StrictMode -Version 2.0throws for any conversation without astructuredobject and, with$ErrorActionPreference = 'Stop', aborts the whole listing mid-stream. The CLI itself is null-safe here (omi_cli/commands/conversation.py:structured = c.get("structured") or {}). Guard it, e.g.if ($_.structured) { $_.structured.title }.test_shell_examples_ps1.py:62–67— the read-only guard (\bomi\b.*\b(create|update|delete|progress|complete|from-segments|logout)\b) can never match an executed line: every invocation routes throughInvoke-OmiJsonargument arrays whereominever appears as a standalone word, and the helper's own& omi @OmiArgsline (line 38) contains none of the mutating verbs. A future mutating example likeInvoke-OmiJson @('memory','create','x')would pass this test. Consider matching the verb token inside the arrays instead.test_shell_examples_ps1.py:18–21— the module-levelpytestmark = skipif(no powershell)also skips the pure-text checks (read-only guard, credentials scan, README link) on Linux CI, where they would actually run. Applying the skip only to the parser/execution tests keeps the structural guarantees tested everywhere.
Once the --json position is fixed this is a welcome addition — the PowerShell-native JSON handling and read-only framing fit the examples directory well.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
All points addressed and pushed (9464f35):
Full suite green on Windows with the real CLI on PATH: |
kodjima33
left a comment
There was a problem hiding this comment.
New example script (feature, not a bug fix) -- stays approve-only per policy regardless of quality. Independently verified the blocking --json-position issue raised in review was real (confirmed --json is a root-level typer option in omi_cli/main.py) and has since been fixed in the latest commit with a regression test added.
d6fccaf to
efeb443
Compare
efeb443 to
437d902
Compare
Dismissing as resolved: the blocking --json-after-verb issue and the three smaller items from this review are fixed and verified on the current head (437d902) — all Invoke-OmiJson calls now pass --json before the verb (root-level option in omi_cli/main.py), the structured guard is in place, the read-only test guard matches argument arrays, and skipif is scoped to PowerShell-only tests. Confirmed the rebase kept the script and tests byte-identical to the commit kodjima33 signed off on.
|
Follow-up verification on the current head (437d902) after the rebase:
Thanks for the thorough response to the earlier review — the offline-stub test design plus the real-binary regression net is exactly the right combination for an examples file. The earlier automated change request is dismissed as resolved. by AI on behalf of David |
kodjima33
left a comment
There was a problem hiding this comment.
docs: PowerShell example script verified — every flag/command shape (memory list, conversation list, action-item list, goal list) exists in current omi_cli source, script is read-only (no mutating verbs reach the CLI, no Invoke-Expression, no embedded credentials), tests cover parse/read-only/error-handling. Merging.
kodjima33
left a comment
There was a problem hiding this comment.
Read-only PowerShell examples, offline-tested, commands verified against current CLI source; docs-correctness gate passes
|
Keeping this open on DIRTY 0-checks PowerShell shell_examples.ps1 + tests; unique file, rebase/CI needed. GitHub reports CONFLICTING/DIRTY against current main — rebase before any merge path. kodjima APPROVE is the size gate, not maintainer merge. I am not approving or merging this SHA. |
|
Keeping this open. Not approving — Astar, on behalf of @aryanorastar |
|
This looks like a class of change we currently aren't taking, based on maintainer pattern rulings. That's not a judgment on the work itself — if you think this one is different, comment and it goes straight to a maintainer. Thanks for contributing! |
|
Hey @amasen02 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
What changed and why
Adds
sdks/python-cli/examples/shell_examples.ps1— a Windows PowerShellcounterpart to
shell_examples.sh— plus one index link inexamples/README.mdand offline tests for the script. Proposed in #13513(read-only PowerShell examples, US$25 after acceptance and merge).
Scope is exactly as proposed: the script covers memories, conversations,
action items and goals with selectable read-only examples; parses with native
ConvertFrom-Json/Select-Object(no jq or Bash); documents auth separatelywith no credentials in source; and performs no login or mutation merely by
running.
Product invariants affected
none
How it was verified
(
--json,--limit,--start-date,--open,--days) and every commandshape (
memory list,conversation list,action-item list,goal list,goal history) exists inomi_cli/commands/*on the current tree.errors) — the shell most Windows users run by default.
omicommand (no network, no liveaccount): nonzero exit throws with the CLI's message attached, malformed
JSON throws instead of flowing into
ConvertFrom-Json, valid JSON parses,empty output yields
$null.verification used stubs.
Tests
tests/test_shell_examples_ps1.py(new, 7 tests; auto-skipped on platformswithout PowerShell, e.g. the CI Linux matrix):
test_script_exists,test_script_parses_cleanly— real PowerShell parserrun over the file.
test_script_is_read_only— no mutating verb in any non-comment line.test_script_has_no_embedded_credentials— no hardcoded keys.test_every_omi_call_checks_exit_code— directomiinvocations are onlyallowed inside the guarded helper.
test_helper_throws_on_nonzero_exit_and_malformed_json— the four helperoutcomes (throw/throw/parse/null) against a stubbed
omi.test_readme_links_the_script— index link present.Error paths covered: nonzero exit and malformed JSON inside the helper test;
the full suite is green locally (402 passed, including these 7).
Failure class (fixes)
Failure-Class: none