feat: add audio probe by thymikee · Pull Request #880 · callstack/agent-device · GitHub
Skip to content

feat: add audio probe#880

Open
thymikee wants to merge 2 commits into
mainfrom
feat/web-audio-probe
Open

feat: add audio probe#880
thymikee wants to merge 2 commits into
mainfrom
feat/web-audio-probe

Conversation

@thymikee

@thymikee thymikee commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Adds an agent-device web audio probe for browser sessions: audio probe start|status|stop samples page media element audio into compact RMS/peak dBFS buckets that can be inspected while other actions continue.

Wires the command through CLI, typed client, daemon routing, capabilities, batch validation, MCP metadata, and the managed agent-browser web provider. Also adds an Expo test-app Audio tab with a generated 8-second tracker-style <audio> sample for dogfooding on web.

CI follow-up: splits the audio request resolver and provider normalizer to satisfy Fallow, unwraps the real agent-browser eval envelope, and lets the probe rediscover media streams that appear after audio probe start.

Tradeoff: this implementation samples HTML media elements exposed to Web Audio; it does not capture whole-tab, OS, or device audio.

Validation

Focused checks passed: pnpm exec vitest run --project unit src/platforms/web/agent-browser-provider.test.ts, pnpm check:fallow --base 24cb2b622cf19f18f61bf646bd137fb1a819ee56, pnpm test-app:typecheck, pnpm check:quick, pnpm build, and pnpm format.

Manual dogfood against the Expo web app used a live 20s probe while clicking the sample button:

agent-device audio probe start 20 1000 --platform web --session audio-ci-example --json
agent-device click 'label="Start sample"' --platform web --session audio-ci-example --json
agent-device audio probe status --platform web --session audio-ci-example --json

Real status output excerpt from the run:

{
  "audio": "probe",
  "state": "running",
  "heard": true,
  "durationMs": 20000,
  "elapsedMs": 8925,
  "bucketMs": 1000,
  "sampleCount": 9,
  "mediaElementCount": 1,
  "sourceCount": 1,
  "rmsDbfs": [-90, -90, -32, -33, -32, -33, -32, -33, -42],
  "peakDbfs": [-90, -90, -25, -26, -24, -26, -25, -26, -25]
}

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

@thymikee

Copy link
Copy Markdown
Member Author

Fallow Code Quality is failing on new complexity in the audio path. Please split/flatten these before review:

  • src/daemon/handlers/session-observability.ts:643 resolveAudioCommandRequest — cyclomatic 16, cognitive 10, 60 lines, CRAP 71.3
  • src/platforms/web/agent-browser-provider.ts:298 normalizeAgentBrowserAudioProbeResult — cyclomatic 10, cognitive 9, 23 lines, CRAP 31.6

After updating, please rerun pnpm check:fallow --base origin/main or confirm the CI check is green.

@thymikee thymikee changed the title feat: add web audio probe feat: add audio probe Jun 25, 2026
@thymikee

Copy link
Copy Markdown
Member Author

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