MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / resumeAgent

Method resumeAgent

packages/agent-core/src/session/index.ts:870–887  ·  view source on GitHub ↗
(
    id: string,
    stack: readonly string[] = [],
  )

Source from the content-addressed store, hash-verified

868 }
869
870 private resumeAgent(
871 id: string,
872 stack: readonly string[] = [],
873 ): Promise<ResumedAgent> {
874 if (stack.includes(id)) {
875 throw new KimiError(
876 ErrorCodes.SESSION_STATE_INVALID,
877 `Session agent parent chain contains a cycle: ${[...stack, id].join(' -> ')}`,
878 );
879 }
880
881 const entry = this.agents.get(id);
882 if (entry !== undefined) return this.resolveAgentEntry(entry);
883
884 const promise = this.resumePersistedAgent(id, stack);
885 this.agents.set(id, promise);
886 return promise;
887 }
888
889 private async resumePersistedAgent(
890 id: string,

Callers 3

resumeMethod · 0.95
ensureAgentResumedMethod · 0.95
resumePersistedAgentMethod · 0.95

Calls 4

resolveAgentEntryMethod · 0.95
resumePersistedAgentMethod · 0.95
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected