MCPcopy Create free account
hub / github.com/MemTensor/MemOS / getActiveTask

Method getActiveTask

packages/memos-core/src/storage/sqlite.ts:1588–1599  ·  view source on GitHub ↗
(sessionKey: string, owner?: string)

Source from the content-addressed store, hash-verified

1586 }
1587
1588 getActiveTask(sessionKey: string, owner?: string): Task | null {
1589 if (owner) {
1590 const row = this.db.prepare(
1591 "SELECT * FROM tasks WHERE session_key = ? AND status = 'active' AND owner = ? ORDER BY started_at DESC LIMIT 1",
1592 ).get(sessionKey, owner) as TaskRow | undefined;
1593 return row ? rowToTask(row) : null;
1594 }
1595 const row = this.db.prepare(
1596 "SELECT * FROM tasks WHERE session_key = ? AND status = 'active' ORDER BY started_at DESC LIMIT 1",
1597 ).get(sessionKey) as TaskRow | undefined;
1598 return row ? rowToTask(row) : null;
1599 }
1600
1601 hasTaskForSession(sessionKey: string): boolean {
1602 const row = this.db.prepare(

Callers 2

detectAndProcessMethod · 0.45
processAgentMethod · 0.45

Calls 3

prepareMethod · 0.80
rowToTaskFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected