fix: address Cubic round-6 P2/P3 issues

- P2: treat unknown part types as non-content in message-builder messageHasContentFromSDK
- P3: reuse shared isRecord from record-type-guard.ts in opencode-http-api
This commit is contained in:
YeonGyu-Kim
2026-02-16 15:08:10 +09:00
parent 3fe9c1f6e4
commit c799584e61
2 changed files with 1 additions and 6 deletions

View File

@@ -42,8 +42,6 @@ function messageHasContentFromSDK(message: SDKMessage): boolean {
}
if (TOOL_TYPES.has(type)) return true
return true
}
return false

View File

@@ -1,12 +1,9 @@
import { getServerBasicAuthHeader } from "./opencode-server-auth"
import { log } from "./logger"
import { isRecord } from "./record-type-guard"
type UnknownRecord = Record<string, unknown>
function isRecord(value: unknown): value is UnknownRecord {
return typeof value === "object" && value !== null
}
function getInternalClient(client: unknown): UnknownRecord | null {
if (!isRecord(client)) {
return null