fix(v2 managed agents ui): only treat assistant in_progress as active

User messages from opencode have no completed_at and normalize to status=in_progress,
which made hasInProgress always true → Stop button stuck on. Filter to assistant-only.
This commit is contained in:
Ishaan Jaffer 2026-05-07 13:04:09 -07:00
parent 07315c47e9
commit 7e0e4f1dfc
No known key found for this signature in database

View file

@ -174,8 +174,14 @@ export default function SessionThreadView() {
const messagesEndRef = useRef<HTMLDivElement | null>(null);
const scrollContainerRef = useRef<HTMLDivElement | null>(null);
// Only ASSISTANT messages count as "in flight". User messages from opencode
// have no completed_at so they normalize as in_progress, but they're not
// running anything — only assistant turns are.
const hasInProgress = useMemo(
() => messages.some((m) => m.status === "in_progress"),
() =>
messages.some(
(m) => m.role === "assistant" && m.status === "in_progress",
),
[messages],
);