fix(desktop): remove Regenerate in favor of edit and resend - #5468
Conversation
a47aea8 to
d561312
Compare
d561312 to
b2a501e
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
Verified the removal end to end — this is a clean excision, and the semantics hold.
Removal is complete. turn.regenerate is gone from TURN_OPERATION_SPECS, TurnRegenerateInput, the remote-owner grant list, the interactive-turn coordinator handler map, prepareRegenerateTurn, RuntimeRegenerateTurnError, normalizeRegenerateTurnInput, the session-execution IPC handler, the client method, and the renderer regenerateTurn port — zero dangling references outside intentional lineage surfaces. The epoch-167 bump correctly rejects old peers that could still submit the operation.
Legacy terminalization is the right shape. The intent decode survives (SessionTurnRegenerateRequestIntent in session-collaboration.ts) — necessary, since durable access requests persisted before the upgrade must still load — while the coordinator now does !('content' in request.intent) → 'failed': approved-but-unexecuted regenerate intents reach a terminal state without executing and without hanging. Admission recovery additionally Excludes kind:'regenerate', so a persisted descriptor can't resurrect on restart. The new test pins exactly this (started === false, admission 'failed').
Replacement path is real, not just deletion. Side Chat's onEditUserMessage finds the user message for the turn and refills the composer via setText + focus — edit-and-resend is genuinely wired. No renderer constructs regenerate intents anymore; the owner approval/history UI is retained only to render legacy pendings, which is correct.
Lineage read-side preserved. regeneratedFromTurnId/regeneratedToTurnId still decode through core session/runtime-event and project through materialize.ts to badges — historical regeneration chains keep rendering.
P3s (none blocking):
packages/ui/src/conversation-copy.ts(~line 934): the truncated-output text still says "Regenerate it or inspect the persisted task log" — user-facing instruction pointing at a removed affordance. Reword to edit-and-resend or drop the clause.packages/ui/src/chat-view.tsx(~line 409): comment still says "a clickable regenerate/branch" — regenerate no longer exists; minor staleness.- Coordination note: #5503 also bumps the epoch to 167 — whichever lands second needs to renumber to 168.
Closes #5132.
Summary
Note
Edit & resend still cannot preserve attachments, quotes, or directory references. This temporary gap is tracked by #5109 and #5118.
Validation
npm run lintnpm run format:checknpm exec -- tsx --test apps/desktop/src/main/__tests__/app-shell-turn-actions.test.ts apps/desktop/src/main/__tests__/permission-response-ipc-boundary.test.ts apps/desktop/src/main/__tests__/workbar-services-adapter.test.ts packages/runtime-host/src/__tests__/session-collaboration-authority.test.tsnpm --workspace @maka/runtime run typechecknpm --workspace @maka/runtime-host run typechecknpm --workspace @maka/desktop run check:architectureDesktop typecheck is blocked only by three existing
packages/uiprop mismatches (autoScroll,settledText, andtrailingAction).AI disclosure: Prepared with OpenAI Codex at the contributor's request.