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

Function cloneMessage

apps/kimi-web/src/api/daemon/agentEventProjector.ts:334–336  ·  view source on GitHub ↗

* Decouple an emitted message from the projector's internal log. The reducer * stores emitted messages by reference; the projector keeps mutating its own * copy in place (`slot.text += delta`), so sharing the content objects makes * the reducer's delta-append run on already-appended text — the fi

(msg: AppMessage)

Source from the content-addressed store, hash-verified

332 * chunk of every text/thinking block rendered twice.
333 */
334function cloneMessage(msg: AppMessage): AppMessage {
335 return { ...msg, content: msg.content.map((c) => ({ ...c })) };
336}
337
338function startAssistantMessage(state: SessionState, sessionId: string, promptId: string): AppMessage {
339 const msg: AppMessage = {

Callers 2

seedInFlightFunction · 0.85
_projectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected