Repository navigation
feat(app): flag to seal phone batch files at 15 s instead of 60 s - #26273
Merged
Merged
Conversation
The mobile Standard batch route seals a phone batch file two seconds after speech stops, or when the file reaches 60 seconds. During continuous speech the cap is what decides how long audio waits on the phone before upload. Add the PostHog flag `mobile-batch-file-cap-15s` (rollout, default off). When it is on the buffer seals at 15 seconds. Off, missing, a failed or a late read keeps 60 seconds. The flag is read once per app launch and never delays the lane. The retained-file limit scales with the cap so the buffer admits the same span of capture; the byte limit is unchanged. No frame is dropped or reordered and there is no server change. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…maller The flag key no longer carries the value. The debug override follows: OMI_MOBILE_BATCH_FILE_CAP_SMALLER. Behaviour is unchanged (15 s when on, 60 s otherwise). Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
What changed and why
Adds the PostHog flag
mobile-batch-file-cap-smaller(rollout, default off). When it is on, the mobile Standard batch route seals a phone batch file at 15 seconds instead of 60.A phone batch file is already sealed two seconds after speech stops; the 60-second cap only decides how long continuous speech waits on the phone before it can be uploaded. The goal is that more of a conversation is already transcribed when the user asks for a summary by hand.
MobileBatchFileCapGate(app/lib/services/experiments/mobile_batch_file_cap_gate.dart): fail-closed read, 2 s bound. Off, missing, a failed or a late read keeps 60 seconds.MobileBatchBuffer.maxFileSeconds: the seal check uses it instead of the literal 60. Values outside 1 to 60 are ignored.Expected effect, from a production sample of fresh phone-file batch units (2026-11-23)
This flag does not touch the largest wait on this path, which sits after transcription (the ordered-merge head wait). It is the small, cheap part of the latency.
Rollout
Internal devices, then 1%, 10%, 50%, 100%. Watch batch units per captured audio hour, database reads and writes per unit, the sync upload refusal share, the phone's stale-file reports (
Local WAL Stuck), and capture end to transcript written into the conversation. Rollback: set the flag to false; clients return to 60 seconds on their next launch. No PostHog row is created by this PR.Product invariants affected
Upheld: every frame is still written to the journal before routing, exactly as today; the cap only decides where one file ends and the next begins. When the buffer refuses a frame (file or byte limit, disk error) the caller keeps the ordinary live and WAL path, unchanged. The new test asserts that the four 15-second files together hold every frame in order.
How it was verified
flutter test test/services/wals/mobile_standard_batch_test.dart: 32 passed, including the four new tests.flutter test test/services/wals/batch_ring_proof_test.dart test/services/live_preview/local_preview_routing_test.dart test/unit/wal_upload_resilience_test.dart: 91 passed (the other users ofMobileBatchBuffer).flutter analyzeon the changed files: no issues.scripts/check_feature_flag_registry.py: OK.Not verified: a recording on a physical phone with the flag on. The PostHog row does not exist yet; a debug build can force the cap with
--dart-define=OMI_MOBILE_BATCH_FILE_CAP_SMALLER=true. The unit and cost figures above are estimates from current production unit lengths, not a measurement of the flag.Tests
In
app/test/services/wals/mobile_standard_batch_test.dart:The existing test "60 seconds of silence is still sealed and processed" covers the default.
UI evidence
UI-Evidence: none -- no UI change
Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code