Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(plan): keep revision controls usable during approval
Linuxdazhaoe45d9f9ac1c7
diff --git a/apps/desktop/src/components/Composer.tsx b/apps/desktop/src/components/Composer.tsxindex e38062b16..e64ae73c5 100644--- a/apps/desktop/src/components/Composer.tsx+++ b/apps/desktop/src/components/Composer.tsx@@ -21,7 +21,7 @@ import {} from "@pi-desktop/shared";import { useAppStore } from "../stores/app-store";import { latestTurnContextInspector } from "../lib/latest-turn-context";-import { isActivePlanExecution } from "../lib/plan-mode-state";+import { isActivePlanExecution, pendingRevisionPlan } from "../lib/plan-mode-state";import { headAsk, queuedAskCount } from "../lib/pending-asks";import type { QueuedPrompt } from "../lib/queued-prompts";import { composerModelDisplayName, sameComposerModelId } from "../lib/composer-models";@@ -144,9 +144,11 @@ export function Composer({const planCheckpoint = useAppStore((s) =>s.activeSessionId ? s.planCheckpoints[s.activeSessionId] : undefined,);+ const pendingPlan = useAppStore((s) =>+ s.activeSessionId ? s.pendingPlans[s.activeSessionId] : undefined,+ );const approvalPending = planCheckpoint?.status === "pending";- const revisionPlan = approvalPending && planCheckpoint.kind !== "goal" && !remoteSession && !nativeSession- ? planCheckpoint : undefined;+ const revisionPlan = pendingRevisionPlan(activeSessionSummary, planCheckpoint, pendingPlan);const approvalBlocksInput = approvalPending && !revisionPlan;const pendingAsk = useAppStore((s) =>headAsk(s.pendingAsks, s.activeSessionId),diff --git a/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx b/apps/desktop/src/features/chat/composer/ComposerToolbar.tsxindex ba4a3a1d5..20bfacf7c 100644--- a/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx+++ b/apps/desktop/src/features/chat/composer/ComposerToolbar.tsx@@ -14,7 +14,7 @@ import { modeErrorMessage } from "../../modes/mode-run-model";import { ComposerPermissionPicker } from "./ComposerPermissionPicker";import { ContextUsageInspector } from "../../../components/ContextUsageInspector";import { ComposerControlSlots } from "./ComposerControlSlots";-import { Button, TooltipButton } from "../../../components/ui";+import { TooltipButton } from "../../../components/ui";import {IconArrowUp,IconPlus,@@ -245,18 +245,7 @@ export function ComposerToolbar({<IconUndo2 size={15} aria-hidden="true" /></TooltipButton>) : null}- {revisingPlan ? (- <Button- type="button"- size="sm"- variant="primary"- data-testid="send-plan-revision"- disabled={!hasDraftContent || sendBlocked || !modelReady}- onClick={() => void submit()}- >- {t("plan.sendRevision")}- </Button>- ) : runActive && !hasDraftContent ? (+ {runActive && !hasDraftContent ? (<TooltipButtontype="button"className="stop-btn"@@ -269,6 +258,18 @@ export function ComposerToolbar({><IconStop size={14} /></TooltipButton>+ ) : revisingPlan ? (+ <TooltipButton+ type="button"+ className="btn btn-primary composer-plan-revision"+ tooltip={t("plan.sendRevision")}+ data-testid="send-plan-revision"+ disabled={!hasDraftContent || sendBlocked || !modelReady}+ onClick={() => void submit()}+ >+ <span>{t("plan.sendRevision")}</span>+ <IconArrowUp size={16} aria-hidden="true" />+ </TooltipButton>) : (<TooltipButtontype="button"diff --git a/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts b/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.tsindex 46886f36b..69e6c02bd 100644--- a/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts+++ b/apps/desktop/src/features/chat/composer/hooks/useComposerAttachments.ts@@ -256,7 +256,12 @@ export function useComposerAttachments({if (!insertClipboardText(event.currentTarget, text)) {const current = draft.ref.current ? readEditorValue(draft.ref.current) : draft.valueRef.current;const { start, end } = editorSelectionRange(event.currentTarget);- draft.applyEditorDraft(current.slice(0, start) + text + current.slice(end), [], start + text.length);+ const inserted = normalizeClipboardLineEndings(text);+ const next = current.slice(0, start) + inserted + current.slice(end);+ const references = draft.fileReferencesRef.current.filter((reference) =>+ reference.sessionId !== (activeSessionId ?? "") || !reference.token || next.includes(reference.token),+ );+ draft.applyEditorDraft(next, references, start + inserted.length);}return;}diff --git a/apps/desktop/src/lib/plan-mode-state.ts b/apps/desktop/src/lib/plan-mode-state.tsindex 84162b868..a5177c005 100644--- a/apps/desktop/src/lib/plan-mode-state.ts+++ b/apps/desktop/src/lib/plan-mode-state.ts@@ -2,7 +2,9 @@ import type {GlobalPermissionMode,PlanProposal,PlanningStateEvent,+ SessionSummary,} from "@pi-desktop/shared";+import { isRemoteSession, sessionAllows } from "./remote-session-safety";/** Fail closed when no effective session permission is available. */export const PLAN_APPROVAL_DEFAULT_MODE: GlobalPermissionMode = "ask";@@ -33,6 +35,18 @@ export function isActivePlanExecution();}+export function pendingRevisionPlan(+ session: SessionSummary | undefined,+ checkpoint: PlanProposal | undefined,+ pending: PlanProposal | undefined,+): PlanProposal | undefined {+ if (session?.mode !== "plan" || session.source === "pi-native" ||+ isRemoteSession(session) || !sessionAllows(session, "canPrompt")) return;+ if (checkpoint?.status !== "pending" || checkpoint.kind === "goal" ||+ checkpoint.sessionId !== session.id) return;+ return pending?.status === "pending" && pending.id === checkpoint.id ? checkpoint : undefined;+}+export function planCheckpointStatus(proposal: PlanProposal,resolving = false,diff --git a/apps/desktop/src/stores/slices/queue-slice.ts b/apps/desktop/src/stores/slices/queue-slice.tsindex e2f5480ab..d9e3f8da4 100644--- a/apps/desktop/src/stores/slices/queue-slice.ts+++ b/apps/desktop/src/stores/slices/queue-slice.ts@@ -8,6 +8,7 @@ import type {QueuedTurnSummary,} from "@pi-desktop/shared";import { api } from "../../lib/api";+import { pendingRevisionPlan } from "../../lib/plan-mode-state";import { isRemoteSession, sessionAllows } from "../../lib/remote-session-safety";import {enqueueQueuedPrompt,@@ -388,9 +389,9 @@ export function createQueueSlice({const { id, sessionId, turnId, toolCallId, version } = proposal;const session = get().sessions.find((row) => row.id === sessionId);const key = `revision:${id}`;- if (!session || session.mode !== "plan" || isRemoteSession(session) || session.source === "pi-native") return false;- if (!sessionAllows(session, "canPrompt") || (draft?.fileReferences.length && !sessionAllows(session, "canAttach"))) return false;- if (!content.trim() || proposal.kind === "goal" || get().pendingPlans[sessionId]?.id !== id) return false;+ const current = pendingRevisionPlan(session, get().planCheckpoints[sessionId], get().pendingPlans[sessionId]);+ if (current?.id !== id || !content.trim()) return false;+ if (draft?.fileReferences.length && !sessionAllows(session, "canAttach")) return false;if (get().runningSessions[sessionId] || pendingSubmissions.has(key)) return false;pendingSubmissions.add(key);try {diff --git a/apps/desktop/src/styles/composer.css b/apps/desktop/src/styles/composer.cssindex 953af0150..80825ff5d 100644--- a/apps/desktop/src/styles/composer.css+++ b/apps/desktop/src/styles/composer.css@@ -454,6 +454,32 @@min-height: 28px;}+.composer-plan-revision {+ height: 28px;+ flex: 0 0 auto;+ padding: 0 10px;+ white-space: nowrap;+}++.composer-plan-revision svg {+ display: none;+}++@container composer-stack (max-width: 640px) {+ .composer-plan-revision {+ width: 28px;+ padding: 0;+ }++ .composer-plan-revision span {+ display: none;+ }++ .composer-plan-revision svg {+ display: block;+ }+}+.icon-btn {display: inline-flex;height: 28px;diff --git a/apps/desktop/test/composer-directory-paste.test.mjs b/apps/desktop/test/composer-directory-paste.test.mjsindex 36359a337..488fe904a 100644--- a/apps/desktop/test/composer-directory-paste.test.mjs+++ b/apps/desktop/test/composer-directory-paste.test.mjs@@ -18,7 +18,9 @@ function extract(source, name) {return result;}-function harness(native, { files = [], text = "", items = [], paused, sourceSessionId = "source" } = {}) {+function harness(native, { files = [], text = "", items = [], paused, sourceSessionId = "source",+ attachmentsAllowed = true, insertSucceeds = true, references = [], selection = { start: 7, end: 7 },+} = {}) {const read = path => readFileSync(new URL(path, import.meta.url), "utf8");const editor = read("../src/features/chat/composer/editor.ts");const hook = read("../src/features/chat/composer/hooks/useComposerAttachments.ts");@@ -29,7 +31,7 @@ function harness(native, { files = [], text = "", items = [], paused, sourceSesslet workspacePath = "/synthetic/project";const element = { textContent: "before after" };const context = {- inputBlocked: false, attachmentsAllowed: true, activeSessionId,+ inputBlocked: false, attachmentsAllowed, activeSessionId, fileReferencesRef: { current: references },draftKey: sourceSessionId ?? "home", largePasteThreshold: 1000,ref: { current: element }, valueRef: { current: element.textContent },previousWorkspacePathRef: { current: "/synthetic/project" },@@ -43,7 +45,7 @@ function harness(native, { files = [], text = "", items = [], paused, sourceSessmodule: { exports: {} }, Array, TextEncoder, crypto, FILE_LINES_CLIPBOARD_TYPE,context: () => context, ...context, draft: context, isInputBlocked: false,setPasting() {}, readEditorValue: editor => editor.textContent,- editorSelectionRange: () => ({ start: 7, end: 7 }),+ editorSelectionRange: () => selection,pasteSessionLinks: () => false, parseSessionLinks: () => [],showErrorToast: error => errors.push(error.message),api: {@@ -67,12 +69,13 @@ function harness(native, { files = [], text = "", items = [], paused, sourceSessreadComposerDraftRevision: () => revision,readComposerDraft: () => undefined,document: { execCommand: (_command, _showUi, text) => { textInsertions.push(text); return true; } },- insertClipboardText: (_editor, text) => { textInsertions.push(text); return true; },+ insertClipboardText: (_editor, text) => { textInsertions.push(text); return insertSucceeds; },deleteComposerDraft() {}, HOME_DRAFT_KEY: "home",useAppStore: { getState: () => ({ activeSessionId, workspace: { path: workspacePath }, sessions: [{ id: "source" }, { id: "created" }] }) },materializeDraftSession: async () => { created.push(workspacePath); activeSessionId = "created"; return "created"; },};- const code = extract(editor, "clipboardFiles") + "\n" + extract(editor, "preferClipboardText") + "\nmodule.exports = " + extract(hook, "pasteClipboardFiles");+ const code = ["clipboardFiles", "preferClipboardText", "normalizeClipboardLineEndings"].map(name => extract(editor, name)).join("\n")+ + "\nmodule.exports = " + extract(hook, "pasteClipboardFiles");vm.runInNewContext(ts.transpileModule(code, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText, environment);return {drafts, errors, writes, imported, transfers, created, nativeReads, textInsertions,@@ -88,6 +91,21 @@ function harness(native, { files = [], text = "", items = [], paused, sourceSess}const folder = { kind: "directory", path: "/synthetic/copied folder", name: "copied folder" };+test("plain-text paste fallback keeps existing references except a chip replaced by the selection", async () => {+ const kept = { token: "\ue001", sessionId: "source" };+ const replaced = { token: "\ue002", sessionId: "source" };+ const directory = { ...folder, sessionId: "source" };+ const run = harness(null, {+ attachmentsAllowed: false, insertSucceeds: false, text: "two\r\nlines",+ references: [kept, replaced, directory], selection: { start: 2, end: 3 },+ });+ run.edit("\ue001 \ue002");+ await run.paste();+ assert.equal(run.drafts[0].text, "\ue001 two\nlines");+ assert.deepEqual(Array.from(run.drafts[0].references), [kept, directory]);+ assert.deepEqual(run.nativeReads, []);+});+test("paste uses native directory paths even when Chromium exposes no File", async () => {const run = harness({ items: [folder], token: null });await run.paste();diff --git a/apps/desktop/test/composer-input-history.test.mjs b/apps/desktop/test/composer-input-history.test.mjsindex 0d3b37bcc..b1afb8542 100644--- a/apps/desktop/test/composer-input-history.test.mjs+++ b/apps/desktop/test/composer-input-history.test.mjs@@ -352,7 +352,7 @@ test("the composer wires recall, its exits, and the record point (AC3)", async (// leave browsing before the draft is cleared.assert.match(composer,- /const submitFromComposer = \(steering\?: boolean\) => \{\s*inputHistory\.exitBrowsing\(\);\s*return submit\(steering\);\s*\};/,+ /const submitFromComposer = \(steering\?: boolean\) => \{\s*inputHistory\.exitBrowsing\(\);\s*return submit\(revisionPlan \? false : steering\);\s*\};/,);assert.match(composer, /onSubmit=\{\(steering\) => void submitFromComposer\(steering\)\}/);assert.match(composer, /submit=\{submitFromComposer\}/);diff --git a/apps/desktop/test/composer-send-state.test.mjs b/apps/desktop/test/composer-send-state.test.mjsindex 705d13e0a..2231738c0 100644--- a/apps/desktop/test/composer-send-state.test.mjs+++ b/apps/desktop/test/composer-send-state.test.mjs@@ -8,6 +8,8 @@ import {import assert from "node:assert/strict";import { readFile } from "node:fs/promises";import test from "node:test";+import { slotSsr } from "./helpers/slot-ssr.mjs";+import { composerToolbar } from "./helpers/composer-toolbar.mjs";const read = (path) => readFile(new URL(path, import.meta.url), "utf8");@@ -47,6 +49,15 @@ const [const queuedPromptsLib = await read("../src/lib/queued-prompts.ts");+test("an empty pending Plan keeps Stop available while the original turn finishes", async t => {+ const toolbar = await composerToolbar(t, await slotSsr(t), {+ mode: "plan", revisingPlan: true, runActive: true, sendBlocked: true, stopAllowed: true,+ });+ const html = toolbar();+ assert.match(html, /<button[^>]*class="stop-btn"[^>]*>/);+ assert.doesNotMatch(html, /<button[^>]*class="stop-btn"[^>]*disabled|data-testid="send-plan-revision"/);+});+test("composer send/stop button follows draft content and the visible session's run state", () => {const composerRight = toolbar.match(/<div className="composer-right">[\s\S]*?<\/div>\s*<\/div>/)?.[0] ?? "";// Plan mode widens the running condition: `runActive` folds an in-flightdiff --git a/apps/desktop/test/plan-renderer-flow.test.mjs b/apps/desktop/test/plan-renderer-flow.test.mjsindex 56c215e5e..14b0dc3a1 100644--- a/apps/desktop/test/plan-renderer-flow.test.mjs+++ b/apps/desktop/test/plan-renderer-flow.test.mjs@@ -61,7 +61,7 @@ test("only a local Plan exposes revision input while approval gates configuratiocomposer,/const controlsBlocked = approvalPending \|\| nativeSession \|\| !sessionAllows\(capabilitySession, "canConfigureModel"\);/,);- assert.match(composer, /approvalPending && planCheckpoint.kind !== "goal" && !remoteSession && !nativeSession/);+ assert.match(composer, /pendingRevisionPlan\(activeSessionSummary, planCheckpoint, pendingPlan\)/);assert.match(store, /pendingPlans\[sessionId\]\?\.status === "pending"/);assert.match(store, /pendingPlans\[resolution\.sessionId\]/);});diff --git a/apps/desktop/test/plan-revision.test.mjs b/apps/desktop/test/plan-revision.test.mjsindex 7711dd18b..f7bed018e 100644--- a/apps/desktop/test/plan-revision.test.mjs+++ b/apps/desktop/test/plan-revision.test.mjs@@ -4,6 +4,7 @@ import test from "node:test";register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));const { createQueueSlice } = await import("../src/stores/slices/queue-slice.ts");+const { pendingRevisionPlan } = await import("../src/lib/plan-mode-state.ts");function fixture(t) {const plan = { id: "p1", sessionId: "s1", turnId: "t1", toolCallId: "c1", version: 1, kind: "plan", status: "pending" };@@ -51,3 +52,27 @@ test("a still-finishing submission leaves the first plan pending and the draft aassert.equal(await send(), false);assert.equal(state.resolvePlan.mock.callCount(), 0);});++test("only the current editable local Plan checkpoint can be revised", async t => {+ const { state, plan, send } = fixture(t);+ const session = state.sessions[0];+ assert.equal(pendingRevisionPlan(session, plan, plan), plan);+ for (const [target, checkpoint, pending] of [+ [undefined, plan, plan],+ [{ ...session, mode: "agent" }, plan, plan],+ [{ ...session, source: "pi-native" }, plan, plan],+ [{ ...session, source: "remote" }, plan, plan],+ [{ ...session, capabilities: { canPrompt: false } }, plan, plan],+ [session, { ...plan, kind: "goal" }, plan],+ [session, { ...plan, status: "approved" }, plan],+ [session, plan, undefined],+ [session, plan, { ...plan, id: "p2" }],+ ]) {+ assert.equal(pendingRevisionPlan(target, checkpoint, pending), undefined);+ state.sessions = target ? [target] : [];+ state.planCheckpoints.s1 = checkpoint;+ state.pendingPlans.s1 = pending;+ assert.equal(await send(), false);+ }+ assert.equal(state.resolvePlan.mock.callCount(), 0);+});diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.mdindex 1e493b084..f54899749 100644--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@ -3346,7 +3346,7 @@ reasoning-level control.| Context checkpoint | Same as Running until durable checkpoint completion; intermediate `turn_end` does not reactivate controls. A retained-tail fallback remains Running and shows a warning toast | Same single-slot Stop/Send behavior as Running || Permission pending | textarea disabled (per [03-permission-ux.md](03-permission-ux.md) §7) | Send disabled; Stop remains active whenever the running empty-draft condition is met || Plan / Goal / planning | textarea active while idle; contract badge and permission chip visible; mode chip pulses while the live turn projects `planning` | inspect, send, or submit a contract |-| Local Plan awaiting approval | Chat input accepts revision instructions. The card shows the title and artifact opener. Configuration controls stay locked. | Send revision request, approve, or reject |+| Local Plan awaiting approval | Chat input accepts revision instructions when the displayed proposal matches the session's pending Plan. The card shows the title and artifact opener. Configuration controls stay locked. | Send revision request, approve, or reject. An empty composer keeps Stop available while the original turn finishes. || Legacy Goal or remote approval | Draft remains read-only while the approval is pending. | Approve or reject || Plan / queued or running | Agent badge remains selected; queue/running state is visible; draft and next-turn controls remain editable | Stop; Send queues the next prompt; no replay control || Plan / Goal / planning after rejected, expired, or interrupted proposal | contract chip remains visible and editable | send a later prompt; submit a new contract; no execution action |diff --git a/docs/spec/06-delivery/e2e/plans-goals-automation.md b/docs/spec/06-delivery/e2e/plans-goals-automation.mdindex 89ae3b60d..f8da778ce 100644--- a/docs/spec/06-delivery/e2e/plans-goals-automation.md+++ b/docs/spec/06-delivery/e2e/plans-goals-automation.md@@ -220,7 +220,9 @@ being fetched on every subsequent poll.live state to editable planning. The later prompt/resubmission creates asecond complete Markdown snapshot and a different `.pi/plan/*.md` artifact.Also exercise that sequence by typing a revision in the pending Plan composer- and sending it. Typing leaves the first proposal pending. Sending rejects it+ and sending it. With a long localized action label, verify the toolbar keeps+ its controls on one line at 450–768 px and the compact send button retains+ its accessible name. Typing leaves the first proposal pending. Sending rejects itand delivers the revision once to the same Plan session. The revised proposalawaits approval with the Session's original permission. The first artifactretains its original bytes. Approving the second proposal withdiff --git a/scripts/e2e-plan-ui.mjs b/scripts/e2e-plan-ui.mjsindex 9426b3401..57d281bb5 100644--- a/scripts/e2e-plan-ui.mjs+++ b/scripts/e2e-plan-ui.mjs@@ -1499,6 +1499,43 @@ async function runLiveAcceptance(state) {return `provider=${setup.providerId} model=${setup.modelId} runtime=${pendingRuntime.runtimeId} marker=${LIVE_MARKER} artifact=${artifact.artifactPath}`;}+async function assertRevisionToolbarFits(state) {+ const samples = await state.cdp.evaluate(`(() => {+ const button = document.querySelector('[data-testid="send-plan-revision"]');+ const stack = button.closest(".composer-stack");+ const toolbar = button.closest(".composer-toolbar");+ const saved = stack.style.cssText;+ try {+ stack.style.transition = "none";+ stack.style.flex = "none";+ return [450, 451, 480, 481, 560, 561, 640, 641, 768].map(width => {+ stack.style.width = width + "px";+ const row = toolbar.getBoundingClientRect();+ const controls = [...toolbar.querySelectorAll("button")]+ .map(node => ({ ...node.getBoundingClientRect().toJSON(), name: node.className })).filter(box => box.width && box.height)+ .sort((a, b) => a.left - b.left);+ const range = document.createRange();+ range.selectNodeContents(button.querySelector("span"));+ return {+ width, actual: stack.getBoundingClientRect().width, label: button.getAttribute("aria-label"),+ height: button.getBoundingClientRect().height, lines: range.getClientRects().length,+ icon: button.querySelector("svg").getBoundingClientRect().width > 0,+ crowded: controls.filter((box, i) => box.left < row.left - 1 || box.right > row.right + 1 ||+ (i && box.left < controls[i - 1].right - 1)).map(box => box.name),+ };+ });+ } finally {+ stack.style.cssText = saved;+ }+ })()`);+ for (const sample of samples) {+ const labelFits = sample.width <= 640 ? sample.icon && sample.lines === 0 : !sample.icon && sample.lines === 1;+ assert(sample.label === "Enviar pedido de alteração" && sample.actual === sample.width &&+ sample.height === 28 && labelFits && !sample.crowded.length,+ `revision toolbar at ${sample.width}px: ${jsonText(samples)}`);+ }+}+async function runRevisionAcceptance(state) {const revision = "Remove deployment and keep only the installation steps.";const revisedPlan = { title: "Installation", markdown: "# Installation\n\n- Install the app.", question: "Approve?" };@@ -1527,11 +1564,13 @@ async function runRevisionAcceptance(state) {const { session } = await getPreloadResult(state, "sessionCreate", [{title: "Revise a plan", mode: "plan", projectPath: state.workspace, providerId: provider.id, modelId: model,}]);+ await setLanguage(state, "pt-BR");await reloadRenderer(state);await selectSession(state, session.id);await submitComposerPrompt(state, "Plan installation and deployment.");const first = await waitFor(() => getPendingPlan(state, session.id), "first plan", state);await fillComposerPrompt(state, revision);+ await assertRevisionToolbarFits(state);assert((await getPendingPlan(state, session.id))?.id === first.id, "typing resolved the pending approval");await clickSelector(state, '[data-testid="send-plan-revision"]', "send plan revision");const revised = await waitFor(async () => {@@ -1547,6 +1586,7 @@ async function runRevisionAcceptance(state) {await verifyArtifact(state, revised, revisedPlan);assert(first.artifact.relativePath !== revised.artifact.relativePath, "revision reused the first artifact");await clickSelector(state, ".plan-approval-reject", "dismiss second plan");+ await setLanguage(state, "zh-CN");record("E2E-106-plan-revision", true, "same-session revision produced a second immutable plan awaiting explicit approval");} finally {server.closeAllConnections();