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

Function pauseAgentLoop

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

Source from the content-addressed store, hash-verified

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

Callers 1

sleepFunction · 0.90

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected