open-swe/ui/src/routes/agents_.instructions.tsx
Johannes du Plessis da8f003933
feat: per-repo custom instructions for the coding agent (#1460)
* feat: per-repo custom instructions for the coding agent

Adds per-repository custom instructions for the main coding agent,
mirroring the reviewer's per-repo style prompts. Instructions are stored
in the LangGraph Store, managed via dashboard API + UI (Monaco editor),
and appended to the agent's system prompt for runs targeting that repo.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* chore: wire agent instructions route into generated route tree

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

* fix: enforce repo access on instruction routes

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-09 15:46:29 -07:00

36 lines
1.1 KiB
TypeScript

import { Navigate, createFileRoute } from "@tanstack/react-router";
import { AgentInstructionsPanel } from "@/components/AgentInstructionsPanel";
import { AppShell } from "@/components/AppShell";
import { Skeleton } from "@/components/ui/skeleton";
import { useSession } from "@/lib/session";
export const Route = createFileRoute("/agents_/instructions")({
component: AgentInstructionsPage,
});
function AgentInstructionsPage() {
const session = useSession();
if (session.isLoading) {
return (
<main className="p-6">
<Skeleton className="h-64 w-full" />
</main>
);
}
if (!session.data) return <Navigate to="/login" />;
return (
<AppShell
user={session.data}
title="Repository Instructions"
description="Per-repo custom instructions appended to the coding agent's system prompt for runs targeting that repository."
backTo={{ to: "/cloud-agents", label: "Back to Open SWE Agent" }}
>
<div className="rounded-lg border border-border bg-card">
<AgentInstructionsPanel />
</div>
</AppShell>
);
}