Post-Rust-rewrite cleanup: removes dead, unused and redundant code left over after #389 (the Rust core rewrite), and fixes a few bugs found along the way. Net change is +3.6k / −57.8k lines across 616 files, split into three commits by area.
tracing:: events, but no subscriber was ever installed. cowork-server and cowork-cli now install a stderr subscriber (RUST_LOG, default warn, ANSI only on a TTY). Electron reads the handshake from stdout only, so stderr is safe./cowork/fs/* routes used a plain File::open on Windows (no FILE_FLAG_OPEN_REPARSE_POINT), and same_file_identity always returned true. The three copies are replaced by one shared cowork-storage::safe_open with the hardened behavior.cowork/todos, cowork/log, error and cowork/session/backupState, but the desktop never subscribed to them. They now reach the existing reducer branches.refactor(rust): …)cargo-machete is clean) and ~50 pub items nothing referenced, along with compat-only params and aliases.cowork-providers::connection (select_provider_transport / resolve_provider_connection). It replaces about six copies across harness skill_improvement and the server's turn, memory, fork and agent routes; behavior is unchanged.cowork-providers now calls cowork-sandbox's implementation instead of keeping its own copy.now_iso, pick_boolean, host_platform, web-search options and the reasoning-effort list.__sandbox-exec --print-command: prints the exact transformed launch as JSON. It shares one prepare path with real execution, and is what lets the TS sandbox go.cowork-server/src/turn_runner.rs → jsonrpc_turn.rs, so it's no longer confused with the harness turn runner.model_stream_chunk from the backpressure classification and the never-called persist_model_stream_chunks. The DB tables and migrations are kept.prompts/memory-{generator,consolidator}.md. They describe a tool-calling loop that the Rust generator doesn't implement.refactor(desktop,mobile): …)model_stream_chunk / model_stream_raw, so their handling and the ~2.7k-line replay stack are gone (modelStream*, openaiResponsesReplay, googleInteractionsStreamParts).SessionEvent types with no Rust producer;legacyToolLogs;chatRetry, toolFeedState, markdownPreview, activityGroups and tool-card helpers move to src/shared for both apps. Mobile's copy of markdownPreview had drifted.[@univerjs](/univerjs)/preset-sheets-* packages, plus mobile clsx and ws.COWORK_HARNESS_TERMINAL_LOGS;build_desktop_resources.ts, including the docs bundling that never shipped.chore: …)src/ modules deleted (23 files) along with their tests: idempotency ledger, tool retry, provider continuation, think tags, approval, subprocess and others. All of them have Rust equivalents.--print-command. Only src/platform/windowsSandboxHelper.ts and scripts/scratchRoots.ts remain.pricing.ts / costTracker.ts are trimmed to what the desktop uses.crates/cowork-protocol/src/ws_jsonrpc_schema.json is now the only copy; the identical 1 MB docs/generated copy and its generator are gone..claude/skills is now symlinks into .agents/skills;.cursor state, examples/, the vestigial package.json files field, duplicate scripts and historical TS-era docs;store.legacyTranscript.ts. It rebuilds assistant replies, reasoning and tool rows from assistant_message / reasoning / model_stream_chunk. Raw provider frames (model_stream_raw) are ignored, because normalized chunks mirror them. legacyTranscriptId lookups are kept (review feedback).test/office-wasm.integration.test.ts / linuxReadView now expect the Rust seccomp re-exec launcher, and bind-mount that binary read-only into the positive read view.bun run typecheck (root, desktop, tooling), mobile typecheck, bun run check and bun run knip;bun run docs:check and bun install --frozen-lockfile;cargo fmt, cargo check --workspace --all-targets (0 warnings), cargo clippy --workspace --all-targets -D warnings;cargo-machete.cargo check --target x86_64-pc-windows-gnu passes for storage, tools, providers, sandbox and server.bun run test: everything passes except 5 tests in 3 files, which fail the same way on main in the dev VM:
unzip;cargo test: everything passes except tests that need bubblewrap or LibreOffice, which the dev VM lacks and CI installs.This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
|---|---|---|---|
| 📝 Code Review | ✅ Completed 2026-11-12T02:52:36.961587Z | 56f372f | New commits |
| 🔒 Security Review | ✅ Completed 2026-11-12T02:57:01.819390Z | 56f372f | New commits |
Your 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.
chatgpt-codex-connector[bot] · · 2 file comments
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ff9861a98
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
chatgpt-codex-connector[bot] · · 1 file comment
Here are some automated review suggestions for this pull request.
Reviewed commit: d91841ccbf
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
chatgpt-codex-connector[bot] · · 1 file comment
Here are some automated review suggestions for this pull request.
Reviewed commit: d5104d1b7b
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
chatgpt-codex-connector[bot] · · 2 file comments
Here are some automated review suggestions for this pull request.
Reviewed commit: 56f372ff03
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sign in to comment.
Update README.md
#125 mobile-fixes ← main
Updated 5 months ago
Preserve assistant replies when hydrating saved transcripts
For existing local transcripts containing assistant_message or model-stream events, removing these payload types makes mapTranscriptToFeed() replace saved replies with unhandled-event system rows rather than assistant messages. hydrateThreadSelection() still uses this mapper through its local-transcript fallback when no harness snapshot is available, so affected historical chats lose their displayed answers, and buildContextPreamble() omits those answers when continuing the conversation. Preserve decoding of persisted events until those transcripts have been migrated.
Useful? React with 👍 / 👎.
Fixed in b213a73. Old transcript events are decoded again, but only for transcripts, in apps/desktop/src/app/store.legacyTranscript.ts. Replay now restores assistant_message, reasoning / assistant_reasoning / reasoning_summary, and model_stream_chunk text, reasoning and tool parts, so it no longer shows "Unhandled event" rows. A final assistant_message that repeats streamed text is skipped. model_stream_raw and other retired diagnostic events are ignored. This means buildContextPreamble() gets the assistant replies again. Tests are in store-feed-mapping.transcript.test.ts.
Retain original transcript IDs until their files are migrated
For previously rekeyed threads, older transcript events can remain in the file identified by the persisted legacyTranscriptId; the previous rekey implementation explicitly retained that ID. This change stops looking up that file and also removes the field from persistence sanitization, without migrating the transcript files. When hydration falls back to local history, PersistenceService.readTranscript() reads only the requested filename and returns an empty array for missing files, so these threads now show incomplete or empty history. Retain the legacy lookup or migrate the files before dropping the field.
Useful? React with 👍 / 👎.
Fixed in b213a73. I restored legacyTranscriptId everywhere it was removed: the type, the desktop and Electron persistence sanitizers, the bootstrap schema and selection fallback, control-socket session merging and selection, and the jsonRpcWorkspace rekey bookkeeping. transcriptIdsForThread reads [legacyTranscriptId, sessionId, id] again, so rekeyed threads still load their original transcript files. The related test assertions are back too: archived-session-auto-delete, control-socket.sessions, thread-reconnect, and the fixtures.
Restore citation annotations when replaying legacy text
For saved transcripts whose citation metadata is carried by a text_end chunk, this default branch discards its annotations instead of attaching them to the streamed assistant message. The new transcript-only decoder restores reply text, but unlike the previous assistant_text_end handler, it never restores these annotations. Local-transcript hydration consequently displays answers without their clickable source citations, since FeedRow.tsx passes item.annotations to DesktopMarkdown. Preserve the text_end annotation handling in this decoder.
Useful? React with 👍 / 👎.
Fixed in d5104d1. applyLegacyModelStreamChunk now handles text_end chunks by validating part.annotations as an array of record objects and attaching them to the matching streamed assistant message (ignoring commentary phase chunks). Covered by a regression test in apps/desktop/test/store-feed-mapping.transcript.test.ts.
Restore streamed tool arguments during legacy transcript replay
For historical transcripts containing tool_input_start followed by tool_input_delta chunks without a final tool_call, this decoder silently drops every argument delta. Local-transcript hydration therefore restores the tool result but loses the command or file path that produced it. The previous mapper supported this sequence, explicitly covered by the removed coalesces multiple tool-input deltas and applies the authoritative final error test. Accumulate and decode these deltas into the matching tool item's arguments instead of ignoring them.
Useful? React with 👍 / 👎.
Fixed in 56f372f. applyLegacyModelStreamChunk now accumulates tool_input_delta chunks per tool key, decodes them with parseStructuredToolInput into the tool item's args (including on tool_input_end), and avoids clobbering streamed args when tool_call omits input. Covered by a regression test in apps/desktop/test/store-feed-mapping.transcript.test.ts.
Replay native search activity from saved provider frames
For historical transcripts containing native web searches, model_stream_raw frames are not redundant with the normalized tool chunks: the previous replay path reconstructed nativeWebSearch items from response.output_item.added/done events carrying web_search_call. Silencing these frames drops the search query, result, and source metadata during local-transcript hydration. The removed maps native web search raw events into visible tool feed activity regression test contains this exact sequence. Preserve transcript-only decoding for provider-native activity that normalized chunks do not reconstruct.
AGENTS.md reference: AGENTS.md:L83-L83
Useful? React with 👍 / 👎.
Reset step-local stream identities on repeated start events
When a saved turn contains multiple model steps that reuse a text stream ID, resetting only when turnId changes concatenates separate assistant replies. The removed multi-step replay test records start → text_delta(s1, "progress note") → finish → start → text_delta(s1, "final answer"); this decoder produces progress notefinal answer, then also appends the final assistant_message because its paragraph-separated text does not match. This corrupts both the restored feed and buildContextPreamble(). Handle repeated start boundaries by clearing step-local identities while retaining the history needed for final-message deduplication.
AGENTS.md reference: AGENTS.md:L83-L83
Useful? React with 👍 / 👎.
#393 main ← chore/post-rust-dead-code-cleanup
Updated yesterday