MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / setAgentPhase

Function setAgentPhase

src/stores/aiChat.ts:504–516  ·  view source on GitHub ↗
(
    state: AIChatSessionState,
    phase: AgentRuntimeStatus['phase'],
    extra?: Partial<AgentRuntimeStatus>
  )

Source from the content-addressed store, hash-verified

502 }
503
504 function setAgentPhase(
505 state: AIChatSessionState,
506 phase: AgentRuntimeStatus['phase'],
507 extra?: Partial<AgentRuntimeStatus>
508 ): void {
509 const base = state.agentStatus ? { ...state.agentStatus } : buildFallbackAgentStatus(state)
510 state.agentStatus = {
511 ...base,
512 ...extra,
513 phase,
514 updatedAt: Date.now(),
515 }
516 }
517
518 function selectAssistantForSession(chatKey: string, assistantId: string): boolean {
519 const state = getSessionState(chatKey)

Callers 3

sendMessageFunction · 0.85
editCurrentRoundOnlyFunction · 0.85
stopGenerationFunction · 0.85

Calls 2

buildFallbackAgentStatusFunction · 0.85
nowMethod · 0.45

Tested by

no test coverage detected