Repository navigation
fix(backend): restore pyright-clean main after #22207 and #22326 - #22539
Merged
Merged
Conversation
Main's backend unit shards fail the enforced pyright lane: - database/desktop_previews.py (#22207): 16 reportUnnecessaryIsInstance errors. The runtime guards stay; they move into validators that take `object` (_payload, _string, _expected_generation, _datetime), so the checks are meaningful to pyright. Public signatures, error messages and check order are unchanged. - utils/sync/pipeline.py:process_segment (#22326 on top of #22452): "code is too complex to analyze". Behaviour-neutral split: the two identical cap-hold defer blocks become one hold_for_cap closure, and the final-pass / speaker-identification block moves to _assign_segment_speakers with the same exception handling. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Five unit files fail on current main. Each one passed on its own PR's base and broke when main moved underneath it; none is a product regression. - test_request_context.py (#19738): tested the JIT budget surface that #22209 removed from llm_gateway/gateway/request_context.py. Keep the request-id tests; drop the tests for removed code. - test_users_joan_followup_tombstone_guard.py (#19867): called delete_person_endpoint, but the joan followup route is delete_followup_question_endpoint. - test_developer_from_segments_idempotency.py (#21265): process fakes rejected the trigger=CLIENT_FINALIZE kwarg the router passes since #19788. - test_external_tools_sanitization.py (#19406): the stubbed utils package lacked utils.generated_compute (#21488) and utils.model_text. Stub the default-off gate as disabled and load the stdlib-only model_text for real. - test_batch_upload_storage.py: the database.vector_db stub lacked delete_action_item_vectors_batch, which merge_conversations imports since #15953. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
aryanorastar
added a commit
that referenced
this pull request
Oct 20, 2026
Main's #22539 restored type checking by keeping process_segment whole with an analyzer-ceiling ignore instead of extracting _record_sync_segment_exception, so the boundary note this PR added no longer describes the code. The regression tests stay; they exercise behavior and pass against main's implementation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
aryanorastar
added a commit
that referenced
this pull request
Oct 21, 2026
…gment outcomes (#22558) ## Summary Regression tests for desktop-preview validation and sync segment outcomes. This PR originally restored type checking in `backend/database/desktop_previews.py` and `backend/utils/sync/pipeline.py`. Main's #22539 has since fixed the same problem in both files, so the production changes were dropped in favor of main's code. What remains is test coverage that passes against main's implementation: - `test_database_desktop_previews_resilience.py`: untrusted preview metadata (non-dict payloads, wrong types, bad generations) is rejected by the validators rather than crashing. - `test_sync_capture_pipeline.py`: segment assignment outcomes through `process_segment`. ## Verification - Both files pass on the merged tree against main's code (82 passed), each run in its own pytest process. - No production code, flag, deployment or data change. Failure-Class: none ## Product invariants affected none 🤖 Generated with [Claude Code](https://claude.com/claude-code)
aryanorastar
added a commit
that referenced
this pull request
Oct 21, 2026
…tate (#22595) ## Summary Makes three backend test files independent of deployment state and the fast-unit CPU budget. Main's backend CI is green, and most of the drift this PR first repaired has since been fixed on main (#22494, #22539); those edits were dropped in favor of main. What remains: - `test_developer_from_segments_idempotency.py`: a `segment_api_client` fixture builds the FastAPI router and auth overrides once, outside the request being measured, so router setup no longer counts against the fast-unit CPU guard. - `test_modulate_stt.py`: the "Deepgram disabled" cases patch `PROVIDER_SERVING_SURFACES` explicitly instead of relying on whichever providers the current policy happens to disable. They are renamed from "retired" to "disabled" to say what they test. - `test_streaming_deepgram_backoff.py`: adds coverage that a configured cloud Deepgram serves the available streaming languages, alongside the existing refusal cases. ## Verification - All three files pass on the merged tree (66 + 104 + 86 passed), each in its own pytest process. - Test-only; no production code, flag, deployment or data change. Failure-Class: none ## Product invariants affected none 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix-forward for red
main. #22207 merged as 6881acc with Backend unit shards 1–6 failing; every shard failed the enforced pyright lane with the same 16 errors (unit tests themselves passed). #22326, which landed on top of #22452, then pushedprocess_segmentpast pyright's complexity limit.backend/database/desktop_previews.py(Supersedes #20087: fix(database): validate inputs and normalize timestamps in desktop previews #22207): 16reportUnnecessaryIsInstanceerrors. The runtime guards stay. They move into validators that takeobject(_payload,_string,_expected_generation,_datetime), so pyright sees them as meaningful checks. Public signatures, error messages, check order and the pointer-identity no-op (pointer is current) are unchanged.backend/utils/sync/pipeline.py:process_segment(fix(sync): keep synced transcript times on the VAD file clock #22326 / fix(sync): bound historical backfill inputs and defer over-limit legacy work #22452): "Code is too complex to analyze". A behaviour-neutral split: the two identical cap-holddefer_segmentblocks become onehold_for_capclosure, and the final-pass / speaker-identification try block moves to_assign_segment_speakers. That helper keeps the same exception handling and returns the same post-exception state. Theaudio_bytesrelease stays in the caller'sfinally.No skips, no
# type: ignore, no config changes.After the first push, this PR's own shards 1/3/4/6 also failed on five test files that are red on current main for reasons unrelated to #22207. Each passed on its own PR's base and broke when main moved underneath it. All five fixes are test-only:
tests/unit/llm_gateway/gateway/test_request_context.py(🧪 add tests for request_context.py #19738) tested the JIT budget surface that Jev rulings 10-18: kill owner flip/shadows/rescue/call-link/episode selector, graduate smart merge + wall-clock gap #22209 removed. The request-id tests are kept; the tests for removed code are dropped.tests/unit/test_users_joan_followup_tombstone_guard.py(fix(users): enforce access validation in joan followup question endpoint to prevent tombstone bypass #19867) calleddelete_person_endpoint; the joan followup route isdelete_followup_question_endpoint.tests/unit/test_developer_from_segments_idempotency.py(feat(dev-api): accept folder_id and calendar meeting context in from-segments #21265): itsprocessfakes rejected thetrigger=CLIENT_FINALIZEkwarg the router has passed since fix(desktop): enrich from-segments uploads instead of deferring them as CAPTURE_END #19788.tests/unit/test_external_tools_sanitization.py(fix(retrieval-tools): sanitize unexpected exceptions in external and app tools #19406): its stubbedutilspackage lackedutils.generated_compute(feat: ladder v1 plans and funded processing cap (default off) #21488) andutils.model_text. The default-off gate is now stubbed as disabled, and the stdlib-onlymodel_textis loaded for real.tests/unit/test_batch_upload_storage.py: thedatabase.vector_dbstub lackeddelete_action_item_vectors_batch, whichmerge_conversationshas imported since fix(backend): drop a merge source's task search vectors when the merge removes them #15953.Branch
lane/main-red-22207intomain.Lane / contract
Lane main-red (two-lane lead fix-forward), contract: CI-green main; owner sign-offs for edits to other lanes' files: none
Product invariants affected
none
Verification
-p pyrightconfig.json, repo venv) on both touched files: 17 errors → 0 errors.backend/tests/unitthat referenceprocess_segment,utils.sync.pipelineordesktop_previewspass (includestest_desktop_previews.py,test_database_desktop_previews_resilience.py,test_sync_v2.py,test_sync_cap_hold_recovery.py,test_sync_cloud_tasks.py).Rollback
Revert the commits. Main returns to its pyright-red and test-red state; runtime behaviour is identical either way, because the second commit is test-only.
Failure-Class: none
Line-Count-Exception: backend/utils/sync/pipeline.py | 3566 -> 3580 | lane main-red: growth reviewed; extracting _assign_segment_speakers to clear pyright's complexity limit adds a signature (+14 net after deduplicating the cap-hold block)
🤖 Generated with Claude Code