MCPcopy Create free account
hub / github.com/Roy3838/Observer / pauseAgentLoop

Function pauseAgentLoop

app/src/utils/main_loop.ts:48–61  ·  view source on GitHub ↗
(agentId: string, durationMs: number)

Source from the content-addressed store, hash-verified

46 * Pause agent execution for a specified duration
47 */
48export function pauseAgentLoop(agentId: string, durationMs: number): void {
49 if (activeLoops[agentId]?.isRunning) {
50 activeLoops[agentId].sleepUntil = Date.now() + durationMs;
51
52 // Dispatch sleep start event
53 Logger.info(agentId, `Agent sleeping for ${Math.round(durationMs/1000)}s`, {
54 logType: 'agent-sleep-start',
55 content: {
56 agentId,
57 durationMs
58 }
59 });
60 }
61}
62
63/**
64 * Wake agent from sleep early

Callers 1

sleepFunction · 0.90

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected