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:
@@ -42,8 +42,6 @@ function messageHasContentFromSDK(message: SDKMessage): boolean {
|
||||
}
|
||||
|
||||
if (TOOL_TYPES.has(type)) return true
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user