Venice's API doesn't support certain OpenAI-compatible parameters that Clawdbot sends by default: - `store`: Venice returns HTTP 400 with no body when this is present - `developer` role: Not supported by Venice's API This adds VENICE_COMPAT settings (supportsStore: false, supportsDeveloperRole: false) to all Venice model definitions, both from the static catalog and dynamically discovered models. Fixes issues reported in PR #1666 where users experienced silent failures (HTTP 400, no body) when using Venice models. Co-authored-by: jonisjongithub <jonisjongithub@users.noreply.github.com> Co-authored-by: Clawdbot <bot@clawd.bot>
48 lines
1.4 KiB
Swift
48 lines
1.4 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import Clawdbot
|
|
|
|
@Suite struct FileHandleSafeReadTests {
|
|
@Test func readToEndSafelyReturnsEmptyForClosedHandle() {
|
|
let pipe = Pipe()
|
|
let handle = pipe.fileHandleForReading
|
|
try? handle.close()
|
|
|
|
let data = handle.readToEndSafely()
|
|
#expect(data.isEmpty)
|
|
}
|
|
|
|
@Test func readSafelyUpToCountReturnsEmptyForClosedHandle() {
|
|
let pipe = Pipe()
|
|
let handle = pipe.fileHandleForReading
|
|
try? handle.close()
|
|
|
|
let data = handle.readSafely(upToCount: 16)
|
|
#expect(data.isEmpty)
|
|
}
|
|
|
|
@Test func readToEndSafelyReadsPipeContents() {
|
|
let pipe = Pipe()
|
|
let writeHandle = pipe.fileHandleForWriting
|
|
writeHandle.write(Data("hello".utf8))
|
|
try? writeHandle.close()
|
|
|
|
let data = pipe.fileHandleForReading.readToEndSafely()
|
|
#expect(String(data: data, encoding: .utf8) == "hello")
|
|
}
|
|
|
|
@Test func readSafelyUpToCountReadsIncrementally() {
|
|
let pipe = Pipe()
|
|
let writeHandle = pipe.fileHandleForWriting
|
|
writeHandle.write(Data("hello world".utf8))
|
|
try? writeHandle.close()
|
|
|
|
let readHandle = pipe.fileHandleForReading
|
|
let first = readHandle.readSafely(upToCount: 5)
|
|
let second = readHandle.readSafely(upToCount: 32)
|
|
|
|
#expect(String(data: first, encoding: .utf8) == "hello")
|
|
#expect(String(data: second, encoding: .utf8) == " world")
|
|
}
|
|
}
|