mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-18 21:01:19 -08:00
Sync upstream v2.4.0 into v2.4.1: welcome dialog, bug/idea button with issue templates, version in Help, gear preferences and ocean default accent, plus web console screenshots, new landing page and web-console-first docs
AI Assisted
This commit is contained in:
1 parent
8dc2f5d15d
commit
4a5f759173
288 files changed
+25222
-4767
No files matched your search
@@ -211,13 +211,15 @@ export function shouldChime(prevDot, nextDot) {
|
||||
const ADRIFT_MS = 3 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Whether nobody is there to answer a chat message. A finished or paused
|
||||
* session has no agent coming back to it; otherwise the agent is offline once
|
||||
* it has been silent longer than the page would tolerate before calling it
|
||||
* stuck (working) or adrift (anything else).
|
||||
* Whether nobody is there to answer a chat message. A finished session's agent
|
||||
* is often still listening through its last wait (the review and dashboard
|
||||
* buttons on the hand-off card live as long as it does), so finish alone does
|
||||
* not end the chat — going quiet does. Offline once the agent has been silent
|
||||
* longer than the page would tolerate before calling it stuck (working) or
|
||||
* adrift (anything else), which is also the only signal left once the server
|
||||
* is gone.
|
||||
*/
|
||||
export function chatOffline({ finish, agent, agentLastSeenMs, now }) {
|
||||
if (finish) return true;
|
||||
const silent = now - agentLastSeenMs;
|
||||
if (agent && agent.status === "working") return silent > quietLimitMs(agent, STALE_MS);
|
||||
return silent > quietLimitMs(agent, ADRIFT_MS);
|
||||
|
||||
Reference in new issue
Block a user