+ {/* Manual runs have no execution framework behind them yet: the
+ API answers 501 instead of pretending a run was queued, so
+ the button is disabled rather than offering a run that
+ cannot happen. */}
{loading ? (
diff --git a/apps/web/src/app/api/agents/[id]/run/route.ts b/apps/web/src/app/api/agents/[id]/run/route.ts
index fc544dee..9b2cfbc5 100644
--- a/apps/web/src/app/api/agents/[id]/run/route.ts
+++ b/apps/web/src/app/api/agents/[id]/run/route.ts
@@ -5,14 +5,14 @@ import { requireAdmin } from '@/lib/require-admin';
/**
* POST /api/agents/[id]/run
*
- * Manually trigger an agent run. Validates the agent exists and updates
- * its lastRun timestamp. In a full implementation, this would also
- * enqueue a job via the job queue for the configured action type.
+ * Manually trigger an agent run.
+ *
+ * No execution framework is wired up yet: nothing in the queue or the worker
+ * reads `Agent` rows, so a run cannot be queued. This route used to answer
+ * 202 with `status: 'queued'` and stamp `lastRun` — three signals that the
+ * agent ran, none of them true. It now says the run did not happen.
*/
-export async function POST(
- _request: NextRequest,
- { params }: { params: Promise<{ id: string }> },
-) {
+export async function POST(_request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
const { error } = await requireAdmin();
if (error) return error;
@@ -23,23 +23,12 @@ export async function POST(
return NextResponse.json({ error: 'Agent not found' }, { status: 404 });
}
- const config = agent.config as Record | null;
- const actionType = config?.actionType ?? 'unknown';
-
- // Update the agent's lastRun timestamp
- await prisma.agent.update({
- where: { id },
- data: { lastRun: new Date() },
- });
-
- const result = {
- agentId: agent.id,
- agentName: agent.name,
- actionType,
- status: 'queued',
- triggeredAt: new Date().toISOString(),
- message: `Agent "${agent.name}" run has been queued. Action: ${actionType}`,
- };
-
- return NextResponse.json(result, { status: 202 });
+ return NextResponse.json(
+ {
+ error: 'Agent runs are not available yet: no execution framework is wired up.',
+ agentId: agent.id,
+ agentName: agent.name,
+ },
+ { status: 501 },
+ );
}
diff --git a/apps/web/src/components/agents/agent-actions.tsx b/apps/web/src/components/agents/agent-actions.tsx
index 4ed15784..1e67bf9f 100644
--- a/apps/web/src/components/agents/agent-actions.tsx
+++ b/apps/web/src/components/agents/agent-actions.tsx
@@ -7,19 +7,47 @@ interface AgentActionsProps {
onRun: (id: string) => void;
onEdit: (id: string) => void;
onDelete: (id: string) => void;
+ /**
+ * Manual runs have no execution framework behind them yet, so the run
+ * button is disabled rather than offering a run that cannot happen.
+ * Defaults to unavailable: a run button that cannot run is the worse
+ * default.
+ */
+ runsAvailable?: boolean;
}
-export function AgentActions({ agentId, onRun, onEdit, onDelete }: AgentActionsProps) {
+export function AgentActions({
+ agentId,
+ onRun,
+ onEdit,
+ onDelete,
+ runsAvailable = false,
+}: AgentActionsProps) {
+ const runButton = (
+
+ );
+
return (
-
+ {/* A disabled button emits no mouse events, so no browser shows a
+ tooltip for it. The wrapper carries the reason instead. */}
+ {runsAvailable ? (
+ runButton
+ ) : (
+ {runButton}
+ )}