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

name the AI provider/model an autonomous series run will use, and let one run override it

[._.]/ Adam Eivya2cc5b2a3a6a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 32cc3a44b1..827cc56201 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -1,7 +1,13 @@
# Unreleased
+## Added
+
+- Series Pipeline **Autonomous mode** now says which AI it will spend on. The Options popover names the provider and model the run resolves to, links to where per-stage pins and reasoning effort are configured, and offers a per-run provider/model override (never persisted — a one-off run can't silently re-point the whole series). The live progress line names the provider of an in-flight run too, including one the scheduler started.
+
## Fixed
+- A manual Autonomous-mode run now uses the series' own configured AI provider (the picker in the series header), matching scheduled runs and every other Pipeline action. It previously ignored `series.llm` and ran on the install's active provider, so the series header said one thing and the run did another. It stays a *soft* default: a stage pinned in Prompts keeps its pin, and an unavailable provider falls back instead of failing the run.
+
- Series Pipeline and Manuscript Editor pages can now scroll through their full content on mobile.
- CoS agents whose deliverable is a **commit** are no longer scored as failures. The idle reaper's "did this agent do anything?" gate read only *uncommitted* changes, so a `/do:release` or `/do:pr` run that committed, pushed, and opened its PR — leaving a clean tree *because it succeeded* — was recorded as `idle-no-changes` and retried. Two consecutive release runs on 2026-08-08 each did their whole job (cut the release commit, opened the release PR, then repaired it against review findings) and were both reported failed, holding the release for two days. The gate now counts commits made inside the run window as evidence of work, alongside a dirty tree. The report-shaped half of the same problem (`/do:review`, `/do:scan`, `/do:plan-task`, `/do:replan`, whose deliverable lands outside the repo) is tracked in #3636, and the unsatisfiable `[task-<id>]` success criterion one layer up in #3637.
diff --git a/client/src/components/pipeline/AutopilotPanel.jsx b/client/src/components/pipeline/AutopilotPanel.jsx
index ee283e2cb1..9f37c4d298 100644
--- a/client/src/components/pipeline/AutopilotPanel.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.jsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useRef, useState } from 'react';
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Link } from 'react-router';
import {
Rocket, Loader2, X, Sliders, ShieldCheck, AlertCircle, CheckCircle2,
@@ -14,9 +14,12 @@ import {
getPipelineSeriesCanonReadiness,
getPipelineSeries,
listPipelineIssues,
+ getProviders,
getSettings,
patchSettingsSlice,
} from '../../services/api';
+import { providerDisplayName, assignmentModelOptions, resolveSeriesRunLlm } from '../../utils/providers';
+import ProviderModelSelector from '../ProviderModelSelector';
import SeriesAutopilotSchedule from './SeriesAutopilotSchedule';
// Convergence-round bounds — mirror the server (seriesAutopilot.js + the
@@ -273,6 +276,46 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
const foundationRoundsEditedRef = useRef(false);
const [canon, setCanon] = useState(null);
const [canonLoading, setCanonLoading] = useState(false);
+ // Per-run provider/model override. '' = "use the series default", i.e. the
+ // provider picked in the series header (`series.llm`), falling back to the
+ // install's active provider — the same chain the server resolves in
+ // resolveAutopilotLlm, so the copy below names what will actually run. Per-run
+ // only (never persisted, like the readiness gate): pinning a different model
+ // for one run must not silently re-point every other action on the series.
+ const [providerOverride, setProviderOverride] = useState('');
+ const [modelOverride, setModelOverride] = useState('');
+ const [providers, setProviders] = useState([]);
+ const [activeProviderId, setActiveProviderId] = useState(null);
+ // Provider/model the ACTIVE run reported on its start frame — what the live
+ // progress line names, so a run started elsewhere (or by the scheduler) still
+ // says which provider it is spending on.
+ const [runLlm, setRunLlm] = useState(null);
+
+ useEffect(() => {
+ let canceled = false;
+ getProviders({ silent: true })
+ .then((data) => {
+ if (canceled) return;
+ setProviders(data?.providers || []);
+ setActiveProviderId(data?.activeProvider || null);
+ })
+ .catch(() => null); // picker degrades to the "series default" option only
+ return () => { canceled = true; };
+ }, []);
+
+ // Effective provider/model this run will use: per-run override → series.llm →
+ // active provider (the client mirror of the server's resolveAutopilotLlm), so
+ // the Options copy names what will actually run.
+ const seriesProviderId = series?.llm?.provider || '';
+ const { provider: effProviderId, model: effModel } = resolveSeriesRunLlm(series, {
+ overrideProvider: providerOverride,
+ overrideModel: modelOverride,
+ activeProviderId,
+ });
+ const providerModels = useMemo(
+ () => assignmentModelOptions(null, providers, effProviderId),
+ [providers, effProviderId],
+ );
// Load the persisted convergence-round defaults so the Options inputs reflect
// the install's setting. The autopilot reads the same setting server-side, so
@@ -372,6 +415,9 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
.then((s) => {
if (canceled || !s?.active) return;
activeRunIdRef.current = s.autopilot?.runId || null;
+ // The start frame is long gone for an in-flight run, so take the
+ // resolved provider/model from the status payload instead.
+ if (s.runLlm) setRunLlm(s.runLlm);
setActive(true);
})
.catch(() => null);
@@ -384,6 +430,9 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
useEffect(() => {
if (latest?.type === 'start') {
setMode(latest.mode || null);
+ // Resolved run provider/model (null when the run falls through to the
+ // active provider) — the live line names what this run is spending on.
+ setRunLlm({ provider: latest.provider || null, model: latest.model || null });
if (Array.isArray(latest.plan)) setPlan(latest.plan);
if (latest.planTotals) setPlanTotals(latest.planTotals);
} else if (latest?.type === 'complete' && latest.dryRun && Array.isArray(latest.plan)) {
@@ -448,7 +497,15 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
// specific gate. Unlike the round inputs we never persist it — '' leaves the
// server to resolve the gate from the saved setting (then the default).
const gateOverride = READINESS_GATE_LABELS[readinessGate] ? { readinessGate } : {};
- const res = await startPipelineAutopilot(seriesId, { includeVisual, fileGaps, ...roundOverrides, ...gateOverride }, { silent: true })
+ // Per-run provider/model override, sent ONLY when the user picked one —
+ // otherwise the server resolves the series' own llm (then the active
+ // provider). Never persisted, like the readiness gate. Picking a provider
+ // clears the model, so a sent model always belongs to the effective provider.
+ const llmOverride = {
+ ...(providerOverride ? { providerOverride } : {}),
+ ...(modelOverride ? { modelOverride } : {}),
+ };
+ const res = await startPipelineAutopilot(seriesId, { includeVisual, fileGaps, ...roundOverrides, ...gateOverride, ...llmOverride }, { silent: true })
.catch((err) => { toast.error(err.message || 'Could not start autopilot'); return null; });
setStarting(false);
if (!res) return;
@@ -458,7 +515,7 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
// effect can reject a stale terminal frame from the previous run.
activeRunIdRef.current = res.runId || null;
setActive(true);
- }, [seriesId, includeVisual, fileGaps, arcRounds, editorialRounds, beatContinuityRounds, checkPauseThreshold, notifyOnPause, revisionEnabled, revisionMinCycles, revisionMaxCycles, revisionPlateauDelta, foundationGate, foundationThreshold, foundationRounds, readinessGate, persistRounds]);
+ }, [seriesId, includeVisual, fileGaps, arcRounds, editorialRounds, beatContinuityRounds, checkPauseThreshold, notifyOnPause, revisionEnabled, revisionMinCycles, revisionMaxCycles, revisionPlateauDelta, foundationGate, foundationThreshold, foundationRounds, readinessGate, providerOverride, modelOverride, persistRounds]);
const cancel = useCallback(async () => {
await cancelPipelineAutopilot(seriesId).catch(() => null);
@@ -528,6 +585,38 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
{/* Options popover */}
{showOpts && !active ? (
<div className="px-3 pb-3 flex flex-col gap-2 border-t border-port-border pt-3">
+ {/* Which AI actually runs. The panel used to name none of this, so the
+ only way to know what a run would spend on was to read the code. */}
+ <div className="rounded-lg border border-port-border bg-port-bg/60 p-2.5 flex flex-col gap-2">
+ <p className="text-[11px] text-gray-400 leading-relaxed">
+ This run calls{' '}
+ <span className="text-gray-200 font-medium">{providerDisplayName(providers, effProviderId, '—')}</span>
+ {effModel ? <> / <span className="text-gray-200 font-medium">{effModel}</span></> : <> (provider default model)</>}
+ . Stages pinned to their own provider/model in{' '}
+ <Link to="/prompts" className="text-port-accent hover:underline">Prompts</Link>{' '}
+ keep that pin; everything else uses the provider above. Reasoning
+ effort isn&apos;t a per-run pipeline control — it comes from the
+ provider&apos;s own CLI configuration (or a model id that bakes in a
+ tier) on the{' '}
+ <Link to="/ai" className="text-port-accent hover:underline">AI Providers</Link> page.
+ </p>
+ <div className="max-w-md">
+ <ProviderModelSelector
+ providers={providers}
+ selectedProviderId={providerOverride}
+ effectiveProviderId={effProviderId}
+ selectedModel={modelOverride}
+ availableModels={providerModels}
+ onProviderChange={(id) => { setProviderOverride(id); setModelOverride(''); }}
+ onModelChange={setModelOverride}
+ label="Override provider for this run"
+ compact
+ alwaysShowModel
+ emptyProviderOption={`Series default (${providerDisplayName(providers, seriesProviderId || activeProviderId, '—')})`}
+ emptyModelOption={series?.llm?.model && !providerOverride ? `Series default (${series.llm.model})` : 'Default model'}
+ />
+ </div>
+ </div>
<label className="flex items-center gap-2 text-xs text-gray-300">
<input type="checkbox" checked={includeVisual} onChange={(e) => setIncludeVisual(e.target.checked)} />
Draft cover + all interior pages (comic targets)
@@ -702,6 +791,12 @@ export default function AutopilotPanel({ series, onSeriesUpdate, onIssuesUpdate
{mode === 'dry-run' ? <span className="uppercase tracking-wider text-[10px] text-port-accent">dry-run</span> : null}
{liveLabel}
</div>
+ {/* Name the provider/model this run resolved to, so an in-flight run
+ (including one the scheduler started) says what it is spending on. */}
+ <div className="mt-1 text-[11px] text-gray-500">
+ on {providerDisplayName(providers, runLlm?.provider || activeProviderId, '—')}
+ {runLlm?.model ? ` / ${runLlm.model}` : ' (provider default model)'}
+ </div>
{frames?.length ? (
<div className="mt-2 max-h-28 overflow-y-auto text-[11px] text-gray-500 space-y-0.5">
{frames.slice(-6).map((f, i) => <div key={i}>{frameLabel(f)}</div>)}
diff --git a/client/src/components/pipeline/AutopilotPanel.test.jsx b/client/src/components/pipeline/AutopilotPanel.test.jsx
index bdd1ae15fb..bc6e7952ae 100644
--- a/client/src/components/pipeline/AutopilotPanel.test.jsx
+++ b/client/src/components/pipeline/AutopilotPanel.test.jsx
@@ -10,6 +10,7 @@ vi.mock('../../services/api', () => ({
getPipelineSeriesCanonReadiness: vi.fn(),
getPipelineSeries: vi.fn(),
listPipelineIssues: vi.fn(),
+ getProviders: vi.fn(),
getSettings: vi.fn(),
patchSettingsSlice: vi.fn(),
}));
@@ -26,6 +27,7 @@ import {
startPipelineAutopilot,
getPipelineAutopilotStatus,
getPipelineSeriesCanonReadiness,
+ getProviders,
getSettings,
patchSettingsSlice,
} from '../../services/api';
@@ -47,6 +49,13 @@ beforeEach(() => {
startPipelineAutopilot.mockResolvedValue({ runId: 'r1', mode: 'execute', alreadyRunning: false });
getSettings.mockResolvedValue({ pipelineEditorialChecks: {} });
patchSettingsSlice.mockResolvedValue({});
+ getProviders.mockResolvedValue({
+ activeProvider: 'claude',
+ providers: [
+ { id: 'claude', name: 'Claude Code', type: 'cli', enabled: true, models: ['claude-opus-5'] },
+ { id: 'codex', name: 'Codex', type: 'cli', enabled: true, models: ['gpt-5-codex'] },
+ ],
+ });
});
describe('AutopilotPanel', () => {
@@ -135,6 +144,65 @@ describe('AutopilotPanel', () => {
));
});
+ it('names the provider/model the run will call — the series llm', async () => {
+ renderPanel({ id: 's1', targetFormat: 'comic', llm: { provider: 'codex', model: 'gpt-5-codex' } });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ fireEvent.click(screen.getByRole('button', { name: /options/i }));
+ const summary = await screen.findByText(/This run calls/i);
+ await waitFor(() => expect(summary).toHaveTextContent('Codex / gpt-5-codex'));
+ });
+
+ it('falls back to the active provider when the series pins no llm', async () => {
+ renderPanel({ id: 's1', targetFormat: 'comic' });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ fireEvent.click(screen.getByRole('button', { name: /options/i }));
+ const summary = await screen.findByText(/This run calls/i);
+ await waitFor(() => expect(summary).toHaveTextContent('Claude Code (provider default model)'));
+ });
+
+ it('sends a picked provider/model as a per-run override without persisting it', async () => {
+ renderPanel({ id: 's1', targetFormat: 'comic', llm: { provider: 'claude', model: 'claude-opus-5' } });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ fireEvent.click(screen.getByRole('button', { name: /options/i }));
+ const providerSelect = await screen.findByLabelText('Override provider for this run');
+ fireEvent.change(providerSelect, { target: { value: 'codex' } });
+ // Switching providers drops the series model — it belongs to the old provider.
+ await waitFor(() => expect(screen.getByLabelText('Model')).toHaveValue(''));
+ fireEvent.change(screen.getByLabelText('Model'), { target: { value: 'gpt-5-codex' } });
+ fireEvent.click(screen.getByRole('button', { name: /run autopilot/i }));
+ await waitFor(() => expect(startPipelineAutopilot).toHaveBeenCalledWith(
+ 's1',
+ { includeVisual: true, fileGaps: false, providerOverride: 'codex', modelOverride: 'gpt-5-codex' },
+ { silent: true },
+ ));
+ expect(patchSettingsSlice).not.toHaveBeenCalledWith(
+ 'pipelineEditorialChecks',
+ expect.objectContaining({ providerOverride: expect.anything() }),
+ expect.anything(),
+ );
+ });
+
+ it('omits the provider override when left on the series default', async () => {
+ renderPanel({ id: 's1', targetFormat: 'comic', llm: { provider: 'codex', model: 'gpt-5-codex' } });
+ await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
+ fireEvent.click(screen.getByRole('button', { name: /options/i }));
+ fireEvent.click(screen.getByRole('button', { name: /run autopilot/i }));
+ // Nothing pinned → the server resolves series.llm itself.
+ await waitFor(() => expect(startPipelineAutopilot).toHaveBeenCalledWith(
+ 's1', { includeVisual: true, fileGaps: false }, { silent: true },
+ ));
+ });
+
+ it('names the in-flight run provider when re-attaching mid-run', async () => {
+ getPipelineAutopilotStatus.mockResolvedValue({
+ autopilot: { status: 'running', runId: 'r1' },
+ active: true,
+ runLlm: { provider: 'codex', model: 'gpt-5-codex' },
+ });
+ renderPanel({ id: 's1', targetFormat: 'comic' });
+ expect(await screen.findByText(/on Codex \/ gpt-5-codex/)).toBeInTheDocument();
+ });
+
it('clears to the default (not 0) when a round input is emptied', async () => {
renderPanel({ id: 's1', targetFormat: 'comic' });
await waitFor(() => expect(getPipelineAutopilotStatus).toHaveBeenCalled());
diff --git a/client/src/components/pipeline/SeriesAutopilotSchedule.jsx b/client/src/components/pipeline/SeriesAutopilotSchedule.jsx
index ce60c20b28..4bc3899305 100644
--- a/client/src/components/pipeline/SeriesAutopilotSchedule.jsx
+++ b/client/src/components/pipeline/SeriesAutopilotSchedule.jsx
@@ -4,7 +4,7 @@ import { getSettings, patchSettingsSlice } from '../../services/apiSystem';
import { getProviders } from '../../services/apiProviders';
import { getCosConfig } from '../../services/apiAgents';
import { describeCron } from '../../utils/cronHelpers';
-import { providerDisplayName, assignmentModelOptions } from '../../utils/providers';
+import { providerDisplayName, assignmentModelOptions, resolveSeriesRunLlm } from '../../utils/providers';
import BrailleSpinner from '../BrailleSpinner';
import CronInput from '../CronInput';
import ProviderModelSelector from '../ProviderModelSelector';
@@ -75,14 +75,14 @@ export default function SeriesAutopilotSchedule({ series }) {
}, [seriesId]);
// Effective provider/model the scheduled run will use: schedule override →
- // series' own llm → the active provider. Mirrors startSeriesAutopilot's
- // provider resolution so the consent copy names what will actually run. Only
- // inherit the series' MODEL when the effective provider IS the series provider
- // — an override to a different provider uses that provider's default model, so
- // showing the series' model would misname what runs.
- const effProviderId = entry?.provider || series?.llm?.provider || activeProviderId || '';
- const inheritsSeriesLlm = !entry?.provider || entry.provider === series?.llm?.provider;
- const effModel = entry?.model || (inheritsSeriesLlm ? series?.llm?.model || '' : '');
+ // series' own llm → the active provider. Shares `resolveSeriesRunLlm` with the
+ // Autopilot Options picker (and mirrors startSeriesAutopilot's own resolution)
+ // so both surfaces name the same thing.
+ const { provider: effProviderId, model: effModel } = resolveSeriesRunLlm(series, {
+ overrideProvider: entry?.provider,
+ overrideModel: entry?.model,
+ activeProviderId,
+ });
const providerLabel = (id) => providerDisplayName(providers, id, '—');
const providerModels = useMemo(
() => assignmentModelOptions(null, providers, effProviderId),
diff --git a/client/src/utils/providers.js b/client/src/utils/providers.js
index f51bb60602..7f3130a4ec 100644
--- a/client/src/utils/providers.js
+++ b/client/src/utils/providers.js
@@ -782,6 +782,30 @@ export const providerTypeClass = (type) => {
// pre-baked `providerOptions` / `modelOptions` overrides for runtime call sites.
// ---------------------------------------------------------------------------
+/**
+ * Effective provider/model for a run against a Pipeline series — CLIENT MIRROR
+ * of `resolveSeriesLlmOverride` in server/lib/seriesLlmOverride.js, extended
+ * with the install's active provider as the final fallback so the UI can NAME
+ * what a run will call rather than showing a blank.
+ *
+ * Precedence: an explicit per-run/schedule override → the series' own
+ * `series.llm` → the active provider. A model id is provider-specific, so the
+ * series model is inherited ONLY while the effective provider is still the
+ * series provider — an override naming a different provider resolves that
+ * provider's own default model instead of forwarding a foreign id.
+ *
+ * @returns {{provider: string, model: string, inheritsSeriesModel: boolean}}
+ */
+export const resolveSeriesRunLlm = (series, { overrideProvider, overrideModel, activeProviderId } = {}) => {
+ const seriesProvider = series?.llm?.provider || '';
+ const inheritsSeriesModel = !overrideProvider || overrideProvider === seriesProvider;
+ return {
+ provider: overrideProvider || seriesProvider || activeProviderId || '',
+ model: overrideModel || (inheritsSeriesModel ? series?.llm?.model || '' : ''),
+ inheritsSeriesModel,
+ };
+};
+
/** Display name for a provider id, falling back to the id then `fallback`. */
export const providerDisplayName = (providers, id, fallback = '') =>
providers.find((p) => p.id === id)?.name || id || fallback;
diff --git a/server/routes/pipeline/autopilot.js b/server/routes/pipeline/autopilot.js
index 1e7e4878d2..eb777ca16d 100644
--- a/server/routes/pipeline/autopilot.js
+++ b/server/routes/pipeline/autopilot.js
@@ -12,7 +12,9 @@
* immediately; the active step/LLM call
* finishes before the terminal `canceled`
* frame (cooperative, between-step cancel).
- * GET /series/:id/autopilot/status → { autopilot } (resume / paused UI)
+ * GET /series/:id/autopilot/status → { autopilot, active, runLlm }
+ * (resume / paused UI; runLlm names the
+ * in-flight run's provider/model)
*/
import { Router } from 'express';
@@ -137,7 +139,14 @@ router.post('/series/:id/autopilot/cancel', asyncHandler(async (req, res) => {
router.get('/series/:id/autopilot/status', asyncHandler(async (req, res) => {
const series = await seriesSvc.getSeries(req.params.id).catch((err) => { throw mapServiceError(err); });
- res.json({ autopilot: series.autopilot || null, active: autopilot.isAutopilotActive(req.params.id) });
+ res.json({
+ autopilot: series.autopilot || null,
+ active: autopilot.isAutopilotActive(req.params.id),
+ // Provider/model an in-flight run resolved to, so a client re-attaching
+ // mid-run can name what the run is spending on (the `start` frame carrying
+ // them is long gone by then). null when no run is active.
+ runLlm: autopilot.activeRunLlm(req.params.id),
+ });
}));
export default router;
diff --git a/server/services/pipeline/seriesAutopilot.test.js b/server/services/pipeline/seriesAutopilot.test.js
index 8971d5fb1a..51ab91bfb2 100644
--- a/server/services/pipeline/seriesAutopilot.test.js
+++ b/server/services/pipeline/seriesAutopilot.test.js
@@ -275,6 +275,38 @@ describe('provider/model threading helpers (#1514 provider + #1558 model — bot
});
});
+describe('resolveAutopilotLlm — run provider/model resolution', () => {
+ const series = { llm: { provider: 'codex', model: 'gpt-x' } };
+
+ it('inherits the series llm when the run pins nothing', () => {
+ expect(autopilot.resolveAutopilotLlm({}, series))
+ .toEqual({ providerOverride: 'codex', modelOverride: 'gpt-x' });
+ });
+
+ it('lets a per-run override win over the series llm', () => {
+ expect(autopilot.resolveAutopilotLlm({ providerOverride: 'claude', modelOverride: 'opus' }, series))
+ .toEqual({ providerOverride: 'claude', modelOverride: 'opus' });
+ });
+
+ it('drops the series model when the override names a DIFFERENT provider', () => {
+ // A model id is provider-specific — forwarding codex's model to claude would fail.
+ expect(autopilot.resolveAutopilotLlm({ providerOverride: 'claude' }, series))
+ .toEqual({ providerOverride: 'claude', modelOverride: null });
+ });
+
+ it('keeps the series model when the override names the SAME provider', () => {
+ expect(autopilot.resolveAutopilotLlm({ providerOverride: 'codex' }, series))
+ .toEqual({ providerOverride: 'codex', modelOverride: 'gpt-x' });
+ });
+
+ it('resolves to null/null with no series llm and no override (active provider downstream)', () => {
+ expect(autopilot.resolveAutopilotLlm({}, { llm: null }))
+ .toEqual({ providerOverride: null, modelOverride: null });
+ expect(autopilot.resolveAutopilotLlm({}, null))
+ .toEqual({ providerOverride: null, modelOverride: null });
+ });
+});
+
describe('resolveNextStep (pure)', () => {
const comic = { targetFormat: 'comic', arc: { logline: 'L', summary: 'S' }, seasons: [{ id: 'se1', number: 1 }] };
const issue = (over = {}) => ({ id: 'iss1', seasonId: 'se1', number: 1, arcPosition: 1, stages: {}, ...over });
@@ -1238,6 +1270,33 @@ describe('autopilot conductor', () => {
expect(series.autopilot?.status).toBe('done');
});
+ it('runs on the series-configured provider/model and names it on the start frame', async () => {
+ const { seriesId } = await seedComplete();
+ await seriesSvc.updateSeries(seriesId, { llm: { provider: 'codex', model: 'gpt-x' } });
+ await autopilot.startSeriesAutopilot(seriesId, {});
+ await waitFor(runFinished(seriesId));
+ const run = autopilot.__testing.runs.get(seriesId);
+ // Stamped once at start, so every delegated call threads the same soft default.
+ expect(run.options.providerOverride).toBe('codex');
+ expect(run.options.modelOverride).toBe('gpt-x');
+ // Delegated arc verify receives it as a SOFT default (a stage pin still wins).
+ expect(arcSpies.verifyArc).toHaveBeenCalledWith(
+ seriesId,
+ expect.objectContaining({ providerDefault: 'codex', modelDefault: 'gpt-x' }),
+ );
+ });
+
+ it('lets a per-run provider override beat the series-configured provider', async () => {
+ const { seriesId } = await seedComplete();
+ await seriesSvc.updateSeries(seriesId, { llm: { provider: 'codex', model: 'gpt-x' } });
+ await autopilot.startSeriesAutopilot(seriesId, { providerOverride: 'claude' });
+ await waitFor(runFinished(seriesId));
+ const run = autopilot.__testing.runs.get(seriesId);
+ expect(run.options.providerOverride).toBe('claude');
+ // codex's model must NOT ride along to claude.
+ expect(run.options.modelOverride).toBeNull();
+ });
+
it('pauses for review when arc verify never converges', async () => {
verifyFindings = [{ severity: 'high', problem: 'plot hole', location: 'V1' }];
const { seriesId } = await seedComplete();
diff --git a/server/services/pipeline/seriesAutopilot/config.js b/server/services/pipeline/seriesAutopilot/config.js
index ea309e7a1f..f05687c2f3 100644
--- a/server/services/pipeline/seriesAutopilot/config.js
+++ b/server/services/pipeline/seriesAutopilot/config.js
@@ -4,6 +4,7 @@
*/
import { readReadinessGate } from '../../../lib/editorial/index.js';
+import { resolveSeriesLlmOverride } from '../../../lib/seriesLlmOverride.js';
import { READINESS_GATES } from '../editorialScore.js';
// Bounded convergence loops — re-verify/re-review at most this many rounds, then
@@ -184,6 +185,31 @@ export function resolveAutopilotRevision(options = {}, settings = null) {
};
}
+// Which provider/model do this run's LLM calls use? An explicit per-run
+// `providerOverride`/`modelOverride` wins (the Options picker, or the scheduler
+// mapping a schedule's provider/model); otherwise the run inherits the series'
+// own configured `series.llm` — the provider named in the series header, which
+// every other Pipeline LLM action already honors via resolveSeriesLlmOverride.
+// Both absent leaves them undefined, so stageRunner resolves stage pin → active
+// provider as before.
+//
+// Threaded as SOFT defaults (`providerDefault`/`modelDefault`, see
+// session.js#providerOverrideOpts), so a deliberate per-stage pin on the Prompts
+// page still wins and an unavailable provider falls through instead of throwing.
+//
+// A model id is provider-specific, so the series model is only inherited when
+// the effective provider is still the series provider — an override that names a
+// different provider without a model resolves that provider's own default.
+// Returns `null` (not `undefined`) for an unresolved value so the stamped run
+// options can be read back for display without re-deriving the fallback chain.
+export function resolveAutopilotLlm(options = {}, series = null) {
+ const { provider, model } = resolveSeriesLlmOverride(series, {
+ overrideProvider: options?.providerOverride,
+ overrideModel: options?.modelOverride,
+ });
+ return { providerOverride: provider || null, modelOverride: model || null };
+}
+
// Effective "produce draft visuals?" decision. The `target` option overrides
// the `includeVisual` flag: 'text' forces text-only (no canon gate, no render),
// 'visual' forces visuals, and 'auto' (the default) honors `includeVisual`
diff --git a/server/services/pipeline/seriesAutopilot/orchestrator.js b/server/services/pipeline/seriesAutopilot/orchestrator.js
index 4b70333166..722479111e 100644
--- a/server/services/pipeline/seriesAutopilot/orchestrator.js
+++ b/server/services/pipeline/seriesAutopilot/orchestrator.js
@@ -17,7 +17,7 @@ import { runs } from './state.js';
import {
resolveAutopilotRounds, resolveAutopilotFoundationGate, resolveAutopilotFoundationThreshold,
resolveAutopilotReadinessGate, resolveAutopilotCheckPauseThreshold, resolveAutopilotNotifyOnPause,
- resolveAutopilotProduceTeaser, resolveAutopilotRevision,
+ resolveAutopilotProduceTeaser, resolveAutopilotRevision, resolveAutopilotLlm,
} from './config.js';
import { VISUAL_DRAFT_ENABLED, summarizePlanCost } from './convergence.js';
import { broadcast, persistMarker, clearPauseNotice, notifyPause, fileGap, scheduleCleanup } from './session.js';
@@ -70,6 +70,11 @@ export async function startSeriesAutopilot(sId, options = {}) {
notifyOnPause: resolveAutopilotNotifyOnPause(options, settings),
produceTeaser: resolveAutopilotProduceTeaser(options, settings),
...resolveAutopilotRevision(options, settings),
+ // Run provider/model: per-run override → the series' own `series.llm` →
+ // unset (stage pin / active provider downstream). Resolved ONCE here so the
+ // manual run, a scheduled run and the UI's "this run calls X / Y" copy all
+ // name the same thing, and so a resume re-reads a since-changed series LLM.
+ ...resolveAutopilotLlm(options, seriesRecord),
severityWeights: mergeSeverityWeights(seriesRecord?.severityWeights),
blockingSets: {
arc: resolveBlockingSet(seriesRecord?.blockingSeverities, 'arc'),
@@ -156,7 +161,10 @@ export async function startSeriesAutopilot(sId, options = {}) {
const editorialLlmCheckCount = checkPlan ? checkPlan.checks.filter((c) => c.kind === 'llm').length : undefined;
const plan = buildDryRunPlan(series, issues, runOptions, { editorialLlmCheckCount });
const planTotals = summarizePlanCost(plan);
- broadcast(sId, { type: 'start', runId, mode, target: series.targetFormat, plan, planTotals });
+ broadcast(sId, {
+ type: 'start', runId, mode, target: series.targetFormat, plan, planTotals,
+ provider: runOptions.providerOverride, model: runOptions.modelOverride,
+ });
// Carry the plan on the terminal frame too: a dry-run emits start +
// complete synchronously, often before the client attaches, and
// attachSseClient replays only the LAST frame — so the plan would be
@@ -168,7 +176,13 @@ export async function startSeriesAutopilot(sId, options = {}) {
// EXECUTE.
const series0 = await getSeries(sId);
- broadcast(sId, { type: 'start', runId, mode, target: series0.targetFormat });
+ // The `provider`/`model` on the start frame are the run's resolved soft
+ // defaults — what the panel shows as "this run calls X / Y". A stage
+ // pinned on the Prompts page still overrides them for that stage.
+ broadcast(sId, {
+ type: 'start', runId, mode, target: series0.targetFormat,
+ provider: runOptions.providerOverride, model: runOptions.modelOverride,
+ });
await persistMarker(sId, { status: 'running', runId, currentStep: null, residualFindings: [], lastError: null });
// A resume is a fresh start: drop any stale pause banner up front so a run
// that completes/errors without re-pausing doesn't leave a dead resume link.
diff --git a/server/services/pipeline/seriesAutopilot/session.js b/server/services/pipeline/seriesAutopilot/session.js
index 47ccbc4ff2..df1a3e771d 100644
--- a/server/services/pipeline/seriesAutopilot/session.js
+++ b/server/services/pipeline/seriesAutopilot/session.js
@@ -22,6 +22,17 @@ export function isAutopilotActive(seriesId) {
return !!run && !run.finished;
}
+// Provider/model an IN-FLIGHT run resolved to (null when no run is active, or
+// when the run fell through to the install's active provider). The values ride
+// the `start` SSE frame too, but attachSseClient replays only the LAST frame —
+// so a client re-attaching mid-run would otherwise never learn which provider
+// the run is spending on. Read through the status route.
+export function activeRunLlm(seriesId) {
+ const run = runs.get(seriesId);
+ if (!run || run.finished) return null;
+ return { provider: run.options?.providerOverride || null, model: run.options?.modelOverride || null };
+}
+
export function attachClient(seriesId, res) {
return attachSseClient(runs, seriesId, res);
}