MCPcopy Create free account
hub / github.com/cortexkit/magic-context / updateErrorState

Function updateErrorState

packages/plugin/scripts/longmemeval/runner.ts:419–429  ·  view source on GitHub ↗
(questionState: QuestionRunState, step: string, error: unknown)

Source from the content-addressed store, hash-verified

417}
418
419function updateErrorState(questionState: QuestionRunState, step: string, error: unknown): void {
420 const typed = asError(error);
421 questionState.status = "error";
422 questionState.updatedAt = nowIso();
423 questionState.lastError = {
424 message: typed.message,
425 stack: typed.stack,
426 step,
427 at: questionState.updatedAt,
428 };
429}
430
431function addOpenCodeUsage(questionState: QuestionRunState, usage: TokenUsageStats, actualCostUsd: number, config: RunnerConfig): void {
432 questionState.openCodeUsage = addTokenUsage(questionState.openCodeUsage, usage);

Callers 1

processQuestionFunction · 0.85

Calls 2

nowIsoFunction · 0.85
asErrorFunction · 0.70

Tested by

no test coverage detected