Repository navigation
fix(desktop): enrich from-segments uploads instead of deferring them as CAPTURE_END - #19788
Conversation
|
Bounty proposal with the full analysis + evidence: #19783 ($50 proposed). |
|
Verified against the tree at the head commit — the root-cause analysis in the description holds up everywhere I checked.
The product note in the description (from-segments now spends at upload for desktop_free users, matching Thanks for the exceptionally well-documented root-cause work — the bystander eliminations from #19783 made review straightforward. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Verified against the code at the current head — the root-cause analysis holds and the fix is consistent with the sibling finalize paths. File by file:
I also verified the claim that this does not bypass the free-tier policy gate: One nuance worth knowing (no change requested): with The remaining open point is the product question raised in the description: on the legacy flag-off path, freemium desktop from-segments uploads now spend enrichment at upload rather than deferring to first-open. That consistency call is the one thing needing a maintainer decision before merge. Feedback is automated and sent on the maintainers' behalf; a human maintainer should confirm the freemium spend-timing decision above. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
aryanorastar
left a comment
There was a problem hiding this comment.
9128caf45663 — backend/routers/developer.py still calls process_conversation from the segments path with no trigger, so a finished upload takes the CAPTURE_END deferral. This head sets CLIENT_FINALIZE. The test asserts that trigger. 17 checks passed, none failing.
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]>
) * fix(backend): restore pyright-clean main after #22207 and #22326 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]> * test(backend): repair unit tests that drifted from main across merges 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]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
What
Fixes #19705. macOS desktop
local_segmentsrecordings upload and landcompletedbut get no summary, no action items, no events, empty overview, categoryother— the reported fingerprint.Root cause
POST /v1/conversations/from-segments→_create_conversation_from_segments(routers/developer.py) calledprocess_conversation(...)with notrigger, so it ran asProcessingTrigger.CAPTURE_END(run_now=False). That let the legacy desktop capture-time deferral fire (utils/conversations/process_conversation.py:2834-2850): forsource=desktop+should_defer_desktop_processing(uid)it stored_build_deferred_structured— title = first 8 transcript words, empty overview,category=other, no action items/events — and returned before_get_structuredand speaker resolution.Device sessions are exempt by
source; desktopcloud_reconcileis exempt because/finalizeand/v1/conversationspassCLIENT_FINALIZE(run_now=True).from-segmentswas the only desktop finalize entering withrun_now=False— hence only these rows are empty. (language=multi, segment size, and thecrash_recovery/recording_disabledreasons are bystanders; ruled out with evidence in #19783.)Fix
Pass
trigger=ProcessingTrigger.CLIENT_FINALIZEat the from-segments call sites, matching the sibling/finalizepath. The client already uploaded an already-final transcript, so it should not be treated as an open capture. This does not bypass the free-tier policy gate (process_conversation.py:2760-2821, which deliberately ignores force/reprocess and remains the deny path whenFREE_TIER_LOCAL_PROCESSINGis on), and does not change relevance (_ASSESS) or JIT-first-open.Product note (please confirm)
from-segmentsnow spends at upload fordesktop_freeusers, exactly like the desktopcloud_reconcile/finalizepath already does — this makes the two desktop finalize paths consistent. If the intended freemium behaviour is that from-segments uploads also stay deferred, this is a product change, not a bug fix — instruct and I'll switch to the alternative (exempt explicit client uploads inside the gate) or withdraw.Coordination
_create_conversation_from_segmentsis also touched by the open (stalled,dirty) PR #10796. Happy to rebase onto it or coordinate if it revives.Tests
test_from_segments_runs_as_client_finalize_not_capture_end— asserts the call-site trigger.test_free_tier_entrypoint_matrix.py— the from-segments entry now recordstrigger=CLIENT_FINALIZE, plus a new desktop entry so the previously-untested desktop upload cell is covered (oldCAPTURE_END→legacy_deferplaceholder; fixed → same behaviour as/finalize).Verification
test_developer_from_segments_idempotency.py(112) +test_free_tier_entrypoint_matrix.py(118) pass locally: 230/230.Failure-Class: none
Line-Count-Exception: backend/routers/developer.py | 2636 -> 2642 | pass ProcessingTrigger.CLIENT_FINALIZE at the from-segments call sites (+import +comment) so a client-uploaded final transcript is enriched instead of deferred