Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: unread page re-fetch

Gusa2b2572c6ab6
diff --git a/src/cli/daemon/execenv/context.ts b/src/cli/daemon/execenv/context.ts
index cdb6d43fc..d5f882a94 100644
--- a/src/cli/daemon/execenv/context.ts
+++ b/src/cli/daemon/execenv/context.ts
@@ -113,6 +113,7 @@ Below are your direct colleagues. You can reach them via email.
**Important:**
- When communicating with a colleague on the **same topic** as an existing email thread, reply to that thread (use --in-reply-to) to keep context together.
- **When starting a NEW topic or task that is unrelated to any previous email thread, you MUST compose a brand new email (do NOT use --in-reply-to). Never hijack an unrelated thread just because you recently emailed that colleague.** Judge by topic/task relevance, not by recency of communication.
+ - Make sure to send follow-up emails to your colleagues to stop the previous wrong directions or instructions you sent before, don't make your colleague running for nothing.
`;
for (let i = 0; i < task.agent.colleagues.length; i++) {
const c = task.agent.colleagues[i];
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 fa9624b0a..ef67c8e7c 100644
--- a/src/web/src/app/(app)/w/[slug]/unread/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/unread/page.tsx
@@ -126,7 +126,7 @@ function SkeletonRow({ promptWidth }: { promptWidth: string }) {
export default function InboxPage() {
const { slug, workspaceId } = useWorkspace();
const { subscribeWs } = useAgentContext();
- const { refresh: refreshInboxCount, decrement: decrementInboxCount } = useInboxCount();
+ const { count, refresh: refreshInboxCount, decrement: decrementInboxCount } = useInboxCount();
const [items, setItems] = useState<InboxItem[]>([]);
const [loading, setLoading] = useState(true);
@@ -168,6 +168,17 @@ export default function InboxPage() {
});
}, [subscribeWs, loadInitial]);
+ const lastSeenCountRef = useRef<number | null>(null);
+
+ useEffect(() => {
+ if (lastSeenCountRef.current !== null && count > lastSeenCountRef.current) {
+ const timer = setTimeout(() => loadInitial({ silent: true }), 1500);
+ lastSeenCountRef.current = count;
+ return () => clearTimeout(timer);
+ }
+ lastSeenCountRef.current = count;
+ }, [count, loadInitial]);
+
const loadMore = useCallback(async () => {
if (isFetchingRef.current || !hasMore || items.length === 0) return;
isFetchingRef.current = true;