MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / findAssistantMessage

Function findAssistantMessage

src/core/parser-opencode.ts:128–136  ·  view source on GitHub ↗
(messages: OcMessage[], startIndex: number, parentId: string)

Source from the content-addressed store, hash-verified

126}
127
128function findAssistantMessage(messages: OcMessage[], startIndex: number, parentId: string): OcMessage | null {
129 for (let i = startIndex; i < messages.length; i++) {
130 const candidate = messages[i];
131 if (candidate.role === 'assistant' && candidate.parentID === parentId) return candidate;
132 }
133
134 const next = messages[startIndex];
135 return next?.role === 'assistant' ? next : null;
136}
137
138function applyOpenCodePart(part: OcPart, data: Pick<OpenCodeAssistantData, 'toolsUsed' | 'editedFiles' | 'referencedFiles'>, textParts: string[]): void {
139 if (part.type === 'text' && part.text) {

Callers 1

parseOpenCodeSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected