openclaw/apps/macos/Sources/Clawdbot/IconState.swift
Jon Shapiro 92697edb7c fix(venice): add compat settings to prevent HTTP 400 errors
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>
2026-01-26 17:56:01 -08:00

112 lines
3.0 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Foundation
import SwiftUI
enum SessionRole {
case main
case other
}
enum ToolKind: String, Codable {
case bash, read, write, edit, attach, other
}
enum ActivityKind: Codable, Equatable {
case job
case tool(ToolKind)
}
enum IconState: Equatable {
case idle
case workingMain(ActivityKind)
case workingOther(ActivityKind)
case overridden(ActivityKind)
enum BadgeProminence: Equatable {
case primary
case secondary
case overridden
}
var badgeSymbolName: String {
switch self.activity {
case .tool(.bash): "chevron.left.slash.chevron.right"
case .tool(.read): "doc"
case .tool(.write): "pencil"
case .tool(.edit): "pencil.tip"
case .tool(.attach): "paperclip"
case .tool(.other), .job: "gearshape.fill"
}
}
var badgeProminence: BadgeProminence? {
switch self {
case .idle: nil
case .workingMain: .primary
case .workingOther: .secondary
case .overridden: .overridden
}
}
var isWorking: Bool {
switch self {
case .idle: false
default: true
}
}
private var activity: ActivityKind {
switch self {
case let .workingMain(kind),
let .workingOther(kind),
let .overridden(kind):
kind
case .idle:
.job
}
}
}
enum IconOverrideSelection: String, CaseIterable, Identifiable {
case system
case idle
case mainBash, mainRead, mainWrite, mainEdit, mainOther
case otherBash, otherRead, otherWrite, otherEdit, otherOther
var id: String { self.rawValue }
var label: String {
switch self {
case .system: "System (auto)"
case .idle: "Idle"
case .mainBash: "Working main bash"
case .mainRead: "Working main read"
case .mainWrite: "Working main write"
case .mainEdit: "Working main edit"
case .mainOther: "Working main other"
case .otherBash: "Working other bash"
case .otherRead: "Working other read"
case .otherWrite: "Working other write"
case .otherEdit: "Working other edit"
case .otherOther: "Working other other"
}
}
func toIconState() -> IconState {
let map: (ToolKind) -> ActivityKind = { .tool($0) }
switch self {
case .system: return .idle
case .idle: return .idle
case .mainBash: return .workingMain(map(.bash))
case .mainRead: return .workingMain(map(.read))
case .mainWrite: return .workingMain(map(.write))
case .mainEdit: return .workingMain(map(.edit))
case .mainOther: return .workingMain(map(.other))
case .otherBash: return .workingOther(map(.bash))
case .otherRead: return .workingOther(map(.read))
case .otherWrite: return .workingOther(map(.write))
case .otherEdit: return .workingOther(map(.edit))
case .otherOther: return .workingOther(map(.other))
}
}
}