Skip to content

Commit 62e14f3

Browse files
committed
fix(cockpit): clarify goal-manager disabled state for tick and seed
1 parent cbc2b07 commit 62e14f3

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/app/api/metrics/seed/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ export async function POST(request: NextRequest) {
230230

231231
// Trigger Goal Manager tick so the queue reflects the injected scenario immediately
232232
let goalsQueued = 0;
233+
let goalManagerEnabled = false;
233234
try {
234235
const tickResult = await tickGoalManager();
236+
goalManagerEnabled = tickResult.enabled;
235237
goalsQueued = tickResult.queuedCount;
236238
if (tickResult.enabled) {
237239
logger.info(`[Seed API] Goal Manager tick: ${goalsQueued} goals queued for scenario=${scenario}`);
@@ -244,6 +246,7 @@ export async function POST(request: NextRequest) {
244246
success: true,
245247
scenario,
246248
injectedCount: dataPoints.length,
249+
goalManagerEnabled,
247250
goalsQueued,
248251
ttlSeconds: SEED_TTL_SECONDS,
249252
ttlExpiry: new Date(Date.now() + SEED_TTL_SECONDS * 1000).toISOString(),

src/app/page.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ export default function Dashboard() {
718718
}
719719
const injectedCount = typeof body.injectedCount === 'number' ? body.injectedCount : null;
720720
const goalsQueued = typeof body.goalsQueued === 'number' ? body.goalsQueued : 0;
721+
const goalManagerEnabled = body.goalManagerEnabled !== false;
721722
const goalsSuffix = goalsQueued > 0 ? ` · ${goalsQueued} goals queued` : '';
722723
// Auto-select the most relevant intent for this scenario
723724
const suggestedIntent = SEED_INTENT_MAP[scenario];
@@ -728,9 +729,13 @@ export default function Dashboard() {
728729
setAutonomousPlanSteps(null);
729730
setAutonomyActionFeedback({
730731
type: 'success',
731-
message: injectedCount !== null
732-
? `Scenario ${scenario} injected (${injectedCount} data points)${goalsSuffix}`
733-
: `Scenario ${scenario} injected${goalsSuffix}`,
732+
message: goalManagerEnabled
733+
? injectedCount !== null
734+
? `Scenario ${scenario} injected (${injectedCount} data points)${goalsSuffix}`
735+
: `Scenario ${scenario} injected${goalsSuffix}`
736+
: injectedCount !== null
737+
? `Scenario ${scenario} injected (${injectedCount} data points). Goal Manager is disabled, so queue will not change.`
738+
: `Scenario ${scenario} injected. Goal Manager is disabled, so queue will not change.`,
734739
});
735740
} else if (action === 'goal-tick') {
736741
const res = await fetch(`${BASE_PATH}/api/goal-manager/tick`, {
@@ -743,6 +748,9 @@ export default function Dashboard() {
743748
const message = typeof body.error === 'string' ? body.error : 'Failed to execute goal tick.';
744749
throw new Error(message);
745750
}
751+
if (body.enabled === false) {
752+
throw new Error('Goal Manager is disabled. Set GOAL_MANAGER_ENABLED=true and restart.');
753+
}
746754
const generated = typeof body.generatedCount === 'number' ? body.generatedCount : 0;
747755
const queued = typeof body.queuedCount === 'number' ? body.queuedCount : 0;
748756
const depth = typeof body.queueDepth === 'number' ? body.queueDepth : 0;
@@ -1119,6 +1127,7 @@ export default function Dashboard() {
11191127
);
11201128

11211129
const isReadOnlyMode = process.env.NEXT_PUBLIC_SENTINAI_READ_ONLY_MODE === 'true';
1130+
const isGoalManagerEnabled = goalManager?.config.enabled === true;
11221131
const networkName = current?.chain?.displayName || process.env.NEXT_PUBLIC_NETWORK_NAME;
11231132
const eoaRoleEntries = Object.entries(current?.eoaBalances?.roles || {}).filter(([, value]) => value !== null);
11241133
const showL1Failover = Boolean(l1Failover && current?.chain?.capabilities?.l1Failover !== false);
@@ -1759,19 +1768,24 @@ export default function Dashboard() {
17591768
<div className="grid grid-cols-2 gap-2 mt-2">
17601769
<button
17611770
onClick={() => runAutonomyDemoAction('goal-tick')}
1762-
disabled={autonomyActionRunning !== null || autonomyPolicyUpdating !== null}
1771+
disabled={autonomyActionRunning !== null || autonomyPolicyUpdating !== null || !isGoalManagerEnabled}
17631772
className="px-2 py-2 text-[11px] font-semibold rounded-lg bg-slate-100 text-slate-700 hover:bg-slate-200 disabled:opacity-50"
17641773
>
17651774
{autonomyActionRunning === 'goal-tick' ? 'Running Tick' : 'Goal Tick'}
17661775
</button>
17671776
<button
17681777
onClick={() => runAutonomyDemoAction('goal-dispatch-dry-run')}
1769-
disabled={autonomyActionRunning !== null || autonomyPolicyUpdating !== null}
1778+
disabled={autonomyActionRunning !== null || autonomyPolicyUpdating !== null || !isGoalManagerEnabled}
17701779
className="px-2 py-2 text-[11px] font-semibold rounded-lg bg-indigo-100 text-indigo-700 hover:bg-indigo-200 disabled:opacity-50"
17711780
>
17721781
{autonomyActionRunning === 'goal-dispatch-dry-run' ? 'Running Dispatch' : 'Dispatch Dry-run'}
17731782
</button>
17741783
</div>
1784+
{!isGoalManagerEnabled && (
1785+
<p className="text-[10px] text-amber-700 mt-2">
1786+
Goal Manager is disabled. Set <code>GOAL_MANAGER_ENABLED=true</code> and restart.
1787+
</p>
1788+
)}
17751789

17761790
<div className="mt-3 pt-3 border-t border-gray-200">
17771791
<p className="text-[10px] text-gray-500 font-semibold uppercase">Autonomous Ops API</p>

0 commit comments

Comments
 (0)