Repository navigation
chore(fork): remove TMAD-derived carry - #30
Conversation
Reverse-applies the TMAD delta (84ba5a6..79422b4, tmad4000/paseo 0.11.1) onto the assembled 0.16.0-beta.2 tree and resolves every conflict toward upstream 0.16 plus the fork's own carries. Removed: the durable agent queue (agent.queue.* RPCs, queue outbox, receipt driven dispatch), companion entries and the pin/Q&A actions on messages, the agent artifacts feed and CLI scan, native chat Find, TMAD's voice concurrency (per-device speak arbitration, concurrent voice input, voice receipt routing), and the TMAD plans, evidence and docs. Kept: every unrelated fork carry - side conversations, provider accounts and rename migration, checkout base refs, package.json scripts, outbound byte metrics, pinned prompt, plan copy sources, file-explorer inline path errors, shared-turn steering (PeerTurnActiveError), theme and layout work.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e83f532fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SideConversationListRequestMessageSchema, | ||
| AgentQueueEnqueueRequestSchema, | ||
| AgentQueueUpdateRequestSchema, | ||
| AgentQueueReorderRequestSchema, | ||
| AgentQueueDeleteRequestSchema, | ||
| AgentQueueRetryRequestSchema, | ||
| AgentQueueSendNowRequestSchema, | ||
| AgentQueueListRequestSchema, | ||
| AgentQueueGetItemImagesRequestSchema, | ||
| SetAgentTimelineSubscriptionRequestMessageSchema, |
There was a problem hiding this comment.
Retain retired RPC alternatives in the wire schemas
Removing the queue request alternatives makes previously valid messages such as agent.queue.list.request fail WebSocket inbound validation. Removing the feature implementation and withdrawing its advertised capability is separate from removing its wire contract: existing SDK callers must still receive a parseable unavailable-feature response rather than an unknown-schema error. Retain the retired request/response declarations and subscription enum values while disabling their implementations, as required by the backward-compatibility rule in AGENTS.md.
AGENTS.md reference: AGENTS.md:L149-L151
Useful? React with 👍 / 👎.
| onStop, | ||
| onCancelAgent, | ||
| }: RealtimeVoiceOverlayProps) { | ||
| const { theme } = useUnistyles(); |
There was a problem hiding this comment.
Keep the themed wrappers instead of adding useUnistyles
This introduces a new useUnistyles() call where the previous implementation used withUnistyles wrappers. The hook subscribes the entire voice overlay subtree to runtime changes, including breakpoint and inset updates, instead of limiting theme-driven renders to the icons and spinner. AGENTS.md explicitly forbids this hook, and its linked Unistyles guide requires rejecting new calls; retain the wrappers for these third-party props.
AGENTS.md reference: AGENTS.md:L35-L35
Useful? React with 👍 / 👎.
| } catch (error) { | ||
| if (!this.isVoiceMode && this.voiceModeAgentId) { | ||
| await this.disableVoiceModeForActiveAgent(); | ||
| } | ||
| const errorMessage = error instanceof Error ? error.message : "Failed to set voice mode"; | ||
| const unavailable = this.getVoiceFeatureUnavailableResponseMetadata(error); |
There was a problem hiding this comment.
Roll back voice registration when controller startup fails
If startVoiceTurnController() fails after the agent reload succeeds—for example, when the turn detector cannot connect—the catch block no longer disables the partially enabled voice session. The agent retains its voice-only system prompt and registered speak handler, while the client receives accepted: false and does not send a disable request because its enable operation failed. A retry then attempts to register the same handler and fails with “Voice mode is already active for this agent.” Restore the failure cleanup so startup errors release the bridge, controller, and modified agent configuration.
Useful? React with 👍 / 👎.
| } finally { | ||
| item.controller.signal.removeEventListener("abort", cancelPlayback); | ||
| } | ||
| item.resolve(await start(item.source, item.controller.signal)); |
There was a problem hiding this comment.
Settle canceled playback without waiting for preparation
When playback is canceled while start() is awaiting preparation, this direct await leaves the canceled item active until preparation finishes. Both engines await audio.arrayBuffer(), and the web engine also awaits decoding before checking the abort signal, so those stages cannot settle the queue's cancellation themselves. A stalled preparation therefore leaves the canceled play promise unresolved and blocks subsequent voice or plugin audio. A deferred-start reproduction confirms that stop() leaves isPlaying() true and prevents the next item from starting; retain the abort race that releases queue ownership immediately.
Useful? React with 👍 / 👎.
| await session.adapter.setVoiceMode(true, agentId); | ||
| enabledCurrentVoiceMode = true; | ||
| await deps.engine.startCapture(); | ||
| if (state.generation !== generation) { | ||
| return; |
There was a problem hiding this comment.
Check startup cancellation before starting microphone capture
If stopVoice() or provider teardown runs while the enable acknowledgement is pending, the stopped startup still calls engine.startCapture() when that acknowledgement arrives. The generation check happens only afterward and returns without stopping the newly started capture. A deferred-acknowledgement reproduction leaves the microphone capturing while the runtime snapshot reports phase: "disabled" and isVoiceMode: false. Restore lifecycle serialization and cancellation checks before capture admission, with cleanup if cancellation occurs during capture startup.
Useful? React with 👍 / 👎.
| archivedAt: IsoDateSchema.nullable().optional(), | ||
| artifacts: z.array(AgentArtifactSchema).optional(), | ||
| companionEntries: z.array(CompanionEntrySchema).optional(), | ||
| }); |
There was a problem hiding this comment.
Preserve cached agents when dropping obsolete snapshot fields
After upgrading from the previous fork build, cached agent snapshots contain artifacts and companionEntries, including empty arrays, because the previous daemon projections supplied them and serializeStreamStateFields() persisted them. Removing these keys from this z.strictObject() makes those otherwise valid snapshots fail validation. readAgent() then deletes the row and returns undefined, while readDirectory() deletes the affected agent rows, so users upgrading while their host is offline lose their cached agent directory until reconnection. Strip or tolerate the obsolete fields during cache reads rather than treating the entire agent snapshot as corrupt.
Useful? React with 👍 / 👎.
The TMAD voice carry registered speak for every agent-scoped catalog, so agent sessions that never attach voice advertised a tool whose handler threw. Restore the upstream gate: speak registers when the catalog is voice-only or voice tools are enabled for the session.
strategy-native was reverted to upstream, so createNativeMessageScroller had no callers outside its own test.
Compare with the duplicate removal branch (#31) turned up three things worth taking: - Restore the U2d beta-upgrade handover. U2e links to it, and it records how the fork's own layers reached the basket; it is fork provenance, not TMAD code. - Restore app pretypecheck, which builds the expo-two-way-audio declarations that packages/app typecheck reads. - Test that a 0.16.0-beta.2 request type reachable only through the removed TMAD RPCs still gets a structured rpc_error, so dropping the protocol schemas stays a deliberate, covered decision. fork/tmad-removal.md records the provenance and both resolutions that a future re-port has to reverse.
What
Removes the code the fork inherited from
tmad4000/paseo. This is the follow-up to the 0.16.0-beta.2 rollout: the basket carried TMAD in, and this drops it while keeping everything else the fork owns.Method: reverse-apply the TMAD delta
84ba5a691..79422b485(TMAD 0.11.1 tip, merged as27daed7df) onto the released 0.16.0-beta.2 tree, then resolve every conflict toward upstream 0.16 plus the fork's own carries. 196 files, +883 / −23,840.Removed
agent.queue.*RPCs,AgentQueueService, the server queue store and send-or-queue path, the client queue outbox store, receipt-driven dispatch, the queue UI in the composer,durableAgentQueueV1/durableVoiceInputV1capabilitiesCompanionEntrymodel and storage,updateCompanionEntry, message pin / Q&A actions, the companion feed,companionStreamPortV1AgentArtifactstorage and projection fields,paseo agent artifacts, the artifacts view switcherchat-find/matches,native-viewport,native-message-scroll(module and its suite), the native stream'sscrollToMessageplumbing; nativeChatFindreturns upstream's no-op stubvoiceOwner, and the "speak is advertised before voice attaches" gate: the tool registers on voice attachment again, and an unattached call fails instead of settlingdocs/companion-stream.md,docs/queue-mirroring.md, CLAUDE.md rowsKept
Everything else the fork carries, including: side conversations, provider accounts with rename migration, checkout base refs,
package.jsonscripts, outbound-byte metrics, turn timing footer, pinned prompt, plan copy sources, file-explorer inline path errors, shared-turn steering (PeerTurnActiveError), app-level voice chat (voice-session,registerVoiceCallerContext, thespeaktool itself, TTS playback), theme and layout work, and the 0.16 host registrations.Verification
npm run build:client,npm run build:serverdeps,tsgotypecheck of protocol/client/relay/server: clean. The only remaining typecheck noise is pre-existing environment drift in this worktree's sharednode_modules(@opencode-ai/sdk/v2/client,p-limit, commander typings,lucide-react-native,expo-audio, Ajv) and reproduces on files this PR does not touch.npm run lintandnpm run formaton every changed file: clean.agent-projections(27),agent-storage(23),agent-prompt(23), appreplica-cache(52), appcomposer/actions+audio/playback+stores/session-store(75). All pass.session.test.ts,mcp-server.test.tsand the websocket-server suites cannot run in this worktree: their import chain needs@opencode-ai/sdk/v2/client/lru-cache@11, missing from the shared install. CI is the authority for those.server-tests (ubuntu-latest)failed one test,mcp-server.test.ts > speak MCP tool > does not register speak tool unless voice tools are enabled, which is exactly the leftover gate this PR now fixes; 496 other server test files passed. Fork CI was green on that head.3b9b9c25b: CI run 43270998967 success and Fork CI run 43270998784 success.server-tests (ubuntu-latest)ranwebsocket-server.relay-reconnect.test.tswith 31 tests, i.e. including the new legacy-RPC case. Headc2525c224was green on both workflows too.Follow-ups
76f41f351restored upstream'sspeakregistration gate (voiceOnly || enableVoiceTools || callerContext.enableVoiceTools). The TMAD carry had addedscope === "agent", which advertisedspeakto every agent session even though nothing could handle the call.c2525c224deletedagent-stream/native-message-scroll.tsand its suite: oncestrategy-nativewent back to upstream, the scroller had no callers.3b9b9c25bis the revert(tmad): remove TMAD-derived stream, queue, and find code #31 comparison: U2d handover restored,apppretypecheckrestored,fork/tmad-removal.mdadded, and the legacy-RPCrpc_errorpath covered by a test.Risk
Highest-risk resolutions are the files where TMAD and later fork work overlapped:
session.ts,agent-manager.ts,websocket-server.ts,composer/index.tsx,agent-stream/view.tsx,agent-panel.tsx,replica-cache. Each was resolved by keeping the fork's behaviour and deleting only the TMAD surface; a reviewer should look at those first.Comparison with #31
#31 (
revert(tmad): remove TMAD-derived stream, queue, and find code) targetscustom. The two base trees are identical (1c46a58f6vs99e212869,git diff --quietclean), so the branches compare directly. This PR is the superset: it also removes the TMAD protocol schemas, capability constants, artifact/companion storage, client voice transport and the app surfaces, where #31 keeps them.Adopted from #31:
fork/handover-beta-upgrade-u2d-2026-10-17.mdrestoredhandover-beta-upgrade-u2elinks to it, and it records how the fork's own layers reached the basket. It is fork provenance, not TMAD code; deleting it left a dead link.packages/apppretypecheck@getpaseo/expo-two-way-audiois upstream and stays, so the declaration build is still what makespackages/apptypecheck work on a clean tree.fork/tmad-removal.mdrpc_error{code: "unknown_schema", requestId}(websocket-server.ts,handleInvalidInboundMessage), which the old client surfaces as a rejection.websocket-server.relay-reconnect.test.tsnow locks that path, so the decision not to keep ~990 lines of fork-only schema is covered instead of assumed.Reviewed and not adopted:
CLIENT_CAPSentries,companion-stream.ts,agent-types.tsadditions, per-RPCDURABLE_QUEUE_REMOVED_ERRORhandlers and theiroperation-permissionsentriessession.ts(isVoicePermissionAllowed)AgentRunBusyError, queue-orientedreplaceRunning: false/blockPendingPermissionsinagent-prompt.ts,stripVoiceModeSystemPromptinagent-manager.ts, and an emptyif (isTurnTerminalEvent(event)) {}agent-stream/native-message-scroll.tsand its suite restoredstrategy-nativeis upstream.RetainedPanel/ChatAgentDockContent/computeInitialHistoryLoadingrestored inagent-panel.tsxVoiceTransportattachment/generation parameters back on the client voice methodssendBehavior: "queue"is upstream 0.16 and stays; that is coverage on a feature this PR does not touch.daemon-executions.test.tssubscription tracking rewritten in the shared Hub harness@getpaseo/expo-two-way-audioinaudio-engine.native.ts