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

Function wakeAgentLoop

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

Source from the content-addressed store, hash-verified

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

Callers 2

ActiveAgentViewFunction · 0.90
stopAgentLoopFunction · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected