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

Function wakeAgentLoop

app/src/utils/main_loop.ts:65–76  ·  view source on GitHub ↗
(agentId: string)

Source from the content-addressed store, hash-verified

63 * Wake agent from sleep early
64 */
65export function wakeAgentLoop(agentId: string): void {
66 const loop = activeLoops[agentId];
67 if (loop?.isRunning && loop.sleepUntil) {
68 loop.sleepUntil = null;
69
70 // Dispatch sleep end event
71 Logger.info(agentId, `Agent woken up early`, {
72 logType: 'agent-sleep-end',
73 content: { agentId, wokeEarly: true }
74 });
75 }
76}
77
78export async function startAgentLoop(agentId: string, getToken?: TokenProvider, skipWhitelistCheck = false): Promise<void> {
79 if (activeLoops[agentId]?.isRunning) {

Callers 2

ActiveAgentViewFunction · 0.90
stopAgentLoopFunction · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected