Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/review-artifacts/791ca2b9.patch.gz
Binary file not shown.
33 changes: 33 additions & 0 deletions docs/review-artifacts/s25-voice-lineage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# S25 WebUI voice donor lineage

This directory preserves the independently reviewable donor for the browser voice slice.

## Immutable donor

- Commit: `791ca2b9f8677568c3d49b38c97549aa981e0706`
- Parent: `a79255d574bbf7279fadd2759782a4641c7976d9`
- Subject: `fix(web): use live speech for mobile voice input`
- Durable local ref: `refs/archive/s25-voice-donor-791ca2b9`
- Deterministically compressed binary format-patch: `docs/review-artifacts/791ca2b9.patch.gz`
- Compressed artifact SHA-256: `88fe5f0f1648cd3694de1c8dd76be1b61acd619b59433952581c2459b9610f0f`
- Uncompressed patch SHA-256: `b8b5ac97c9384601d7ad62b21d24e4e63f88c60a1832a5525a950ef1605e9bec`
- Stable patch-id: `79794abce4eb3e1a12eeb05e9a3bcf5c6626ddbd`

After decompression, the stable patch-id computed from the committed patch equals the patch-id computed directly from commit `791ca2b9`, including the two donor screenshots. The committed patch remains sufficient if the non-published local archive ref is later removed.

## Current-main port delta

The candidate is a manual current-main port, not a cherry-pick. It retains the donor's browser `SpeechRecognition` direction, final/interim transcript accumulation, Android `onend` restart, fatal permission stop, tap-to-submit interaction, and typed Gboard fallback. Relative to the donor it:

- ports onto `origin/main` at `f751a8c5467c41500e505d90cb0eb8b70929080f`;
- bounds restart attempts with exponential backoff and protects callbacks with a capture generation;
- normalizes and submits a non-empty transcript exactly once through a dedicated PTY helper;
- adds explicit disconnected, cancel, unavailable, start-failure, retry-budget, and no-empty-submit behavior tests;
- integrates the control into the current `ChatPage`/`ChatSidebar` layout;
- consumes structured `message.complete` events for browser speech output and cancels playback on barge-in;
- deliberately removes the unproven optional native bridge rather than selecting it from object shape alone; and
- omits the donor screenshots from the product commit because they are preserved byte-for-byte in the binary donor patch and do not constitute real-device proof.

## Truth boundary

Gboard is typed fallback only. Chrome Web Speech supplies browser transcript events. This slice does not claim private Gboard audio/VAD access, on-device or offline recognition, continuous or hands-free conversation, or verified behavior on a physical S25. Those claims remain gated on real-device evidence.
8 changes: 7 additions & 1 deletion web/src/components/ChatSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import { ReasoningPicker } from "@/components/ReasoningPicker";
import { GatewayClient, type ConnectionState } from "@/lib/gatewayClient";
import { api, buildWsUrl } from "@/lib/api";
import { assistantFinalText } from "@/lib/assistant-voice-output";
import { maybeReloadForLoopbackWsAuthFailure } from "@/lib/dashboard-auth-reload";
import {
EVENTS_CONNECT_TIMEOUT_MS,
Expand Down Expand Up @@ -92,6 +93,7 @@
className?: string;
onDashboardNewSessionRequest?: () => void;
onSessionTitleChange?: (title: string | null) => void;
onAssistantFinal?: (text: string) => void;
}

/** Build the ``session.create`` params for the sidecar session.
Expand All @@ -101,7 +103,7 @@
* can be tested without reading component source text. See
* ``chat-sidebar-session-params.test.ts``.
*/
export function sidecarSessionCreateParams(profile?: string): Record<string, unknown> {

Check warning on line 106 in web/src/components/ChatSidebar.tsx

View workflow job for this annotation

GitHub Actions / JS & TS checks / JS & TS checks

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
return {
close_on_disconnect: true,
source: "tool",
Expand All @@ -115,6 +117,7 @@
className,
onDashboardNewSessionRequest,
onSessionTitleChange,
onAssistantFinal,
}: ChatSidebarProps) {
// `version` bumps on reconnect; gw is derived so we never call setState
// for it inside an effect (React 19's set-state-in-effect rule). The
Expand Down Expand Up @@ -413,6 +416,9 @@
}
} else if (type === "dashboard.new_session_requested") {
onDashboardNewSessionRequest?.();
} else if (type === "message.complete") {
const text = assistantFinalText(type, payload);
if (text) onAssistantFinal?.(text);
}
});
};
Expand All @@ -429,7 +435,7 @@
}
ws?.close();
};
}, [channel, onDashboardNewSessionRequest, onSessionTitleChange, version]);
}, [channel, onAssistantFinal, onDashboardNewSessionRequest, onSessionTitleChange, version]);

// Seed the badge on mount and re-read it whenever the sockets are rebuilt
// (a profile/channel switch bumps `version`).
Expand Down
Loading
Loading