@saadnvd1/agent-os 0.3.550 → 0.3.551
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/done/index.ts +3 -0
- package/lib/needs-you.ts +3 -1
- package/lib/sidebar/shelves.ts +3 -0
- package/package.json +1 -1
package/lib/done/index.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { db, queries, type Session } from "../db";
|
|
12
12
|
import { endSessionAgent } from "../sessions/end";
|
|
13
|
+
import { clearQueue } from "../chat/queued";
|
|
13
14
|
import { getProject } from "../projects";
|
|
14
15
|
import { mergeSettled, type TaskPR } from "../tasks";
|
|
15
16
|
import { syncTaskCardInBackground } from "../lumifyhub/task-cards";
|
|
@@ -61,6 +62,8 @@ export function getDoneTarget(id: string): Session {
|
|
|
61
62
|
|
|
62
63
|
async function stopAgent(s: Session): Promise<void> {
|
|
63
64
|
await endSessionAgent(s);
|
|
65
|
+
// Nothing is left to send them to; they'd only sit unread on a stopped agent.
|
|
66
|
+
clearQueue(s.id);
|
|
64
67
|
releasePorts(s.id);
|
|
65
68
|
// Never waited on: the row is read now, and Postgres can't hold this up.
|
|
66
69
|
void dropSessionDatabase(s.id);
|
package/lib/needs-you.ts
CHANGED
|
@@ -33,11 +33,13 @@ function latestChatItem(sessionId: string): ChatItem | null {
|
|
|
33
33
|
// is routine for it.
|
|
34
34
|
export function needsYou(
|
|
35
35
|
session: Pick<Session, "id" | "view" | "updated_at" | "last_seen_at"> &
|
|
36
|
-
Partial<Pick<Session, "role" | "workspace_id">>,
|
|
36
|
+
Partial<Pick<Session, "role" | "workspace_id" | "task_status">>,
|
|
37
37
|
chatState: ChatState | null
|
|
38
38
|
): boolean {
|
|
39
39
|
const seen = sqliteMs(session.last_seen_at);
|
|
40
40
|
if (session.view === "chat") {
|
|
41
|
+
// A finished task's agent is stopped: its last turn is history, not news.
|
|
42
|
+
if (session.task_status && session.task_status !== "running") return false;
|
|
41
43
|
if (chatState === "waiting") return true;
|
|
42
44
|
if (session.role === "orchestrator")
|
|
43
45
|
return openAskCount(session.workspace_id) > 0;
|
package/lib/sidebar/shelves.ts
CHANGED
|
@@ -107,6 +107,9 @@ export function needOf(
|
|
|
107
107
|
): SessionNeed | null {
|
|
108
108
|
const live = status?.need ?? null;
|
|
109
109
|
if (live === "approve" || live === "answer" || live === "signin") return live;
|
|
110
|
+
// Finished work has no agent left to wait on you: text typed or queued
|
|
111
|
+
// for one that's been stopped is stale, not a reason to need you.
|
|
112
|
+
if (task && isFinished(task)) return null;
|
|
110
113
|
return (
|
|
111
114
|
taskNeed(task) ??
|
|
112
115
|
live ??
|