We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
parts
1 parent 972e7b7 commit a69a3faCopy full SHA for a69a3fa
agents/opencode.ts
@@ -102,7 +102,18 @@ function logPromptResult(
102
options: AgentRunOptions | undefined,
103
): void {
104
logJson({ info: result.info }, options);
105
- result.parts.forEach((part) => logJson(part, options));
+ if (Array.isArray(result.parts)) {
106
+ result.parts.forEach((part) => logJson(part, options));
107
+ } else {
108
+ logError(
109
+ {
110
+ error: "invalid_parts_array",
111
+ message: `Expected 'parts' to be an array, but got ${typeof result.parts}`,
112
+ receivedResponse: result,
113
+ },
114
+ options,
115
+ );
116
+ }
117
}
118
119
function serializeError(error: unknown): Record<string, unknown> {
0 commit comments