Skip to content

feat(meetings): capture system audio in Electron - #7196

Open
kaizawa97 wants to merge 2 commits into
kirodotdev:mainfrom
kaizawa97:pr/meetings-electron-system-audio
Open

kaizawa97 wants to merge 2 commits into
kirodotdev:mainfrom
kaizawa97:pr/meetings-electron-system-audio

Conversation

@kaizawa97

@kaizawa97 kaizawa97 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #5738 (pr/meetings-recording-core). This branch is #5738's head 7ca088ae2e plus one commit, feat(meetings): capture system audio in Electron; only that commit is for review here. It becomes the whole diff once #5738 merges.

Problem / Motivation

Goal: In the desktop app, a meeting recording captures the other participants' audio wherever Electron can provide it, and tells the user up front where it cannot.

In a browser tab, system audio (the remote side of a Zoom/Chime call) is only reachable through a display-capture prompt, and on some platforms not at all. So in the desktop app — the place most likely to be running next to a call — a meeting records only what the microphone picks up.

Why it matters

The desktop app is the surface most likely to be running beside a call, and today it records only the local microphone there: a transcript with half the conversation missing, and no hint that the other half was never captured.

Not a goal

  • Loopback audio on macOS or Linux, which Electron does not provide.
  • Changing the browser (non-Electron) capture path.
  • Replacing Electron's native macOS picker.

What changed (motivation → approach → change)

The desktop app now picks the best way to get the call's audio for the machine it runs on, and says so before recording starts.

Platform Tier What the user gets
Windows loopback System audio is granted directly by the display-media handler; no picker.
macOS 15+ system-picker Electron's native picker; audio arrives when the user shares a surface with audio.
macOS 14 and older, Linux video-only No capture prompt; a notice that only the microphone is recorded.

website/electron/display-media.js computes the tier (the macOS version comes from the Darwin release, 24 = macOS 15) and grants loopback audio only when the request asked for audio and the platform can provide it, behind the existing capture identity gate. window-lifecycle.js passes the tier to the renderer and preload.js exposes it; runtime/window/session-security.js enables the native picker only where it exists. In the renderer, audio/captureTier.ts checks the track it actually received, so a platform that cannot provide system audio degrades to microphone-only instead of recording silence. systemAudio.ts gains a no-loopback failure, useMeetingSession.ts maps it to one new string in every catalog under website/src/i18n/locales/ (for example locales/en.json), and docs/system-specs/modules/meetings.md describes the tiers.

Backwards compatibility

Compatible: the screen-snip tool keeps its video-only grants (audio is gated on audioRequested), and the browser path is unchanged.

Tests

  • website/electron/test/display-media.test.js — tier per platform and macOS version (Darwin 24 picker, 23 video-only), loopback only when audio was requested, an untrusted requester refused before getSources.
  • website/electron/test/window-lifecycle.test.js — the tier argument reaches the renderer.
  • website/src/test/MeetingsCaptureTier.test.ts — the renderer's tier probe and each degradation path, with source pins pointing at window-lifecycle.js and session-security.js.

Manual verification

Not performed on a desktop build: this branch was prepared on Linux. A human needs to check:

  • Windows (packaged): Record from the toolbar overflow menu shows no picker and remote audio reaches the level meter; window.kirocrew.audioTier is "loopback"; the chat screen-snip shows no system-audio indicator; Stop releases the capture.
  • macOS 15+ (signed build, Screen Recording granted): Record opens the native picker; a surface with audio brings remote audio; audioTier is "system-picker"; a surface without audio shows the no-audio notice and records the microphone; cancelling the picker records the microphone.
  • macOS 14: audioTier is "video-only"; Record shows the no-loopback notice with no capture prompt.
  • Linux desktop: audioTier is "video-only"; Record shows the no-loopback notice with no capture prompt and no screen-sharing indicator.

Screenshots / video

Not captured yet. The visible change is the no-loopback notice (and the absence of a capture prompt) in the desktop app on macOS 14 and Linux; it appears only inside a packaged Electron build, which this Linux host did not run. A capture from the per-OS pass above is still owed.

Related Issues

no linked issue: feature work from the Meetings stack; depends on #5738.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@kaizawa97
kaizawa97 requested review from a team and Zedmor August 31, 2026 03:30
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Aug 31, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Audit note — this PR and #5738 are one branch stack, not duplicates

A duplicate-detection sweep flagged these two as near-identical because they share a large block of added lines. They are not duplicates: one branch contains the other's commits, so the shared lines are inherited, and the review diff overstates what this PR actually authored.

This is the textbook stacked-branch artifact, provable by SHA rather than by reading code: git rev-parse pr/5738 = 4bb2f16 and git rev-parse pr/7196^ is the SAME sha, off the same merge base abc8222. git log <mb>..pr/7196 is exactly two commits (4bb2f16 then 375f708) while git log <mb>..pr/5738 is exactly one (4bb2f16). So #5738's entire 41-file/+5212 diff appears verbatim inside #7196's three-dot diff, and the 41 shared files are a STRICT SUBSET of #7196's 47 (comm -23 on the two files.tsv is empty). Only #7196's own commit -- 22 files, +597/-15, none of them backend -- is its own work, and it is strictly additive: it never rewrites a line #5738 wrote, it extends #5738's systemAudio.ts, SYSTEM_AUDIO_KEY and meetings.md Recording section on top. Neither PR duplicates the other's behaviour: #5738 is the backend recording subsystem plus browser capture, #7196 is the Electron main-process loopback grant, and #5738 touches no file under website/electron/ at all.

What is genuinely each PR's own

If #5738 merges, #7196 still carries all of its own work and loses nothing: 6 files #5738 never touches (website/electron/display-media.js +102, main.js +35, preload.js +27, electron/test/display-media.test.js +95, website/src/apps/meetings/audio/captureTier.ts +95, website/src/test/MeetingsCaptureTier.test.ts +171), plus its 35-line extension of systemAudio.ts, the 3-line no-loopback row in SYSTEM_AUDIO_KEY, one catalog key in 13 locales and 36 lines of spec. That is the whole capability of granting real system audio in the desktop shell and degrading to mic-only where the platform cannot -- unlanded and unduplicated. The dependency runs one way only: #7196's own commit CANNOT apply to main alone, because website/src/apps/meetings/audio/ does not exist on origin/main (git ls-tree empty) and SYSTEM_AUDIO_KEY/sysAudioUnsupported have zero hits there, so the files it modifies are created by #5738. Correct sequencing is #5738 first, then #7196 rebases; #7196 merging as-is would simply carry #5738's commit in with it, which is not redundancy but the base of the stack.

Suggested action

Land #5738 first, then rebase #7196 onto main so its diff shrinks to its own work. Reviewing #7196 before that means reviewing #5738's code twice.


From a repository-wide duplicate/overlap audit of every pull request open against main (2026-09-02, 330 PRs, one reviewer per PR). Each PR was read as its full merge-base diff plus its description and every comment and review, then compared against each candidate PR's own diff and against origin/main at 1a765b88ceb7. This PR is not being closed — the note is informational. If the reading is wrong, please correct the reasoning rather than just the conclusion.

@bolichen97

Copy link
Copy Markdown
Contributor

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • PR #5738 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #5738: CONTINUE_DEVELOPMENT. A branch stack, not a duplicate: PR #5738 is the base and PR #7196 is the dependent. Land PR #5738 first and have PR #7196 rebase onto it. Closing PR #5738 in favour of PR #7196 would be closing the base in favour of the tip and would silently make the whole 5212-line backend subsystem land under the wrong review. Files: src/kiro_crew/recording/ws.py, website/src/apps/meetings/audio/systemAudio.ts, website/src/apps/meetings/hooks/useMeetingSession.ts.
  • PR #5741 is OVERLAPPING relative to this PR. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #5741: KEEP. Materially different scope (live system-audio capture in the desktop shell); no shared behavior with the import route. Files: src/kiro_crew/recording/ws.py. The two independent directions used different labels; the matrix conservatively retains OVERLAPPING for coordination.
  • This PR is OVERLAPPING with PR #7194. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #7196: REBASE. Complementary meetings features sharing the manifest, app.json permission list, MeetingView header and useMeetingSession surface. Whichever lands second resolves the highlight renumbering; no code needs to be dropped. Files: website/src/components/appstore/appManifest.ts, src/kiro_crew/apps/builtins/meetings/app.json, website/src/apps/meetings/MeetingView.tsx.
  • This PR is OVERLAPPING with PR #7532. The goals differ or the implementations can complement each other; this is not a duplicate claim. Recommended action for PR #7196: REBASE. A merged refactor moved this PR's host code out of main.js into window-lifecycle.js, so the change must be re-applied there and its source-pinning test updated. Independent of the PR #5738 stack. Files: website/electron/main.js.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

@dwu96 dwu96 added the needs-pr-triage PR scanner: awaiting automated triage label Sep 7, 2026
@NicholasRBowers NicholasRBowers added needs-author-decision PR blocked on author input and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 7, 2026
@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:

  • The PR is stacked on unmerged feat(recording): capture meeting audio over a WebSocket #5738 (itself conflicting with main); only you can sequence the rebase once the base lands.
  • A merged refactor moved this PR's website/electron/main.js host code into window-lifecycle.js — the change needs re-applying there and its source-pinning test updated (per the 2026-09-04 audit note).
  • Your body flags the outstanding hands-on pass: loopback system-audio capture differs per OS and needs real macOS/Windows verification before merge sign-off — a Linux automation host cannot provide that.
  • Coordination: feat(meetings): add a per-meeting note the user owns #7194 overlaps on manifest/app.json/MeetingView — whichever lands second rebases.

When you've addressed these, the pipeline will re-assess on its next cycle.

@bolichen97

Copy link
Copy Markdown
Contributor

Attempted a rebase onto main 8534cbf7 as part of the 2026-09-08 open-PR audit. Aborted, branch untouched — the conflicts need your decisions, not a mechanical resolution.

They land in the parent commit (4bb2f165d, i.e. #5738), 21 files:

  • website/public/pcm-worklet.js — main replaced the decimator with a polyphase anti-aliased resampler; where the two-input sum belongs relative to the new filter history is your call.
  • website/src/apps/meetings/MeetingView.tsx — main moved the action bar into an overflow menu (it says five sibling buttons breached the two-per-row cap) and added translation; the recording/system-audio controls need placing in that new shape.
  • src/kiro_crew/config/loader.py — now a facade over config/sections.py; RecordingConfig needs a home there.
  • security_posture.py, config-baseline.json, useMeetingSession.ts, useMeetingTranscription.ts, meetings.md, 13 locale catalogs.

Also pending on this PR's own commit: merged #7532 moved setDisplayMediaRequestHandler and additionalArguments out of website/electron/main.js into window-lifecycle.js, so that hunk no longer applies and MeetingsCaptureTier.test.ts's three source-pinning assertions must be repointed.

Suggested order: land #5738 first, then rebase this branch so its diff is just its own 22 files.

@kaizawa97

Copy link
Copy Markdown
Contributor Author

Rebased: this branch is now exactly two commits — #5738's current head fc8f7c6740 unchanged, plus this PR's own commit 0d57103703 (24 files, none from #5738).

On the audit notes: #7532 moved the host code, so the display-media handler change now lives in electron/runtime/window/session-security.js and the tier argument in electron/window-lifecycle.js; MeetingsCaptureTier.test.ts's three source pins point at those files, and display-media.test.js's handler tests go through the base's isTrustedRequest gate, with one added case that an untrusted requester asking for audio is refused before getSources. The overlap noted with #7194 (manifest / app.json / MeetingView.tsx) and with #5741 (recording/ws.py) does not apply to this commit, which touches none of those files.

One change beyond the rebase: Electron's native picker exists only on macOS 15+, so macOS 14 and older now get the video-only tier (no capture prompt, the no-loopback notice) instead of a screen-capture prompt that could never yield audio.

Local gates on this head: electron node:test green, related vitest 29/29, tsc -p tsconfig.app.json, eslint, i18n:check, docs-lint — all exit 0.

Still needs a human, and cannot be done from the Linux host this was rebased on: the hands-on pass on Windows (loopback) and macOS 15+ (native picker). The per-OS checklist is in the description's Manual verification section. This PR still merges only after #5738.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@kaizawa97
kaizawa97 force-pushed the pr/meetings-electron-system-audio branch from 0d57103 to f658784 Compare September 30, 2026 11:16
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🔴 BLOCK

UX-level review of f658784153dfb9736dcd54de8fb003c8de790fc1 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

cannot evaluate: missing every screenshot — a new Record flow (menu items, badge, meter, icon, notices) ships with an empty image list; the description says "Not captured yet."

Watch

  • The 5-minute Transcribe cap is disclosed only after it fires: recDurationCap ("Recording reached the 5-minute limit…") is the first mention, and recordHint promises "Save this meeting's audio" with no limit. A Transcribe user records an hour-long meeting, misses one info toast, and finds a 5-minute file. Every Transcribe recording, task-failure impact — state the cap when recording starts (or in the hint) when the provider is Transcribe.
  • Mic-only capture is signalled only by a transient toast (sysAudioNoLoopback, sysAudioCancelled) plus the absence of the icon-only MonitorSpeaker glyph. A user who misses the toast believes the whole call is recorded for the entire session — the exact harm the PR names. Make the state persistent, e.g. badge text "Recording (mic only)".

Evidence gaps

  • "Record" and "Stop recording" overflow-menu items (incl. the disabled state) — screenshot of the open menu.
  • "Recording"/"Recording paused" badge with the level meter and the meeting-audio icon — screenshot while recording.
  • The no-loopback notice on macOS 14/Linux desktop (the commit's own stated visible change) — screenshot from the per-OS pass the description says is owed.
  • The recording error notice (meeting-recording-error) and the sysAudioNoAudio/sysAudioCancelled toasts — screenshots of each state.

[UX-REVIEWED] f658784

Description read

[DESCRIPTION-READ] dca44a1c5c191556211055bc617a62051544b2ce9e52e51454b74a604baa5b03

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)

Design-level review of f658784153dfb9736dcd54de8fb003c8de790fc1 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: BLOCK

Cannot evaluate: missing screenshot or recording of the desktop recording UI — no platform branch was run and no surface was rendered.

Blockers

Every behavior this PR exists to deliver is unobserved on every platform it targets.
The diff adds a user-visible control set and notice under website/src/ (Record/Stop menu items, recording badge, RecordingMeter, the no-loopback ErrorNotice), and the workflow's evidence list names zero downloaded attachments and zero committed images — the description concedes it: "Not captured yet … which this Linux host did not run" and "Manual verification: Not performed on a desktop build." The Windows loopback grant, the macOS 15 picker path, and the macOS 14/Linux notice run only in packaged desktop builds CI does not exercise, so they exist solely against mocked Electron APIs; if the real handler's audioRequested/loopback semantics differ, desktop meetings record mic-only or silence with wrong guidance — the exact harm the PR names. The renderer's track probe softens this to degradation, not outage, but the surface's shape cannot be judged unseen, and only the author can run the branches.
Fix: execute the per-OS checklist the description already contains, on at least Windows and one video-only platform, and attach a capture of the notice and the recording controls.
Clears when: the description carries a downloaded image or recording of this revision's desktop UI (the no-loopback notice on macOS 14/Linux, or the recording controls in a packaged build), plus reported results of the Windows-loopback and macOS-picker manual passes.

[DESIGN-REVIEWED] f658784

Description read

[DESCRIPTION-READ] 27bcb8626a83863205b015e0af3ebe187a0b4b613dba0efe6b827de1d4687739

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of f658784153dfb9736dcd54de8fb003c8de790fc1 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

Every tier promise (Windows loopback, macOS picker audio) is untested on any desktop build — the description admits it — and two new exports have zero consumers.

Not justified as shipped

  • Item 1 — unverified platform claim: the loopback grant rests on Electron doc text ("a loopback device is currently only supported on Windows", electron.d.ts 43.2.0) and the description states "Not performed on a desktop build: this branch was prepared on Linux", so whether audio actually arrives on the auto-selected source is unconfirmed on the one platform the feature exists for.
    Clears when: the description's own manual pass is performed on a packaged Windows build and a macOS 15+ signed build.
  • Item 8 — zero consumers: LOOPBACK_AUDIO_PLATFORMS and MACOS_SYSTEM_PICKER_MIN_DARWIN_MAJOR are added to module.exports in website/electron/display-media.js but nothing imports them — grepped both names across the diff: definition, in-module uses, and source-text pins in MeetingsCaptureTier.test.ts only.
    Subtraction: delete the two constants from module.exports; the tests pin them by reading the file's source, not by import.
    Clears when: the exports are removed or an importing consumer exists.

What this change ships

Inventory (9 items) — 7 justified

Intent: In the desktop app, a meeting recording captures the other participants' audio wherever Electron can provide it, and says up front where it cannot — an ADDITION (one commit atop the declared stack base #5738).

  1. Windows desktop: Record captures system audio automatically, with no picker — unverified platform claim: no desktop build has run it.
  2. macOS 15+: the native picker decides whether audio is shared; the picker option is now set only where Electron supports it — justified
  3. macOS 14 and Linux desktop: Record shows a mic-only notice and starts no capture prompt — justified
  4. New renderer surface window.kirocrew.audioTier via additionalArguments — justified
  5. An older desktop shell without the tier field falls back to browser-tier guidance — justified
  6. One new sysAudioNoLoopback string in all 13 locale catalogs — justified
  7. meetings.md documents the capture tiers in the same commit — justified
  8. display-media.js exports two constants nothing imports — zero consumers
  9. Recording core (backend WAV/socket, record/stop UI, worklet mixing) — rides along: declared stack base feat(recording): capture meeting audio over a WebSocket #5738, reviewed on that PR.

[FIRST-PRINCIPLES-REVIEWED] f658784

Description read

[DESCRIPTION-READ] c201322bee7a870f6d6e7ba778220c64d53d77fc6117e6e6f15f20ba11edac00

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed f658784153dfb9736dcd54de8fb003c8de790fc1 via the fork AI-review pipeline; updated in place on each push.

2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- src/kiro_crew/recording/ws.py:264 -- Transcribe selection truncates recordings at five minutes
enforce_deadline = cfg.stt.provider == "transcribe"
Long meeting using Transcribe -> recording socket closes after 300 seconds -> subsequent audio is absent from the WAV.
Anchor: residual/crash-data-loss-corruption
Fix: Remove the recording deadline; /api/ws/stt already bounds the billable Transcribe stream.

BLOCKING -- website/src/apps/meetings/hooks/useMeetingSession.ts:728 -- Stop finalizes before pending PCM is drained
recordingRef.current.stop()
Stop between worklet batches -> stop frame reaches the server before buffered PCM -> the recording loses its final audio.
Anchor: residual/crash-data-loss-corruption
Fix: Await the worklet’s existing flush/flushed handshake before sending the recording stop frame.

[BLOCK-MERGE] f658784
[GPT-REVIEWED] f658784

Adjudication (Opus 5) — is blocking on each finding proportionate?

F1 — src/kiro_crew/recording/ws.py:264
Conditions are ordinary, not extreme: stt.provider is an operator-selectable value (sections.py:3661, documented at sections.py:4078), the 300 s task closes the socket unconditionally once selected (ws.py:271, ws.py:284-294), and the client does not reopen — duration sets stoppingRef and reports an info toast only (useMeetingRecording.ts:5010-5011 of the patch). Any meeting longer than five minutes on Transcribe loses every second past the cap, so no rarity argument exists.

F2 — website/src/apps/meetings/hooks/useMeetingSession.ts:728
stopRecording sends the stop frame with no worklet handshake, while the worklet only posts full 1600-sample batches (website/public/pcm-worklet.js:77) and drains a partial batch plus the FIR tail solely on a flush message (pcm-worklet.js:34-47) that the meetings pipeline never sends (useMeetingTranscription.ts has no flush post; only useStreamingStt.ts:502-511 does). Recovery: none — the server finalizes on stop (ws.py:452-458). A stop landing mid-batch is the normal case, not an extreme timing combination, so the rarity record required for FLAG cannot be completed.

[ADJUDICATION] f658784 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] f658784

[ADJUDICATION-FENCED] f658784 fenced=2 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/recording/ws.py:264 -- Selecting the documented transcribe provider and holding a meeting past five minutes is an ordinary operating combination, and the client has no reopen path, so audio beyond the cap is silently absent from the WAV.
UPHOLD-FENCED F2 website/src/apps/meetings/hooks/useMeetingSession.ts:728 -- A stop landing between the worklet's 100 ms batches is the normal case rather than an extreme one, and the partial batch plus filter tail is dropped because the meetings pipeline never sends the worklet's flush message the dictation path uses.
[GPT-ADJUDICATED-FENCED] f658784

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed f658784153dfb9736dcd54de8fb003c8de790fc1 via the fork AI-review pipeline; updated in place on each push.

Review details

Nothing blocks — but the Transcribe billing cap truncates every meeting recording on a socket that sends no audio to Transcribe.

FINDING — src/kiro_crew/recording/ws.py:264 — enforce_deadline = cfg.stt.provider == "transcribe" arms asyncio.sleep(_MAX_STREAM_DURATION_SECS) (300 s wall clock from socket open, pauses included) on a handler whose own docstring says nothing here is transcribed, so the cited $0.024/min bill cannot accrue on this socket while /api/ws/stt already self-caps; a Transcribe operator's meeting is recorded for five minutes, the client is told via a transient info toast and deliberately never reconnects → Fix: do not arm the deadline on this socket, or start the clock at the start frame and measure captured audio-seconds excluding PAUSED stretches.

FINDING — src/kiro_crew/config/sections.py:4066 — "Refuse to start a recording session when the Gateway is reachable on a non-loopback address." (byte-identical in config-baseline.json) states a bind-address condition, while ws.py:226 measures one request via is_direct_local_request, so a gateway started with --host 0.0.0.0 records happily from a local browser and the socket's own refusal text ("gateway is not receiving a direct local request") contradicts the help → Fix: reword the _meta help and the baseline to state the per-request loopback-peer test that is actually performed.

FINDING — website/src/apps/meetings/hooks/useMeetingRecording.ts:257 — ws.onerror = () => { onErrorRef.current?.('disconnected') } neither sets stoppingRef.current nor clears wsRef.current, so a gateway death or dropped network fires error then close, and onclose's if (!stoppingRef.current) branch reports 'disconnected' a second time → two identical error toasts and two setRecordingError writes for one failure → Fix: set stoppingRef.current = true inside onerror before reporting.

[OPUS-REVIEWED] f658784

Adds a recording package that owns an audio session: a state machine
per session, a WAV writer, and recovery scaffolding for a session whose
process died mid-recording. The dashboard exposes it at
/api/ws/recording, and the Meetings app resolves where a recording lands
through its own recording store.

The socket carries audio IN and emits only ready / level / error back.
It does not transcribe: the browser already streams the same PCM to
/api/ws/stt and the Meetings app persists that transcript, so the
never-reached transcript path (_emit_transcript, the live-transcript
persister and its security-posture sink row) is removed rather than
kept as a claim no request could satisfy.

Every recording of a meeting gets its own file -- audio.wav, then
audio-2.wav, ... -- and the writer creates it exclusively ("xb"). The
previous fixed name opened with "wb" truncated the earlier recording
the moment a user recorded a second time (stop then Record, a dropped
socket, the Transcribe duration cap). `ready` names the file so a client
can tell recordings apart.

The frontend captures both the microphone and the system output and
sums them inside the PCM worklet's two inputs ahead of main's polyphase
resampler, so the mix is anti-alias filtered once; a single-input node
(dashboard dictation) is unaffected. A meter shows input level so a
user can see the capture is live.

The session registry lock is a LoopBoundLock and the concurrency cap
has a single definition in session.py.
A browser tab can only offer system audio through a display-capture
prompt, and on some platforms not at all. Electron can grant it
directly, so the display-media handler (installed by
runtime/window/session-security.js) resolves a loopback audio track
where the platform supports one, and the frontend is told which capture
tier it actually gets.

The tier is decided in one place, display-media.js::describeAudioTier;
window-lifecycle.js computes it once and passes it to the sandboxed
preload through additionalArguments. A platform that cannot provide
system audio (video-only tier) is never prompted: requestSystemAudio
reports 'no-loopback' and the meeting degrades to microphone-only
instead of starting a screen capture that can only return video.

The loopback grant is gated on request.audioRequested AND win32, because
the handler is shared with the chat screen-snip tool and Electron 43's
electron.d.ts scopes Streams.audio 'loopback' to Windows. macOS never
reaches the handler while useSystemPicker is on, so its audio is whatever
the native picker offers.
@kaizawa97
kaizawa97 force-pushed the pr/meetings-electron-system-audio branch from f658784 to f612bfb Compare September 30, 2026 12:19
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 30, 2026

Copy link
Copy Markdown
Contributor

Open-PR triage (2026-10-05): DISTINCT, stacked on #5738. Rebase after #5738 lands

I checked head f612bfb9b6 against origin/main af1eb612da by reading the full code, not the titles.

Relationships

Breaking change / P0: none found.

  • The loopback grant requires both request.audioRequested and win32 (chooseAudioGrant), and it comes after the existing isTrustedRequest gate, so the screen-snip tool still gets video-only grants.
  • useSystemPicker becomes host-derived (supportsSystemPicker, Darwin ≥ 24). That matches what Electron does today, because it ignores the flag below macOS 15 and on Linux.

Still open: the Windows / macOS 15+ hands-on checks and screenshots listed in the description. The bot findings on recording/ws.py (Transcribe 5-minute cap) and on Stop not flushing the worklet are in #5738's code and should be handled there.

Recommendation: REBASE onto #5738 once it merges, so this diff is only its own 24 files, then finish the manual per-OS pass. Do not close this PR.

@dodgeblaster

Copy link
Copy Markdown
Contributor

Steward review (no merge). This PR is stacked on #5738 (its history contains that PR's feat(recording): capture meeting audio over a WebSocket commit), so it inherits both conflicts with issue #2814:

  1. On-disk retention — carries feat(recording): capture meeting audio over a WebSocket #5738's WavWriter that persists audio.wav to the meeting directory, which feat(meetings): capture computer audio alongside the microphone #2814 says should not happen.
  2. Silent mic-only fallback — carries feat(recording): capture meeting audio over a WebSocket #5738's systemAudio.ts / useMeetingSession.ts path that reports a capture failure as info and keeps recording microphone-only, which feat(meetings): capture computer audio alongside the microphone #2814 says must not happen.

Additionally, it predates two things now on main that any Electron-side change must build on: the isTrustedRequest identity check added by #9112, and the handler registration moved out of main.js into window-lifecycle.js by #7532. The branch is currently CONFLICTING with main.

The underlying questions (platforms, consent boundary, recording-others policy, retention) are a maintainer decision, unruled as of main 0b89e0c6f7. Leaving as-is pending that ruling — not merging.

@bolichen97

Copy link
Copy Markdown
Contributor

Thanks for this PR. It now conflicts with main. Could you rebase onto the latest main and resolve the conflicts? We will review it again once it is rebased and CI is green.

This branch has had no activity for over 30 days. If there is no further activity in the next 14 days, we may close it. You can always reopen it or open a new PR later.

gbrunoo pushed a commit to gbrunoo/KiroCrew that referenced this pull request Nov 9, 2026
Proposes answers to the three maintainer questions left open in kirodotdev#2814
(platform scope, capability reporting, consent boundary), backed by
measurements of getDisplayMedia system audio in Chrome and in the
Electron shell, and a phased plan whose first phase mixes the computer
audio with the microphone ahead of the existing worklet so the STT
protocol and the server stay unchanged. Records the Electron-on-macOS
gap (electron/electron#47490) as out of scope and names the two open
PRs (kirodotdev#5738, kirodotdev#7196) that conflict with the issue's premises.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants