Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: lint warnings

Gusc4f287398a38
diff --git a/src/web/src/app/(app)/w/[slug]/issues/page.tsx b/src/web/src/app/(app)/w/[slug]/issues/page.tsx
index 87b368311..3908832b1 100644
--- a/src/web/src/app/(app)/w/[slug]/issues/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/issues/page.tsx
@@ -241,7 +241,7 @@ export default function IssuesPage() {
const [showCompleted, setShowCompleted] = useLocalStorage<boolean>("issues-show-completed", true);
const [issues, setIssues] = useState<IssueListItem[]>([]);
const issuesRef = useRef<IssueListItem[]>([]);
- issuesRef.current = issues;
+ useEffect(() => { issuesRef.current = issues; });
const [loading, setLoading] = useState(true);
const [creating, setCreating] = useState(false);
const [sheetOpen, setSheetOpen] = useState(false);
@@ -363,8 +363,8 @@ export default function IssuesPage() {
.then(task => { if (seq === refreshSeqRef.current && selectedIdRef.current === issueId) setActiveTask(task); })
.catch(() => {});
}
- } catch (err: any) {
- if (err?.status === 404) {
+ } catch (err: unknown) {
+ if (err && typeof err === "object" && "status" in err && (err as { status: number }).status === 404) {
handleSheetOpenChange(false);
}
}
@@ -372,13 +372,13 @@ export default function IssuesPage() {
const detailConvId = detail?.issue.conversation_id ?? null;
const detailConvIdRef = useRef<string | null>(null);
- detailConvIdRef.current = detailConvId;
+ useEffect(() => { detailConvIdRef.current = detailConvId; });
const detailTaskId = detail?.issue.latest_task_id ?? null;
const detailTaskIdRef = useRef<string | null>(null);
- detailTaskIdRef.current = detailTaskId;
+ useEffect(() => { detailTaskIdRef.current = detailTaskId; });
const detailAgentId = detail?.issue.agent_id ?? null;
const detailAgentIdRef = useRef<string | null>(null);
- detailAgentIdRef.current = detailAgentId;
+ useEffect(() => { detailAgentIdRef.current = detailAgentId; });
useEffect(() => {
if (!detailTaskId) { setActiveTask(null); return; }
@@ -389,12 +389,6 @@ export default function IssuesPage() {
return () => { cancelled = true; };
}, [detailTaskId, workspaceId]);
- const isTaskActive = activeTask && !["completed", "failed", "cancelled", "superseded"].includes(activeTask.status);
- const hasActiveTraceTasks = traceTasks?.some(t =>
- ["queued", "dispatched", "running"].includes(t.status)
- ) ?? false;
-
-
useEffect(() => {
const unsub = subscribeWs((msg: WsMessage) => {
if (msg.type === "conversation.message" && detailConvIdRef.current && msg.conversationId === detailConvIdRef.current) {
diff --git a/src/web/src/app/(app)/w/[slug]/unread/page.tsx b/src/web/src/app/(app)/w/[slug]/unread/page.tsx
index 8faf62f34..4ed88cbf7 100644
--- a/src/web/src/app/(app)/w/[slug]/unread/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/unread/page.tsx
@@ -128,7 +128,7 @@ export default function InboxPage() {
const scrollRef = useRef<HTMLDivElement>(null);
const isFetchingRef = useRef(false);
const filterTypesRef = useRef(filterTypes);
- filterTypesRef.current = filterTypes;
+ useEffect(() => { filterTypesRef.current = filterTypes; });
const loadInitial = useCallback(async (opts?: { silent?: boolean }) => {
if (!opts?.silent) setLoading(true);
@@ -144,7 +144,7 @@ export default function InboxPage() {
}, [workspaceId]);
const refreshInboxCountRef = useRef(refreshInboxCount);
- refreshInboxCountRef.current = refreshInboxCount;
+ useEffect(() => { refreshInboxCountRef.current = refreshInboxCount; });
useEffect(() => {
loadInitial();
diff --git a/src/web/src/app/api/studios/check-handles/route.ts b/src/web/src/app/api/studios/check-handles/route.ts
index 165f01acc..7decb29dd 100644
--- a/src/web/src/app/api/studios/check-handles/route.ts
+++ b/src/web/src/app/api/studios/check-handles/route.ts
@@ -7,7 +7,7 @@ import { getDb } from "@/lib/db";
import { withAuth } from "@/lib/middleware/auth";
import { writeJSON, writeError } from "@/lib/middleware/helpers";
-export const POST = withAuth(async (req: NextRequest, _ctx) => {
+export const POST = withAuth(async (req: NextRequest) => {
let body: { names: string[] };
try {
body = await req.json() as { names: string[] };
diff --git a/src/web/src/components/agent-chat/agent-chat-view.tsx b/src/web/src/components/agent-chat/agent-chat-view.tsx
index 02a3f73c9..3bd6730ae 100644
--- a/src/web/src/components/agent-chat/agent-chat-view.tsx
+++ b/src/web/src/components/agent-chat/agent-chat-view.tsx
@@ -367,7 +367,7 @@ export function AgentChatView({
const [selectionPopup, setSelectionPopup] = useState<{ text: string; x: number; y: number } | null>(null);
const [flaggedIds, setFlaggedIds] = useState<Set<string>>(new Set());
const flaggedIdsRef = useRef(flaggedIds);
- flaggedIdsRef.current = flaggedIds;
+ useEffect(() => { flaggedIdsRef.current = flaggedIds; });
const { increment: flagIncrement, decrement: flagDecrement } = useFlagCount();
diff --git a/src/web/src/components/agent-chat/artifact-sheet.tsx b/src/web/src/components/agent-chat/artifact-sheet.tsx
index df8092959..e7ee4c86c 100644
--- a/src/web/src/components/agent-chat/artifact-sheet.tsx
+++ b/src/web/src/components/agent-chat/artifact-sheet.tsx
@@ -121,7 +121,7 @@ export function ArtifactSheet({ open, onOpenChange, artifacts, workspaceId, init
</SheetHeader>
<SheetBody className={cn(
"thin-scrollbar",
- isHtmlType(selectedArtifact.content_type) && "!p-0 !overflow-hidden"
+ isHtmlType(selectedArtifact.content_type) && "p-0! overflow-hidden!"
)}>
<ArtifactContentRenderer artifact={selectedArtifact} workspaceId={workspaceId} />
</SheetBody>
diff --git a/src/web/src/components/agent-chat/email-event-sheet.tsx b/src/web/src/components/agent-chat/email-event-sheet.tsx
index f691a61c5..cd3c1916b 100644
--- a/src/web/src/components/agent-chat/email-event-sheet.tsx
+++ b/src/web/src/components/agent-chat/email-event-sheet.tsx
@@ -33,7 +33,7 @@ export function EmailEventSheet({ open, onOpenChange, emailId, workspaceId }: Em
const [width, setWidth] = useState(DEFAULT_WIDTH);
const dragging = useRef(false);
const onOpenChangeRef = useRef(onOpenChange);
- onOpenChangeRef.current = onOpenChange;
+ useEffect(() => { onOpenChangeRef.current = onOpenChange; });
useEffect(() => {
if (!open || !emailId) return;
diff --git a/src/web/src/components/app-sidebar.tsx b/src/web/src/components/app-sidebar.tsx
index 02f9a49f4..8dd160c35 100644
--- a/src/web/src/components/app-sidebar.tsx
+++ b/src/web/src/components/app-sidebar.tsx
@@ -666,6 +666,7 @@ export function AppSidebar({ onNavigate }: { onNavigate?: () => void } = {}) {
activeAgentId={activeAgentId}
isOnline={hasOnlineRuntime}
taskCounts={taskCounts}
+ // eslint-disable-next-line react-hooks/refs -- stable DOM ref read, useEffect would cause anchor flash
anchorRef={folderAnchorRefs.current.get(expandedFolder.id) ?? null}
onAgentClick={handleAgentClick}
onRemoveFromFolder={(agentId) =>
diff --git a/src/web/src/components/studio-onboarding/scenario-presets.ts b/src/web/src/components/studio-onboarding/scenario-presets.ts
index ae61fe6c8..9635f7273 100644
--- a/src/web/src/components/studio-onboarding/scenario-presets.ts
+++ b/src/web/src/components/studio-onboarding/scenario-presets.ts
@@ -150,46 +150,6 @@ Report additionally:
${ESCALATION_SECTION}`;
-const RESEARCHER_GENERAL = `You are the research specialist. You gather information, read documentation, and organize findings so the team can make informed decisions.
-
-## Core Principle
-Your job is to find the truth and present it clearly. You are not a search engine — you synthesize, compare, and form conclusions.
-
-## Before You Begin
-When you receive a research request, confirm your understanding:
-- What question are we answering?
-- What decision does this inform?
-- What scope is reasonable?
-
-If the request is ambiguous, ask one focused clarification before starting.
-
-## How You Work
-1. Gather information from available sources: documentation, code, web, files.
-2. Organize findings with clear structure: what you found, what it means, what you recommend.
-3. Be explicit about confidence levels. Distinguish "I verified this" from "I believe this based on indirect evidence."
-4. Set a reasonable scope and stop. Don't research indefinitely.
-
-## Output Standards
-- Lead with the answer or recommendation, then supporting evidence.
-- Cite sources: URLs, file paths, documentation sections.
-- If sources conflict, present both sides and explain which you trust more and why.
-- If you can't find a definitive answer, say so clearly rather than guessing.
-
-${REPORTING_PROTOCOL_SECTION}
-Report additionally:
-- **Summary:** 1-3 sentence answer
-- **Findings:** Detailed evidence (with sources)
-- **Recommendation:** What I'd suggest based on this
-- **Confidence:** High / Medium / Low (and why)
-
-## What NOT to Do
-- Don't pad reports with irrelevant context to seem thorough.
-- Don't present raw search results without synthesis.
-- Don't hedge everything — take a position when the evidence supports one.
-- Don't deliver a report you're unsure about without flagging it as DONE_WITH_CONCERNS.
-
-${ESCALATION_SECTION}`;
-
// --- Engineer (used in software-dev and full-team) ---
const ENGINEER_INSTRUCTIONS = `You are the engineering specialist. You write code, run tests, debug issues, and verify implementations.
@@ -274,88 +234,6 @@ Report additionally:
${ESCALATION_SECTION}`;
-const ASSISTANT_PRODUCTIVITY = `You are the operations specialist. You handle email follow-ups, reminders, scheduling, and administrative tasks that keep things running smoothly.
-
-## Core Principle
-Nothing falls through the cracks. You are the team's operational memory — tracking what needs to happen, when, and following up until it's done.
-
-## Before You Begin
-When you receive a task:
-- Confirm: what's the action, who's the target, what's the deadline?
-- If any of these are ambiguous, ask one focused question before starting.
-
-## How You Work
-1. When asked to follow up on something, track it with a clear deadline and action.
-2. Send emails that are warm, professional, and concise. Get to the point quickly.
-3. For reminders, provide enough context that the recipient knows what to do.
-4. For scheduling, confirm times clearly and account for timezone differences.
-
-## Email Standards
-- Subject lines: specific and actionable, not generic.
-- Body: short. Lead with what you need from the recipient.
-- Follow-ups: reference original context briefly.
-- Tone: match the relationship — formal for external, casual for internal.
-
-${REPORTING_PROTOCOL_SECTION}
-Report additionally:
-- **What I did:** Action taken (email sent, reminder set, etc.)
-- **Next step:** What happens next (waiting for reply, follow-up on X date)
-- **Concerns:** Anything the leader should know (no response, bounced email, etc.)
-
-## Task Tracking
-- When you complete a follow-up, report what happened and what the next step is.
-- If no response after a reasonable wait, escalate — don't spam.
-- Keep the leader informed of pending items and upcoming deadlines proactively.
-
-## What NOT to Do
-- Don't send reminders too aggressively. One follow-up, then escalate.
-- Don't make decisions about task priority — that's the leader's job.
-- Don't draft emails longer than necessary.
-- Don't guess at recipient addresses or details — ask if unsure.
-
-${ESCALATION_SECTION}`;
-
-const ASSISTANT_GENERAL = `You are the operations specialist. You handle email follow-ups, reminders, scheduling, and administrative tasks that keep the team running smoothly.
-
-## Core Principle
-Nothing falls through the cracks. You are the team's operational memory — tracking what needs to happen, when, and following up until it's done.
-
-## Before You Begin
-When you receive a task:
-- Confirm: what's the action, who's the target, what's the deadline?
-- If any of these are ambiguous, ask one focused question before starting.
-
-## How You Work
-1. When asked to follow up on something, track it with a clear deadline and action.
-2. Send emails that are warm, professional, and concise. Get to the point quickly.
-3. For reminders, provide enough context that the recipient knows what to do.
-4. For scheduling, confirm times clearly and account for timezone differences.
-
-## Email Standards
-- Subject lines: specific and actionable, not generic.
-- Body: short. Lead with what you need from the recipient.
-- Follow-ups: reference original context briefly.
-- Tone: match the relationship — formal for external, casual for internal.
-
-${REPORTING_PROTOCOL_SECTION}
-Report additionally:
-- **What I did:** Action taken (email sent, reminder set, etc.)
-- **Next step:** What happens next (waiting for reply, follow-up on X date)
-- **Concerns:** Anything the leader should know (no response, bounced email, etc.)
-
-## Task Tracking
-- When you complete a follow-up, report what happened and what the next step is.
-- If no response after a reasonable wait, escalate — don't spam.
-- Keep the leader informed of pending items and upcoming deadlines proactively.
-
-## What NOT to Do
-- Don't send reminders too aggressively. One follow-up, then escalate.
-- Don't make decisions about task priority — that's the leader's job.
-- Don't draft emails longer than necessary.
-- Don't guess at recipient addresses or details — ask if unsure.
-
-${ESCALATION_SECTION}`;
-
// --- Personal Assistant: solo all-in-one agent ---
const LEADER_PERSONAL_ASSISTANT = `You are a personal AI assistant. You work solo — there's no team to delegate to. You handle everything directly: emails, research, scheduling, writing, analysis, and whatever else comes your way.
diff --git a/src/web/src/contexts/agent-chat-sheet-context.tsx b/src/web/src/contexts/agent-chat-sheet-context.tsx
index 3a6338ef3..2d5a0acb8 100644
--- a/src/web/src/contexts/agent-chat-sheet-context.tsx
+++ b/src/web/src/contexts/agent-chat-sheet-context.tsx
@@ -5,6 +5,7 @@ import {
useContext,
useState,
useCallback,
+ useEffect,
useRef,
type ReactNode,
} from "react";
@@ -47,7 +48,7 @@ export function AgentChatSheetProvider({ children }: { children: ReactNode }) {
const agent = agentId ? agents.find((a) => a.id === agentId) ?? null : null;
const agentsRef = useRef(agents);
- agentsRef.current = agents;
+ useEffect(() => { agentsRef.current = agents; });
const openAgentChat = useCallback(
(id: string, opts?: { conversationId?: string; taskId?: string; messageId?: string }) => {
diff --git a/src/web/src/contexts/inbox-count-context.tsx b/src/web/src/contexts/inbox-count-context.tsx
index 6a363789c..09da6c14f 100644
--- a/src/web/src/contexts/inbox-count-context.tsx
+++ b/src/web/src/contexts/inbox-count-context.tsx
@@ -38,7 +38,7 @@ export function InboxCountProvider({ children }: { children: ReactNode }) {
const pendingAgentIdRef = useRef<string | null>(null);
const agentsRef = useRef(agents);
- agentsRef.current = agents;
+ useEffect(() => { agentsRef.current = agents; });
const refresh = useCallback(() => {
const types = getInboxFilterTypes();