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

Method emitStatusUpdated

packages/agent-core/src/agent/index.ts:499–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

497 }
498
499 emitStatusUpdated(): void {
500 if (this.records.restoring) return;
501 if (!this.config.hasModel) return;
502
503 const contextTokens = this.context.tokenCount;
504 const maxContextTokens = this.config.modelCapabilities.max_context_tokens;
505 const contextUsage =
506 maxContextTokens !== undefined && maxContextTokens > 0
507 ? contextTokens / maxContextTokens
508 : undefined;
509 const usage: UsageStatus | undefined = this.usage.status();
510 const model = this.config.model;
511
512 this.emitEvent({
513 type: 'agent.status.updated',
514 model,
515 contextTokens,
516 maxContextTokens,
517 contextUsage,
518 planMode: this.planMode.isActive,
519 swarmMode: this.swarmMode.isActive,
520 permission: this.permission.mode,
521 usage,
522 });
523 }
524
525 private emitRecordsWriteError(error: unknown, record?: AgentRecord | undefined): void {
526 const message = error instanceof Error ? error.message : String(error);

Callers 11

enterMethod · 0.80
exitMethod · 0.80
clearMethod · 0.80
undoMethod · 0.80
applyCompactionMethod · 0.80
setModeMethod · 0.80
enterMethod · 0.80
cancelMethod · 0.80
exitMethod · 0.80
recordMethod · 0.80
updateMethod · 0.80

Implementers 1

AcpServerpackages/acp-adapter/src/server.ts

Calls 2

emitEventMethod · 0.95
statusMethod · 0.65

Tested by

no test coverage detected