Repository navigation
fix(backend): align types with tested runtime hardening to unblock pyright gate - #23526
Git-on-my-level wants to merge 2 commits into
Conversation
…right gate #23433/#23434 hardened retrieval and wrapped paths with runtime checks their annotations prove unnecessary, turning the repo-wide pyright gate (pinned 1.1.403) red for every backend push. Widen the annotations to the tested runtime contract (Optional inputs), fold redundant guards, and read legacy segment ends through an explicit Optional tract. No behavior changes.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Carry the reviewed main-integration prerequisite from bfd7dfe. Main's defensive retrieval and wrapped guards currently contradict their annotations and fail the mandatory whole-backend pyright gate. Preserve runtime behavior and all guards while aligning their declared types; episode behavior and quiet replay/arming remain unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
) * fix(backend): keep unplaced episode speech and quiet recovery progressing Failure-Class: FC-high-water-cursor-skips-unready-row Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(backend): carry runtime typing alignment from #23526 Carry the reviewed main-integration prerequisite from bfd7dfe. Main's defensive retrieval and wrapped guards currently contradict their annotations and fail the mandatory whole-backend pyright gate. Preserve runtime behavior and all guards while aligning their declared types; episode behavior and quiet replay/arming remain unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(backend): carry remaining main CI prerequisites Carry fallback module registration from 8037f2f so the real isolated retrieval suites can import dataclasses correctly. Preserve the existing test isolation and assertions. Carry the three payment CPU classifications from 39133dc; upstream CI run 40116299270 independently measured 1.37-1.73s for these subscription/Stripe cases. No global timing limit or test execution is disabled. These inherited main failures otherwise prevent exact-head CI from turning green. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Superseded: main received an equivalent typecheck alignment overnight (folded into #23418/#23512) — |
|
Hey @Git-on-my-level 👋 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! |
Summary
Main's backend pyright gate (repo-wide, pinned 1.1.403) went red when #23433 and #23434 landed: 5
reportUnnecessary*errors where deliberate, test-covered runtime hardening contradicts narrower annotations. This aligns the annotations with the tested runtime contract so every backend push can pass the gate again. No behavior changes.utils/retrieval/tools/omi_tools.py: drop the redundantisinstance(query, str)clause inget_omi_product_info_tool—queryisOptional[str], theisinstanceguard subsumes the None case, and every input class returns the same error string as before.utils/retrieval/tools/result_bounds.py: declare what the tests assert —cap_items_for_llm(items: List[T] | None, ...)andbounded_result(result: str | None, ...)— and fold the None/non-str normalization into a singleisinstanceguard with identical behavior. The truncation suffix switches+=to a plain f-string assignment: the file's fallbackimportlibimport leavestruncation_noteuntyped, and an augmented assignment then widens the variable back to its declared Optional type at the return (latent on main, exposed by the widened annotation).utils/wrapped/generate_2025.py:_compute_conversation_durationreads segment ends through an explicitOptionaltract — legacy/unvalidated conversation data can carry missing end timestamps, covered bytest_compute_conversation_duration_ignores_none_segment_end.No skip hatches: no ignore comments, no config changes. Every comparison pyright proved unnecessary is now provably necessary or gone.
Failure-Class
Failure-Class: none
Testing
pyright -p pyrightconfig.json(pinned 1.1.403): 0 errors repo-wide; origin/main reports 5 errors.tests/unit/test_retrieval_result_bounds.py,test_omi_tools_resilience.py,test_goals_wrapped_firmware_hardening.py,test_action_item_tool_result_bound.py,test_conversation_tool_date_range_bound.py— 41 passed.