-
Notifications
You must be signed in to change notification settings - Fork 653
feat(vision): add chat and Google sidecars #1161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ export async function requireJson<T>(res: Response, fallbackMessage?: string): P | |
|
|
||
| export interface HealthData { status: string; version: string; uptime: number } | ||
| export interface ProviderInfo { name: string; adapter: string; baseUrl: string; defaultModel?: string; hasApiKey: boolean } | ||
| export interface ModelInfo { id: string; provider: string; namespaced: string; owned_by?: string } | ||
| export interface ModelInfo { id: string; provider: string; namespaced: string; owned_by?: string; disabled?: boolean } | ||
| export interface SettingsData { | ||
| codexAutoStart: boolean; | ||
| port: number; | ||
|
|
@@ -54,7 +54,7 @@ export interface SettingsData { | |
| diagnosticStale: boolean; | ||
| }; | ||
| } | ||
| export type SidecarBackend = "openai" | "anthropic"; | ||
| export type SidecarBackend = "openai" | "anthropic" | "chat"; | ||
| export interface SidecarSetting { backend?: SidecarBackend; model: string } | ||
| export interface SidecarData { webSearch: SidecarSetting; vision: SidecarSetting } | ||
| export interface SidecarPatch { | ||
|
|
@@ -161,6 +161,20 @@ export function sidecarModelOptions(models: ModelInfo[]) { | |
| return out; | ||
| } | ||
|
|
||
| /** Vision can use enabled routed providers; namespaced values preserve provider selection. */ | ||
| export function visionSidecarModelOptions(models: ModelInfo[]) { | ||
| const out: Array<{ value: string; label: string }> = []; | ||
| for (const model of models) { | ||
| if (model.disabled === true) continue; | ||
| if (model.provider === "openai" || model.provider === "anthropic") { | ||
| out.push({ value: model.id, label: `${model.provider}/${model.id}` }); | ||
| } else { | ||
| out.push({ value: model.namespaced, label: model.namespaced }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This branch adds every non-OpenAI/Anthropic row to the vision picker and AGENTS.md reference: gui/AGENTS.md:L9-L10 Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| return out; | ||
| } | ||
|
|
||
| /** Options for shadow-call replacement models use the proxy's canonical routing id. */ | ||
| export function shadowCallModelOptions(models: ModelInfo[], current: string | undefined) { | ||
| const out = [{ value: "", label: "—" }, ...models.map(model => ({ value: model.namespaced, label: model.namespaced }))]; | ||
|
|
@@ -169,7 +183,10 @@ export function shadowCallModelOptions(models: ModelInfo[], current: string | un | |
| } | ||
|
|
||
| export function sidecarBackendForModel(models: ModelInfo[], modelId: string): SidecarBackend { | ||
| return models.find(model => model.id === modelId)?.provider === "anthropic" ? "anthropic" : "openai"; | ||
| const model = models.find(item => item.id === modelId || item.namespaced === modelId); | ||
| if (model?.provider === "anthropic") return "anthropic"; | ||
| if (model?.provider === "openai") return "openai"; | ||
| return "chat"; | ||
|
Comment on lines
185
to
+189
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Do not classify an unresolved model ID as the A missing configured vision model is retained in
As per path instructions, GUI state changes must stay consistent with management API responses. 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: Path instructions |
||
| } | ||
|
|
||
| let lastInputWasKeyboard = false; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,7 +20,7 @@ const USAGE = `Usage: | |||||||
| ocx agent effort <status|set> [--main <level|->] [--subagent <level|->] [--json] | ||||||||
| ocx agent subagents <status|set|clear> [model,model...] [--json] | ||||||||
| ocx agent fallback <status|set|clear> [model,model...] [--poll-ms <5000-600000>] [--json] | ||||||||
| ocx agent sidecar <status|web|vision> [--model <id|->] [--backend <openai|anthropic|->] | ||||||||
| ocx agent sidecar <status|web|vision> [--model <id|->] [--backend <openai|anthropic|chat|->] | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Separate the web and vision backend choices in the usage text. Line 23 advertises Proposed fix- ocx agent sidecar <status|web|vision> [--model <id|->] [--backend <openai|anthropic|chat|->]
+ ocx agent sidecar web [--model <id|->] [--backend <openai|anthropic|->]
+ ocx agent sidecar vision [--model <id|->] [--backend <openai|anthropic|chat|->]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
| [--reasoning <level>] [--max-descriptions <n>] [--json]`; | ||||||||
|
|
||||||||
| function clearable(value: string | undefined): string | null | undefined { | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When users switch the vision backend to Auto on a setup with an Anthropic OAuth sidecar, this branch clears
backendbut persists the first OpenAI model. Runtime auto resolution still prefers Anthropic when available, so the next image request asks the Anthropic sidecar to run an OpenAI model id and the description fails. Auto should preserve a backend-compatible model or clearmodelso the runtime can use its backend default.AGENTS.md reference: gui/AGENTS.md:L9-L10
Useful? React with 👍 / 👎.