Skip to content

test(mobile): fix dictation bridge-budget test failing on main under Bun - #36938

Merged
nwparker merged 1 commit into
mainfrom
nwparker/fix-dictation-budget-test
Nov 1, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/fix-dictation-budget-test

Conversation

@nwparker

@nwparker nwparker commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2
Prod 0 0 0 0

Main's Mobile verify / Mobile tests on main has failed since #36922. The cause is dictation-capture-bridge-budget.test.tsx > keeps the shipped drain within the request budget (expected 1 to be +0).

Cause: runDictation calls fillFreeDesktopSlots, which fills every desktop request slot, before capture.end(). #36922 reserved 4 slots for native verbs. Because of that, end()'s final native read now succeeds, and its desktop speech.dictation.chunk forward is refused at the 60-slot desktop cap. That refusal is counted as a dictation refusal. Under the Bun runtime the forward lands before teardown; under Node it doesn't, so it only shows in the Bun half of run-mobile-ci-tests.

Fix: count refusals made during the session, before the probe saturates the bridge. Production code is unchanged.

Verified: the test fails before and passes after with bun --bun vitest run --config config/mobile-ci.vitest.config.mjs. It also passes under Node.

…e bridge

The free-slot probe fills every desktop slot, so end()'s final chunk forward
is refused by construction. Since #36922 reserved native slots, that final
read now succeeds and its forward is refused, failing Mobile verify under Bun.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4fda13d-5d10-4498-a426-4aa2bea81f14
Commits

Reviewing files that changed from the base of the PR and between b4c93ba and 93c49e5.

Files selected for processing: 1
  • mobile/src/platform/dictation-capture-bridge-budget.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The test now snapshots refusals after the session and before fillFreeDesktopSlots and capture.end(). Its returned refusals count uses that snapshot, excluding refusals caused by the probe and final audio forward.

Merge Risk: Minimal · up to 93c49

The test now measures session refusals before intentional probe and teardown activity, with no merge-blocking risk identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the cause, the fix, and verification. It states the failing test, the root cause tied to #36922 slot reservation, the fix (count refusals before the probe saturates the bridge),… Rewrite the description to follow the repository template. Add an ELI5 section in plain language. Rename the body into 'What Changed' with the before and after behavior, and add a 'Why' section that explains why counting before the probe wa…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the test scope and the failure it fixes. The raw summary and objectives show the change limits the refusal count to refusals made during the session. The title says it fixes a failing …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test scope and the failure it fixes. The raw summary and objectives show the change limits the refusal count to refusals made during the session. The title says it fixes a failing test on main under Bun, which matches the changed test file. The title is specific and accurate, so it passes. It is 72 characters, which is slightly long but acceptable.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Full details: Description check

Explanation

The description covers the cause, the fix, and verification. It states the failing test, the root cause tied to #36922 slot reservation, the fix (count refusals before the probe saturates the bridge), and the test commands run. It does not follow the repository template. It has no ELI5 section, no 'What Changed' section in the template's form, no 'Why' section explaining alternatives, no 'Linked Issue' with a 'Fixes #' reference, no 'Visual Proof' statement (or N/A with reason), no checklist, and no AI Disclosure or Agent skill upstream boundary entries. The Testing section lists verification commands but leaves the manual testing and automated tests checkboxes unmarked. The description is substantive but largely departs from the required structure.

Resolution

Rewrite the description to follow the repository template. Add an ELI5 section in plain language. Rename the body into 'What Changed' with the before and after behavior, and add a 'Why' section that explains why counting before the probe was chosen over the alternatives. Add a 'Linked Issue' section. Link the issue with 'Fixes #<number>' or state that the failure is tracked by an existing issue. Add a 'Visual Proof' section that states N/A and gives the reason, since this is a test-only change. Complete the 'Testing' section with the platforms tested and mark the checkboxes that apply. Complete the 'AI Disclosure' section or leave it empty if the author is a StablyAI team member. Complete the 'Agent skill upstream boundary' checkbox. Complete the checklist items.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nwparker
nwparker merged commit c433d58 into main Nov 1, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant