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: allow manual quality runs with schedules disabled

Adam Eivy5024758001a5
diff --git a/client/src/components/apps/AppQualityRunner.jsx b/client/src/components/apps/AppQualityRunner.jsx
index 9e63697521..bd09c3bab1 100644
--- a/client/src/components/apps/AppQualityRunner.jsx
+++ b/client/src/components/apps/AppQualityRunner.jsx
@@ -74,7 +74,7 @@ export default function AppQualityRunner({ app, children }) {
availableModels={picker.availableModels} onProviderChange={value => { picker.setSelectedProviderId(value); setEffort(''); }}
onModelChange={picker.setSelectedModel} effort={effort} onEffortChange={setEffort} loading={picker.loading} disabled={busy}
emptyProviderOption="Select a subscription provider" emptyModelOption="Select a model" highlightToolUse />
- <p className="text-xs text-gray-400">{taskTypes.length} scheduled agents, run sequentially within this batch. Launch another batch to run checks in parallel. {mode === 'fix' ? 'Each selected audit can change code and open a PR.' : 'Findings become issues; no fixes or backlog claim jobs.'} Existing task enablement and Improve settings apply.</p>
+ <p className="text-xs text-gray-400">{taskTypes.length} scheduled agents, run sequentially within this batch. Launch another batch to run checks in parallel. {mode === 'fix' ? 'Each selected audit can change code and open a PR.' : 'Findings become issues; no fixes or backlog claim jobs.'} Schedules can stay disabled. The Improve setting still applies.</p>
<details className="text-xs"><summary className="cursor-pointer text-port-accent">Selected checks ({taskTypes.length})</summary><p className="mt-1">{categories.filter(category => taskTypes.includes(category.id)).map(category => category.label).join(', ') || 'All categories have qualifying evidence.'}</p></details>
<button type="button" onClick={start} disabled={busy || picker.loading || !picker.selectedProviderId || !picker.selectedModel || !taskTypes.length || app.quality?.unavailable}
className="px-3 py-2 rounded bg-port-accent text-port-bg text-sm font-medium disabled:opacity-50">{taskTypes.length === 1 ? 'Run now' : `Run ${taskTypes.length} checks now`}</button>
diff --git a/server/lib/README.md b/server/lib/README.md
index a5625d0772..6b058af272 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -72,7 +72,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `autonomousJobTask.js` | `generatedJobTaskFields` — flattens a `generateTaskFromJob` result into the top-level keys the non-raw `cos.addTask` path maps onto metadata. One allowlist shared by the manual "Run now" endpoint and the quota-burn lane, so a key added to the generator cannot reach one and not the other. Pure. |
| `quotaBurnConfig.js` | Quota-burn plan shape: the provider families, the burn-job type alphabet + catalog the config page renders its form from, `QUOTA_BURN_BOUNDS` (the one bounds table the normalizer clamps to, the Zod schemas reject against, and the catalog descriptors publish as min/max), and total normalization (`normalizeQuotaBurnConfig`). Owns the dispatch-cap sentinel too (`QUOTA_BURN_UNLIMITED_DISPATCHES` / `isUnlimitedDispatchCap`) — -1 means the window is not counted, and is the default. Also owns the retired executor's task-description parser (`QUOTA_BURN_TASK_PREFIX` / `quotaBurnFamilyOfDescription`), kept for migration 225, and the `run once` vocabulary (`quotaBurnJobKey` / `jobIsSpent`, plus the two family predicates `familyIsConfigured` and `familyHasRunnableJobs`). Pure — no storage, no provider I/O. |
| `quotaBurnLegacyConversion.js` | The ONE rule turning a LEGACY quota-burn step (copied prompt + quota-only `jobType`) into a scheduled-task reference, shared by migration 359 and the live compat path so the two cannot drift. `planQuotaBurnStepConversion` decides between three outcomes — a recognized unmodified shipped preset onto its scheduled audit counterpart with issues-only pinned explicitly (`AUDIT_TASK_TYPE_BY_PRESET_ID`, inverted from `auditCatalog.js`), the two programmatic types onto their scheduled handlers, and anything customized or targetless onto a `buildQuotaBurnCustomJob` on-demand custom task addressed by the deterministic `quotaBurnCustomJobId` (which is what makes a repeated or resumed conversion create no duplicate). `legacyAgentTaskMetadata` reproduces the retired executor's dispatch posture; `applyQuotaBurnStepConversion` rewrites the step, preserving id, label, enabled and run-once state. Recognition is `matchStoredAuditPreset`, never a label or a partial match. |
-| `quotaBurnOrigin.js` | Quota-burn PROVENANCE on an on-demand scheduled-task request and on the task it produces. `normalizeQuotaBurnProvenance` reads the request block (family + burn-step id required, plus the limiting-window reset, the provider/model/effort overrides and the optional manual `maintenanceRunId`); `QUOTA_BURN_PROVENANCE_FIELDS` is the ONE block definition every persistence and projection hop derives from, spread by `quotaBurnTaskMetadata` (flat task-metadata keys), `quotaBurnAgentMetadata` (the agent projection) and read back by `quotaBurnProvenance` / `hasQuotaBurnProvenance`, which accept both the flat keys and a nested `quotaBurn` block; `burnPlanOwnsTask` / `burnPlanOwnsAgent` are the ONE rule for whether the family plan (not a manual maintenance run) owns a burn-provenanced task. `onDemandRequestMetadata` is the single spread both on-demand engines apply. Import-light on purpose — `taskScheduleConstants.js` declares the origin string and must not drag the quota-burn config graph. |
+| `quotaBurnOrigin.js` | Quota-burn PROVENANCE on an on-demand scheduled-task request and on the task it produces. `normalizeQuotaBurnProvenance` reads the request block (family + burn-step id required, plus the limiting-window reset, the provider/model/effort overrides and the optional manual `maintenanceRunId`); `QUOTA_BURN_PROVENANCE_FIELDS` is the ONE block definition every persistence and projection hop derives from, spread by `quotaBurnTaskMetadata` (flat task-metadata keys), `quotaBurnAgentMetadata` (the agent projection) and read back by `quotaBurnProvenance` / `hasQuotaBurnProvenance`, which accept both the flat keys and a nested `quotaBurn` block; `burnPlanOwnsTask` / `burnPlanOwnsAgent` are the ONE rule for whether the family plan (not a manual maintenance run) owns a burn-provenanced task. `isManualOnDemandRequest` distinguishes explicit runs from automated cadence gates. `onDemandRequestMetadata` is the single spread both on-demand engines apply. Import-light on purpose — `taskScheduleConstants.js` declares the origin string and must not drag the quota-burn config graph. |
| `quotaBurnPresets.js` | FROZEN compatibility-and-migration input (#6381). `QUOTA_BURN_PROMPT_PRESETS` — ready-made single-focus audit prompts for `agent-prompt` burn jobs (UX, a11y, mobile, failure paths, perf, test gaps, dead code, data safety, docs, security), each filing GitHub issues and changing no code. Templates: picking one COPIES its prompt into the job, so editing them never rewrites a configured job. `findQuotaBurnPreset(id)`; `matchStoredAuditPreset` is migration 305's recognition rule (match the MISSION half, gated on the shipped contract anchors + headings) and `upgradeStoredAuditPrompt` is the refresh built on it. |
| `auditCatalog.js` | `getAuditScheduleMetadata` derives upgrade-safe display names and cluster labels; `AUDIT_RUN_GUIDANCE` supplies advisory sequencing. Shared catalog of scheduled AUDIT task types (`AUDIT_DEFINITIONS` / `AUDIT_TASK_TYPES`) that can either implement a fix or file tracker issues. Filing presets carry `issueLabel` (category) plus `metricLabel`/`extraLabels` from the slug stem (`cognitive-load`, `structural-drift`, `runtime-safety`, …) so forge issues can be filtered by metric as well as titled with it. `metricLabelFromSlugPrefix`, `isFileIssuesMode`, `isExplicitFileIssuesRequest`, `FILE_ISSUES_DELIVERY_SETTINGS` (the one delivery posture every file-issues lane stamps), `auditDoWorkRequiresWorktree`, `getAuditFilingPreset`, `modeContractFor`, `applyAuditModeWrapper`. Each quota-burn audit preset maps to a scheduled type here (guarded by `auditCatalog.test.js`). Pure — no I/O. |
| `quotaBurnTaskRef.js` | The quota-burn STEP model: a discriminated scheduled-task reference (`builtin` task type + validated target app, or `custom` app-job id whose own scope is authoritative) plus the per-invocation `overrides` bag (provider/model/effort/params — unset inherits the task's saved settings, and nothing written here edits the schedule). `normalizeQuotaBurnTaskRef` / `normalizeQuotaBurnOverrides` / `normalizeQuotaBurnParams`, the `QUOTA_BURN_UNAVAILABLE` reason codes, `resolveQuotaBurnStepAvailability` (catalog passed IN, so this stays pure) / `applyQuotaBurnAvailability`, `quotaBurnStepIsDispatchable`, and `evaluateOnDemandEligibility` — the ONE on-demand gate ladder (`enabled` / instance feature / invocation eligibility / target scope / per-app switch / master Improve) shared with `taskSchedule.triggerOnDemandTask`, with `enabledAppIdsByTaskType` deriving its per-app input. |
diff --git a/server/lib/quotaBurnOrigin.js b/server/lib/quotaBurnOrigin.js
index fbfa2f591b..04ec72c767 100644
--- a/server/lib/quotaBurnOrigin.js
+++ b/server/lib/quotaBurnOrigin.js
@@ -37,6 +37,12 @@ import { trimTo } from './textUtils.js';
*/
export const QUOTA_BURN_REQUEST_ORIGIN = 'quota-burn';
+/** Explicit runs bypass cadence switches; automated burns and refills do not. */
+export function isManualOnDemandRequest(request) {
+ return (request.origin ?? 'user') === 'user'
+ || (request.origin === QUOTA_BURN_REQUEST_ORIGIN && Boolean(normalizeQuotaBurnProvenance(request.burn)?.maintenanceRunId));
+}
+
const MAX_FIELD = 64;
/**
diff --git a/server/services/cosTaskGenerator.js b/server/services/cosTaskGenerator.js
index e1b4042a54..4d1736c5db 100644
--- a/server/services/cosTaskGenerator.js
+++ b/server/services/cosTaskGenerator.js
@@ -31,7 +31,7 @@ import { join } from 'path';
import { sanitizeTaskMetadata, PIPELINE_STAGE_BEHAVIOR_FLAGS, MAX_TOTAL_SPAWNS, resolveClaimReviewerConfig, reviewerConfigMetadata, hasReviewerOverride } from '../lib/validation.js';
import { PATHS } from '../lib/fileUtils.js';
import { isPlainObject } from '../lib/objects.js';
-import { hasQuotaBurnProvenance } from '../lib/quotaBurnOrigin.js';
+import { hasQuotaBurnProvenance, isManualOnDemandRequest } from '../lib/quotaBurnOrigin.js';
import { isAutoApprovableInvestigation } from '../lib/investigationTasks.js';
import { parsePlanItems, extractAllIds, findInProgressIds, pickFirstAvailable, diagnoseUnpickablePlan } from '../lib/planIds.js';
import { loadState, saveState, withStateLock, isImprovementEnabled, isDaemonRunning } from './cosState.js';
@@ -2095,9 +2095,8 @@ export async function drainProgrammaticOnDemandRequests({ taskScheduleMod, reque
await taskScheduleMod.clearOnDemandRequest(request.id);
continue;
}
- // Parity with the agent engines: the type may have been disabled after the
- // request was queued.
- if (!taskConfig?.enabled) {
+ // Match the agent drain: manual runs bypass cadence, never task removal.
+ if (!taskConfig || (!isManualOnDemandRequest(request) && !taskConfig.enabled)) {
emitLog('info', `On-demand request skipped — task type '${request.taskType}' is disabled`, { requestId: request.id });
await taskScheduleMod.clearOnDemandRequest(request.id);
continue;
diff --git a/server/services/cosTaskGenerator.programmaticOnDemand.test.js b/server/services/cosTaskGenerator.programmaticOnDemand.test.js
index f1a3203ea2..0235f5c7d7 100644
--- a/server/services/cosTaskGenerator.programmaticOnDemand.test.js
+++ b/server/services/cosTaskGenerator.programmaticOnDemand.test.js
@@ -62,9 +62,9 @@ beforeEach(() => {
});
describe('drainProgrammaticOnDemandRequests', () => {
- it('runs the handler with the task\'s saved settings and no probe context', async () => {
+ it('runs a disabled schedule manually with saved settings and no probe context', async () => {
const handled = await drainProgrammaticOnDemandRequests({
- taskScheduleMod, requests: [request()], schedule: schedule(), state: {},
+ taskScheduleMod, requests: [request()], schedule: schedule({ enabled: false }), state: {},
});
expect(handled.has('demand-1')).toBe(true);
@@ -105,9 +105,9 @@ describe('drainProgrammaticOnDemandRequests', () => {
}));
});
- it('clears without running when the type was disabled after the request was queued', async () => {
+ it('clears an automated refill when the type was disabled after queuing', async () => {
const handled = await drainProgrammaticOnDemandRequests({
- taskScheduleMod, requests: [request()], schedule: schedule({ enabled: false }), state: {},
+ taskScheduleMod, requests: [{ ...request(), origin: 'refill' }], schedule: schedule({ enabled: false }), state: {},
});
// Still "handled" — the engines must skip it, not fall through and try to
// generate an agent task for a type that has no prompt.
diff --git a/server/services/maintenanceRun.js b/server/services/maintenanceRun.js
index 071967819d..94123cbb7c 100644
--- a/server/services/maintenanceRun.js
+++ b/server/services/maintenanceRun.js
@@ -18,9 +18,8 @@
* holds, and a second run is just a second record.
*
* What it shares with a burn is the INVOCATION: every step is dispatched through
- * `quotaBurnInvoke.invokeQuotaBurnStep`, so the schedule's own gate ladder (task
- * enabled, per-app switch, master Improve, target scope, duplicate requests)
- * still applies, each handler is pinned to the family the user named, and the
+ * `quotaBurnInvoke.invokeQuotaBurnStep`. Manual runs bypass schedule switches;
+ * master Improve, target scope and duplicate-request guards still apply, each handler is pinned to the family the user named, and the
* task carries the family provenance that makes it cooldown-exempt and lets an
* observed refusal be credited to the right window. The `maintenanceRunId`
* provenance field is what tells the quota-burn loop to leave these agents
@@ -275,7 +274,7 @@ async function evaluate(id, { ignoreTaskId }) {
const queued = (await getOnDemandRequests()).find((request) => request?.burn?.maintenanceRunId === id);
if (queued) return hold(`waiting for the CoS daemon to accept request ${queued.id} (${queued.taskType})`);
- const catalog = await getQuotaBurnTaskCatalog();
+ const catalog = await getQuotaBurnTaskCatalog({ manual: true });
const completed = { ...run.completed };
for (const step of run.steps) {
if (completed[step.id]) continue;
diff --git a/server/services/onDemandDrain.js b/server/services/onDemandDrain.js
index ed3678ec57..f3698995f0 100644
--- a/server/services/onDemandDrain.js
+++ b/server/services/onDemandDrain.js
@@ -32,7 +32,7 @@ import { emitLog } from './cosEvents.js';
import { getActiveApps } from './apps.js';
import { loadState, saveState, withStateLock, isImprovementEnabled } from './cosState.js';
import { markAppReviewCooldown, bindAppReviewAgent } from './appActivity.js';
-import { onDemandRequestMetadata } from '../lib/quotaBurnOrigin.js';
+import { isManualOnDemandRequest, onDemandRequestMetadata } from '../lib/quotaBurnOrigin.js';
import { addTask, reviveBlockedTask } from './cosTaskStore.js';
/**
@@ -104,8 +104,8 @@ export async function drainOnDemandRequests(ctx, adapter) {
continue;
}
- // Skip if the task type was disabled or removed after queuing.
- if (!schedule.tasks[request.taskType]?.enabled) {
+ // Removed tasks never run; only automated requests honor schedule disablement.
+ if (!schedule.tasks[request.taskType] || (!isManualOnDemandRequest(request) && !schedule.tasks[request.taskType].enabled)) {
emitLog('info', `On-demand request skipped — task type '${request.taskType}' is disabled`, { requestId: request.id });
await taskScheduleMod.clearOnDemandRequest(request.id);
continue;
diff --git a/server/services/onDemandDrain.test.js b/server/services/onDemandDrain.test.js
index ea7958e81d..bb90b03c2d 100644
--- a/server/services/onDemandDrain.test.js
+++ b/server/services/onDemandDrain.test.js
@@ -362,8 +362,8 @@ describe.each(ENGINES)('%s — skip gates', (_name, makeAdapter) => {
expect(spawned).toEqual([]);
});
- it('drops the request when its task type was disabled after queuing', async () => {
- mocks.getOnDemandRequests.mockResolvedValue([appRequest()]);
+ it('drops an automated refill when its task type was disabled after queuing', async () => {
+ mocks.getOnDemandRequests.mockResolvedValue([appRequest({ origin: 'refill' })]);
mocks.loadSchedule.mockResolvedValue({ tasks: { 'code-quality': { enabled: false } } });
const { spawned, adapter } = makeAdapter();
await drainOnDemandRequests({ state: STATE }, adapter);
@@ -451,3 +451,19 @@ describe('the per-engine adapter differences', () => {
expect(result.schedule).toEqual({ tasks: { 'code-quality': { enabled: true } } });
});
});
+
+
+describe('schedule disablement at dispatch', () => {
+ it.each([
+ [{}, true],
+ [{ origin: 'quota-burn', burn: { family: 'grok', stepId: 'step-1', maintenanceRunId: 'manual-1' } }, true],
+ [{ origin: 'quota-burn', burn: { family: 'grok', stepId: 'step-1' } }, false],
+ [{ origin: 'refill' }, false],
+ ])('dispatches only explicit runs: %j', async (provenance, shouldSpawn) => {
+ mocks.loadSchedule.mockResolvedValue({ tasks: { 'code-quality': { enabled: false } } });
+ mocks.getOnDemandRequests.mockResolvedValue([appRequest(provenance)]);
+ const { adapter, spawned } = generatorAdapter();
+ await drainOnDemandRequests({ state: STATE }, adapter);
+ expect(spawned).toHaveLength(shouldSpawn ? 1 : 0);
+ });
+});
diff --git a/server/services/onDemandEligibilityAgreement.test.js b/server/services/onDemandEligibilityAgreement.test.js
index 491f7f37d0..3585b83004 100644
--- a/server/services/onDemandEligibilityAgreement.test.js
+++ b/server/services/onDemandEligibilityAgreement.test.js
@@ -141,3 +141,22 @@ describe('on-demand eligibility, page vs schedule', () => {
expect((await agreedVerdict('security'))?.code).toBe('disabled');
});
});
+
+
+describe('manual runs with schedules disabled', () => {
+ it.each(['user', 'maintenance'])('queues %s work without changing schedule settings', async (kind) => {
+ world.tasks.security.enabled = false;
+ world.apps[0].taskTypeOverrides.security = { enabled: false };
+ const manualBurn = { ...burn, maintenanceRunId: 'manual-1' };
+ const catalog = await getQuotaBurnTaskCatalog({ manual: true });
+ expect(resolveQuotaBurnStepAvailability(burnStep('security', 'app-1'), catalog)).toBeNull();
+ const request = await triggerOnDemandTask('security', 'app-1', {
+ emit: false,
+ ...(kind === 'maintenance' ? { origin: ON_DEMAND_ORIGINS.QUOTA_BURN, burn: manualBurn } : {}),
+ });
+ expect(request).toMatchObject({ id: expect.any(String), appId: 'app-1' });
+ expect(world.tasks.security.enabled).toBe(false);
+ expect(world.apps[0].taskTypeOverrides.security.enabled).toBe(false);
+ expect((await agreedVerdict('security', 'app-1')).code).toBe('disabled');
+ });
+});
diff --git a/server/services/quotaBurnInvoke.js b/server/services/quotaBurnInvoke.js
index 695c1067ca..eb4b67ba23 100644
--- a/server/services/quotaBurnInvoke.js
+++ b/server/services/quotaBurnInvoke.js
@@ -98,9 +98,10 @@ const entryOf = (map, key) => (map && Object.hasOwn(map, key) ? map[key] : null)
* `loadSchedule()` is uncached (a disk read plus a deep merge over every default
* interval), so going back to the stores per step made the status page's probe
* pay that whole cost once per configured step. The pure resolver ignores every
- * key it does not know.
+ * key it does not know. Manual maintenance catalogs bypass built-in cadence
+ * switches without changing saved settings or the automatic burn catalog.
*/
-export async function getQuotaBurnTaskCatalog() {
+export async function getQuotaBurnTaskCatalog({ manual = false } = {}) {
const [{ loadSchedule }, { getTaskTypeInvocation }, { getActiveApps }, { createFeatureGate }, { getAllJobs }, { isImprovementEnabled, loadState }] =
await Promise.all([
import('./taskScheduleStore.js'),
@@ -132,11 +133,11 @@ export async function getQuotaBurnTaskCatalog() {
const builtin = {};
await Promise.all(Object.entries(schedule?.tasks || {}).map(async ([taskType, config]) => {
builtin[taskType] = {
- enabled: config?.enabled === true,
+ enabled: manual || config?.enabled === true,
featureEnabled: await featureEnabled(config),
feature: config?.feature || null,
eligible: getTaskTypeInvocation(taskType).userInvokable !== false,
- appIds: appIdsByTaskType.get(taskType) || [],
+ appIds: manual ? undefined : appIdsByTaskType.get(taskType) || [],
config,
};
}));
diff --git a/server/services/taskSchedule.js b/server/services/taskSchedule.js
index e36c7571e2..e89c2b59a8 100644
--- a/server/services/taskSchedule.js
+++ b/server/services/taskSchedule.js
@@ -56,7 +56,7 @@ import { isInstanceFeatureEnabled } from './instanceFeatures.js';
import { recordUserAction } from './userActions.js';
import { getTaskDataInputCatalog } from '../lib/taskDataInputCatalog.js';
import { normalizeSuggestedAfter } from '../lib/scheduleRunOrder.js';
-import { normalizeQuotaBurnProvenance } from '../lib/quotaBurnOrigin.js';
+import { isManualOnDemandRequest, normalizeQuotaBurnProvenance } from '../lib/quotaBurnOrigin.js';
import { enabledAppIdsByTaskType, evaluateOnDemandEligibility } from '../lib/quotaBurnTaskRef.js';
import {
clearFailureLedgerFields,
@@ -1087,11 +1087,12 @@ export async function triggerOnDemandTask(taskType, appId = null, {
// prepareManagedAppImprovementTask as the MOST specific pin, above
// the schedule interval and the app's own per-app override.
const providerOverride = (provider || model || effort) ? { provider, model, effort } : null;
+ const manual = isManualOnDemandRequest({ origin, burn: burnProvenance });
const request = await updateSchedule(async (schedule) => {
const tasks = schedule.tasks || {};
const config = Object.prototype.hasOwnProperty.call(tasks, taskType) ? tasks[taskType] : null;
const entry = config ? {
- enabled: config.enabled === true,
+ enabled: manual || config.enabled === true,
featureEnabled: await createFeatureGate()(config),
feature: config.feature || null,
// A quota burn faces this gate alongside a human Run: a type owned by
@@ -1104,7 +1105,7 @@ export async function triggerOnDemandTask(taskType, appId = null, {
// drain's applyOnDemandRunResets exists for exactly that — while a burn
// picks its own step and must respect the switch the user set. Omitted,
// the ladder skips the rung.
- appIds: origin === ON_DEMAND_ORIGINS.QUOTA_BURN
+ appIds: origin === ON_DEMAND_ORIGINS.QUOTA_BURN && !manual
? enabledAppIdsByTaskType(await getActiveApps().catch(() => [])).get(taskType) || []
: undefined,
} : null;
diff --git a/server/services/taskSchedule.test.js b/server/services/taskSchedule.test.js
index 0752479276..c97ba37bd2 100644
--- a/server/services/taskSchedule.test.js
+++ b/server/services/taskSchedule.test.js
@@ -1997,12 +1997,12 @@ describe('taskSchedule', () => {
expect(schedule.onDemandRequests || []).toHaveLength(0)
})
- it('should reject when the task type is disabled (cheaper check runs first)', async () => {
+ it('rejects automated refills when the task type is disabled before reading state', async () => {
mockSchedule({
tasks: { 'feature-ideas': { type: 'weekly', enabled: false } }
})
- const result = await triggerOnDemandTask('feature-ideas', 'critical-mass')
+ const result = await triggerOnDemandTask('feature-ideas', 'app-1', { origin: ON_DEMAND_ORIGINS.REFILL })
expect(result.error).toMatch(/'feature-ideas' is disabled/i)
// loadState should not have been called — task-type check short-circuits before loadState.
@@ -2167,8 +2167,8 @@ describe('taskSchedule', () => {
})
it('records nothing when the trigger is refused', async () => {
- mockSchedule({ tasks: { 'branch-reconcile': { type: 'on-demand', perpetual: true, enabled: false } } })
- expect((await triggerOnDemandTask('branch-reconcile', 'app-1')).error).toMatch(/disabled/i)
+ mockSchedule({ tasks: {} })
+ expect((await triggerOnDemandTask('unknown-task', 'app-1')).error).toMatch(/unknown/i)
expect(recordUserAction).not.toHaveBeenCalled()
})