Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: keep graceful autopilot pause visible

[._.]/ Adam Eivy0f1d78ae1f71
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsx
index eef26a0542..88ecb365ff 100644
--- a/client/src/components/pipeline/AutopilotPanel.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.jsx
@@ -450,6 +450,7 @@ function Findings({ items }) {
export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate }) {
const seriesId = series?.id;
const [active, setActive] = useState(false);
+ const [pausePending, setPausePending] = useState(false);
const [starting, setStarting] = useState(false);
const [mode, setMode] = useState(null);
const [plan, setPlan] = useState(null);
@@ -733,6 +734,7 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
// SSE replays only the last frame, so the run's `start` frame comes back
// on the status payload instead — same shape, same reader.
if (s.start) applyStartFrame(s.start);
+ setPausePending(s.pauseRequested === true);
setActive(true);
})
.catch(() => null);
@@ -757,6 +759,7 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
// Ignore a terminal frame left over from a previous run (stale `latest`).
if (activeRunIdRef.current && latest.runId && latest.runId !== activeRunIdRef.current) return;
setActive(false);
+ setPausePending(false);
getPipelineSeries(seriesId, { silent: true }).then((s) => { if (s) onSeriesUpdateRef.current?.(s); }).catch(() => null);
listPipelineIssues(seriesId, { silent: true }).then((is) => onIssuesUpdateRef.current?.(Array.isArray(is) ? is : [])).catch(() => null);
if (latest.type === 'complete') {
@@ -836,11 +839,13 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
}, [seriesId, includeVisual, fileGaps, unlockForRun, readinessGate, providerOverride, modelOverride, effortOverride, separateJudgeLlm, judgeProviderOverride, judgeModelOverride, judgeEffortOverride, stageLlm, options, persistRounds]);
const cancel = useCallback(async () => {
+ setPausePending(false);
await cancelPipelineAutopilot(seriesId).catch(() => null);
}, [seriesId]);
const pause = useCallback(async () => {
- await pausePipelineAutopilot(seriesId).catch(() => null);
+ const result = await pausePipelineAutopilot(seriesId).catch(() => null);
+ setPausePending(result?.pauseRequested === true);
}, [seriesId]);
const checkCanon = useCallback(async () => {
@@ -859,7 +864,7 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
// disabled "Cancelling…" state so the user gets feedback (and can't re-fire
// cancel) while the active step finishes and the terminal frame arrives.
const canceling = active && latest?.type === 'cancel:acknowledged';
- const pausing = active && latest?.type === 'pause:acknowledged';
+ const pausing = active && (pausePending || latest?.type === 'pause:acknowledged');
const runLabel = ap?.status === 'paused' ? 'Resume autopilot'
: ap?.status === 'done' ? 'Run autopilot again'
: 'Run autopilot';
diff --git a/client/src/components/pipeline/AutopilotPanel.test.jsx b/client/src/components/pipeline/AutopilotPanel.test.jsx
index a9600cbb2f..8875daf7d1 100644
--- a/client/src/components/pipeline/AutopilotPanel.test.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.test.jsx
@@ -743,6 +743,18 @@ describe('AutopilotPanel', () => {
expect(screen.getByText(/pausing safely.*finishing the active step/i)).toBeInTheDocument();
});
+ it('keeps Pausing… sticky when a later progress frame replaces the acknowledgment', async () => {
+ getPipelineAutopilotStatus.mockResolvedValue({
+ autopilot: { status: 'running', runId: 'r1' },
+ active: true,
+ pauseRequested: true,
+ });
+ sseLatest = { type: 'foundation:round', runId: 'r1', round: 2, weightedScore: 7.2 };
+ renderPanel({ id: 's1', targetFormat: 'comic' });
+ expect(await screen.findByRole('button', { name: /pausing/i })).toBeDisabled();
+ expect(screen.getByRole('button', { name: /stop now/i })).toBeEnabled();
+ });
+
// Pipeline self-improvement — the opt-in that lets a run diagnose PortOS's own
// automation and file a fix task against it.
describe('pipeline self-improvement', () => {
diff --git a/server/routes/pipeline/autopilot.js b/server/routes/pipeline/autopilot.js
index 88baac7b0b..1b50cea8c0 100644
--- a/server/routes/pipeline/autopilot.js
+++ b/server/routes/pipeline/autopilot.js
@@ -248,6 +248,7 @@ router.get('/series/:id/autopilot/status', asyncHandler(async (req, res) => {
res.json({
autopilot: series.autopilot || null,
active: autopilot.isAutopilotActive(req.params.id),
+ pauseRequested: autopilot.isAutopilotPauseRequested(req.params.id),
// The in-flight run's `start` frame (mode, target, resolved provider/model),
// so a client attaching mid-run can describe a run it never saw begin — SSE
// replays only the last frame. null when no run is active.
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 8df0b6d525..e637966d4c 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -3167,11 +3167,13 @@ describe('autopilot conductor', () => {
const { runId } = await autopilot.startSeriesAutopilot(seriesId, { includeVisual: false });
const requested = autopilot.pauseSeriesAutopilot(seriesId);
expect(requested).toBe(true);
+ expect(autopilot.isAutopilotPauseRequested(seriesId)).toBe(true);
expect(autopilot.__testing.runs.get(seriesId)?.lastPayload).toMatchObject({
type: 'pause:acknowledged',
runId,
});
await waitFor(runFinished(seriesId));
+ expect(autopilot.isAutopilotPauseRequested(seriesId)).toBe(false);
const last = autopilot.__testing.runs.get(seriesId)?.lastPayload;
expect(last).toMatchObject({ type: 'paused', pauseKind: 'manual' });
expect(last?.reason).toMatch(/paused by user after the active step completed/i);
diff --git a/server/services/pipeline/seriesAutopilot/session.js b/server/services/pipeline/seriesAutopilot/session.js
index 98e8650bb7..221982e619 100644
--- a/server/services/pipeline/seriesAutopilot/session.js
+++ b/server/services/pipeline/seriesAutopilot/session.js
@@ -23,6 +23,11 @@ export function isAutopilotActive(seriesId) {
return !!run && !run.finished;
}
+export function isAutopilotPauseRequested(seriesId) {
+ const run = runs.get(seriesId);
+ return !!run && !run.finished && run.pauseRequested === true;
+}
+
// The `start` frame of an IN-FLIGHT run (null when none is active). Everything
// a client needs to describe a run it didn't watch begin — mode (the dry-run
// badge), target, the resolved run provider/model — lives on that frame, but