Skip to content
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This is a personal fork of [pingdotgg/t3code](https://github.com/pingdotgg/t3cod
### Voice

- **Message listening** — optional spoken versions and summaries of assistant messages, with playback controls on web, desktop, and mobile. Spoken versions are requested on the server, so their progress survives navigation and reconnects and shows on every connected client; a summary in progress shows only on the client that asked for it. Reopening a thread shows the player on every message that already has a recording, with its length. Playback belongs to the app, not the message, so audio keeps playing while you switch threads; mobile adds lock-screen and Control Center controls, and web and desktop support OS media controls and media keys. While a recording plays or sits paused mid-way, its thread shows a speaker icon in the web sidebar and the mobile thread lists that toggles play and pause.
- **Speech providers** — synthesis runs on OpenRouter (the default) or ElevenLabs. OpenRouter reaches every model on its speech endpoint (Gemini 3.1 Flash TTS out of the box, plus Deepgram, MiniMax, Microsoft, Fish Audio, and others) at a fraction of ElevenLabs' price; paste a regular inference key in Settings → Extras → Voice and it is stored in each environment's secret store. ElevenLabs keeps working from `ELEVENLABS_API_KEY`, which also transcribes Telegram voice notes. Provider, model, and voice are dropdowns filled from the vendor's catalog with list prices per million characters, and supported models take an optional style instruction. A Test button generates an editable sample with the current selection and shows what it cost. Long scripts are split and synthesized in parallel, so long recordings arrive much sooner.
- **Speech providers** — synthesis runs on OpenRouter (the default) or ElevenLabs. OpenRouter reaches every model on its speech endpoint (Gemini 3.1 Flash TTS out of the box, plus Deepgram, MiniMax, Microsoft, Fish Audio, and others) at a fraction of ElevenLabs' price; paste a regular inference key in Settings → Extras → Voice and it is stored in each environment's secret store. ElevenLabs keeps working from `ELEVENLABS_API_KEY`, which also transcribes Telegram voice notes. Provider, model, and voice are dropdowns filled from the vendor's catalog with list prices per million characters, and supported models take an optional style instruction; these choices and the voice reply switch apply to the environment selected at the top of Extras. A Test button generates an editable sample with the current selection and shows what it cost. Long scripts are split and synthesized in parallel, so long recordings arrive much sooner.
- **Agent voice replies** — agents get a `voice_reply` tool that turns a script written for the ear into a recording attached to their final message once the turn completes; calling it again in the same turn appends another segment. Web and mobile show the recording as a player card below the written reply, and a turn that ends without a written message shows the transcript as its text. It needs a configured speech provider and can use its own provider, model, and voice; the switch in Settings → Extras → Voice (on by default) withholds the tool from newly started sessions. When the speech provider refuses a request because the account's quota or credits are used up, the agent and the "Listening version unavailable" notice say so.
- **Telegram dispatches** — ask an agent to "send me a summary to Telegram" and its `telegram_send` tool posts a markdown summary, an optional full report, and an optional voice note into a private chat with your own bot, one topic per T3 thread. Reply in a topic by text or voice note to queue a follow-up in that thread, and press ✅ Done to settle it (↩️ Reopen undoes it). Connect a bot in Settings → Devices → Telegram; it uses long polling, so no public URL is needed.

Expand All @@ -97,7 +97,7 @@ This is a personal fork of [pingdotgg/t3code](https://github.com/pingdotgg/t3cod
- Pull request writes (merge, review, comment) first confirm that the checkout still points at the target repository, fall back to another checkout of the same repository when the original is gone, and refuse otherwise.
- Automatic worktree cleanup also spares checkouts with background work, a queued message held by Stop, a pending archive or worktree move, or another thread reaching them through a symlinked path (a thread's own subagents don't count), and a turn never starts in a checkout that is being removed. SP Labs lab worktrees are never removed. **Keep worktrees with local changes** defaults to **Any local files**, so ignored files such as `.env` keep a worktree unless you choose a looser policy.
- A turn cut off by a server restart is reported to the next turn as stranded, not as a user stop, so the agent continues instead of halting and apologising.
- Unsaved edits on a provider settings card survive resets, rejected writes, and saves from other cards.
- Unsaved edits on a provider settings card survive resets, rejected writes, and saves from other cards, and never revert a newer change made on another device.
- Escalating desktop process termination and an interactive sidebar resize rail.

### Fork infrastructure
Expand Down
22 changes: 12 additions & 10 deletions apps/web/src/components/chat/AssistantMessageSpeech.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import {
listeningSpeedSpokenLabel,
type ListeningTrackRef,
} from "@t3tools/shared/listeningPlayback";
import { RegistryContext } from "@effect/atom-react";
import { AsyncResult } from "effect/reactivity";
import { HeadphonesIcon, MinusIcon, PauseIcon, PlayIcon, PlusIcon } from "lucide-react";
import {
type CSSProperties,
type KeyboardEvent,
useEffect,
useContext,
useRef,
useState,
useSyncExternalStore,
Expand Down Expand Up @@ -88,11 +90,12 @@ export function useAssistantMessageSpeech(input: {
// Creating a recording operates the environment; playing an existing one does not.
const canCreate =
useEnvironmentScope(environmentId, AuthOrchestrationOperateScope) && input.available;
const threadSpeech = useEnvironmentQuery(
const threadSpeechQuery =
input.persistentJobs && threadId !== null
? messageSpeechThread({ environmentId, input: { threadId } })
: null,
).data;
: null;
const threadSpeech = useEnvironmentQuery(threadSpeechQuery).data;
const registry = useContext(RegistryContext);
const readSession = () => getMessageArtifactSessionSnapshot(environmentId, messageId, text);
const session = useSyncExternalStore(
(listener) => subscribeMessageArtifactSession(environmentId, messageId, listener),
Expand All @@ -101,11 +104,6 @@ export function useAssistantMessageSpeech(input: {
);
const speech = threadSpeech?.recordings.get(messageId) ?? session.speech;
const serverPending = threadSpeech?.pending.has(messageId) ?? false;
const serverPendingRef = useRef(serverPending);
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- mirrors server pending for the async synthesize callback
useEffect(() => {
serverPendingRef.current = serverPending;
}, [serverPending]);
const [requesting, setRequesting] = useState(false);
// null = untouched: a message that already has a recording shows its
// player, so reopening a thread shows which messages have one.
Expand All @@ -126,7 +124,11 @@ export function useAssistantMessageSpeech(input: {
const reason = messageSpeechFailureReasonFromError(squashAtomCommandFailure(result));
// A dropped connection says nothing about the server's job, which the
// thread's listening state still shows.
if (reason === undefined && serverPendingRef.current) return;
const live =
threadSpeechQuery === null
? null
: AsyncResult.getOrElse(registry.get(threadSpeechQuery), () => null);
if (reason === undefined && live?.pending.has(messageId)) return;
toastManager.add({
type: "error",
title: "Listening version unavailable",
Expand Down
Loading
Loading