Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.
- **Search an organization's members.** `listOrganizationMembers` takes `search`, which narrows the
list to the members whose name or address starts with it or holds it, ignoring case, best
matches first. Only that organization's current members are ever listed.
- **TrustedRouter as an AI connection, and the AI provider in answers can gain values.**
`PUT /api/v2/organizations/{organizationId}/ai-connection` (`replaceAiConnection`) takes
`provider: trustedrouter` with `login: endpoint`, an address and a key, like `unbiased`. In
answers, `provider` is now declared open (`x-extensible-enum`, `AiConnectionProviderAnswer`), so
a script that reads it should show a provider it doesn't know by its id rather than fail. A
request still names one of the closed `AiConnectionProvider` list.
- New optional fields: `organizationId` on a conversation event and on a Recorder connection, and
`hostedSignIn` on `deployment`, true where people sign in through OpenBot by CopilotKit's own
sign-in, starting at `/api/auth/hosted/sign-in`.
Expand Down Expand Up @@ -108,6 +114,11 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.

### OpenBot Desktop

- **TrustedRouter is on the Connect your AI screen**, and in Settings where the AI connection is
changed. TrustedRouter is an OpenAI-compatible gateway in front of many providers. A TrustedRouter
API key is all the row asks for: OpenBot fills in `https://api.trustedrouter.com/v1` and the model
`anthropic/claude-sonnet-5.5`, which can be changed to any name the gateway lists. The model list
reads the gateway's `/models`, as it does for any other compatible endpoint.
- **OpenBot Desktop's back end moves to CopilotKit Intelligence 0.17.0-rc.4.** The bundled CLI
moves to `copilotkit@3e64135`, so an install or update runs Intelligence 0.17.0-rc.4.
- **Setup no longer stops for good after the back end's saved settings were deleted.** With
Expand Down
4 changes: 4 additions & 0 deletions api/accepted-breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,7 @@ it in those words when it is the reason, and the release run fails if the releas
- 2026-11-18 GET /api/v2/organizations/{organizationId}/settings the `mcpAllowlist/servers/items/` response's property pattern was changed from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` for the status `200` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has.
- 2026-11-18 PATCH /api/v2/organizations/{organizationId}/settings changed the pattern of the request property `mcpAllowlist/servers/items/` from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has.
- 2026-11-18 PATCH /api/v2/organizations/{organizationId}/settings the `mcpAllowlist/servers/items/` response's property pattern was changed from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` for the status `200` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has.
- 2026-11-20 GET /api/v2/organizations/{organizationId}/ai-connection removed the enum constraint from the `saved/items/provider` response property for the response status `200`. The AI provider a connection answers with is declared open with x-extensible-enum (AiConnectionProviderAnswer), so a provider such as trustedrouter can be added, and every client reads a value it doesn't know (api/README.md, Enums that grow). A request still names one of the closed AiConnectionProvider list.
- 2026-11-20 PUT /api/v2/organizations/{organizationId}/ai-connection removed the enum constraint from the `saved/items/provider` response property for the response status `200`. The same open provider in the answer to a switch.
- 2026-11-20 GET /api/v2/organizations/{organizationId}/ai-connection added `#/components/schemas/AiConnectionProviderAnswer` to the `provider` response property `oneOf` list for the response status `200`. The open copy of AiConnectionProvider, with its values, in place of the closed one beside null: the same change as the line above, as oasdiff words it for a nullable property.
- 2026-11-20 PUT /api/v2/organizations/{organizationId}/ai-connection added `#/components/schemas/AiConnectionProviderAnswer` to the `provider` response property `oneOf` list for the response status `200`. The same open provider in the answer to a switch.
34 changes: 34 additions & 0 deletions api/openapi-ai-connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,40 @@ test("every example the spec shows is one the generated client accepts", () => {
}
});

test("an answer may name a provider this client doesn't know, and a switch is refused one the server doesn't take", () => {
const answer = {
provider: "a-provider-added-later",
login: "endpoint",
model: "model-a",
endpointHost: "api.example.com",
keySet: true,
ready: true,
source: "stored",
editable: true,
saved: [
{
provider: "a-provider-added-later",
login: "endpoint",
endpointHost: "api.example.com",
},
],
changedAt: "2026-11-20T00:00:00Z",
};
expect(GetAiConnectionResponse.safeParse(answer).success).toBe(true);
const body = (provider: string) =>
ReplaceAiConnectionBody.safeParse({
provider,
login: "endpoint",
baseUrl: "https://api.trustedrouter.com/v1",
model: "anthropic/claude-sonnet-5.5",
apiKey: "sk-example",
}).success;
expect(body("trustedrouter")).toBe(true);
expect(body("unbiased")).toBe(true);
expect(body("a-provider-added-later")).toBe(false);
expect(body("")).toBe(false);
});

test("an endpoint address is http or https with nothing in it that signs in", () => {
const endpoint = (baseUrl: string) =>
ReplaceAiConnectionBody.safeParse({
Expand Down
26 changes: 19 additions & 7 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25453,19 +25453,20 @@ components:
label:
type: string
description: Its name, as a model picker shows it.
AiConnectionProvider:
AiConnectionProviderAnswer:
type: string
description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI''s API, at an address given.'
enum:
x-extensible-enum:
- openai
- anthropic
- google
- xai
- unbiased
- trustedrouter
- openai-compatible
description: 'The AI provider OpenBot''s Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given. The list can grow: a client shows a provider it doesn''t know by its id. A request still names one of AiConnectionProvider.'
AiConnectionLogin:
type: string
description: 'How OpenBot signs in to the provider. plan: the person''s Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person''s Google or xAI sign-in (google, xai).'
description: 'How OpenBot signs in to the provider. plan: the person''s Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person''s Google or xAI sign-in (google, xai).'
enum:
- plan
- api-key
Expand All @@ -25480,7 +25481,7 @@ components:
- endpointHost
properties:
provider:
$ref: '#/components/schemas/AiConnectionProvider'
$ref: '#/components/schemas/AiConnectionProviderAnswer'
login:
$ref: '#/components/schemas/AiConnectionLogin'
endpointHost:
Expand All @@ -25506,7 +25507,7 @@ components:
provider:
description: The provider. Null while none is chosen yet.
oneOf:
- $ref: '#/components/schemas/AiConnectionProvider'
- $ref: '#/components/schemas/AiConnectionProviderAnswer'
- type: 'null'
login:
description: How OpenBot signs in to it. Null while none is chosen yet.
Expand Down Expand Up @@ -25550,10 +25551,21 @@ components:
- 'null'
format: date-time
description: When it was last changed. Null if never.
AiConnectionProvider:
type: string
description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given.'
enum:
- openai
- anthropic
- google
- xai
- unbiased
- trustedrouter
- openai-compatible
AiConnectionInput:
type: object
additionalProperties: false
description: The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased and openai-compatible take endpoint. Any other pair is refused.
description: The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased, trustedrouter and openai-compatible take endpoint. Any other pair is refused.
required:
- provider
- login
Expand Down
27 changes: 19 additions & 8 deletions api/openapi/model-connections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,17 +780,27 @@ components:
description: >-
The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic:
Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI.
trustedrouter: TrustedRouter. openai-compatible: any server that
speaks OpenAI's API, at an address given.
enum: [openai, anthropic, google, xai, unbiased, trustedrouter, openai-compatible]
AiConnectionProviderAnswer:
type: string
x-extensible-enum: [openai, anthropic, google, xai, unbiased, trustedrouter, openai-compatible]
description: >-
The AI provider OpenBot's Bots run on, as the server answers it.
openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai:
xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter.
openai-compatible: any server that speaks OpenAI's API, at an address
given.
enum: [openai, anthropic, google, xai, unbiased, openai-compatible]
given. The list can grow: a client shows a provider it doesn't know
by its id. A request still names one of AiConnectionProvider.
AiConnectionLogin:
type: string
description: >-
How OpenBot signs in to the provider. plan: the person's Claude or
ChatGPT plan (openai, anthropic). api-key: a key from the provider
(openai, anthropic). endpoint: an address and, where it asks for one,
a key (google, xai, unbiased, openai-compatible). oauth: the person's
Google or xAI sign-in (google, xai).
a key (google, xai, unbiased, trustedrouter, openai-compatible).
oauth: the person's Google or xAI sign-in (google, xai).
enum: [plan, api-key, endpoint, oauth]
AiConnectionSaved:
type: object
Expand All @@ -800,7 +810,7 @@ components:
required: [provider, login, endpointHost]
properties:
provider:
$ref: '#/components/schemas/AiConnectionProvider'
$ref: '#/components/schemas/AiConnectionProviderAnswer'
login:
$ref: '#/components/schemas/AiConnectionLogin'
endpointHost:
Expand All @@ -826,7 +836,7 @@ components:
provider:
description: The provider. Null while none is chosen yet.
oneOf:
- $ref: '#/components/schemas/AiConnectionProvider'
- $ref: '#/components/schemas/AiConnectionProviderAnswer'
- type: 'null'
login:
description: How OpenBot signs in to it. Null while none is chosen yet.
Expand Down Expand Up @@ -879,8 +889,9 @@ components:
additionalProperties: false
description: >-
The connection to switch to. openai and anthropic take plan or
api-key; google and xai take endpoint or oauth; unbiased and
openai-compatible take endpoint. Any other pair is refused.
api-key; google and xai take endpoint or oauth; unbiased,
trustedrouter and openai-compatible take endpoint. Any other pair is
refused.
required: [provider, login]
properties:
provider:
Expand Down
4 changes: 3 additions & 1 deletion app/src/lib/ai-connection/desktop.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {
AiConnectionLogin,
AiConnectionProvider,
AiConnectionProviderAnswer,
} from "@/lib/api/generated/model";
import { invokeDesktop } from "@/lib/desktop/queries";

Expand Down Expand Up @@ -116,7 +117,8 @@ export function prepareAiConnection(
* longer needed, and moves the default Bot to one that can use it.
*/
export function settleAiConnection(connection: {
provider: AiConnectionProvider;
/** As the server answered it, so possibly a provider this app doesn't know: Desktop says so. */
provider: AiConnectionProviderAnswer;
login: AiConnectionLogin;
model?: string | null;
endpointHost?: string | null;
Expand Down
21 changes: 20 additions & 1 deletion app/src/lib/ai-connection/providers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {
AiConnectionLogin,
AiConnectionProvider,
AiConnectionProviderAnswer,
} from "@/lib/api/generated/model";

/**
Expand Down Expand Up @@ -66,6 +67,14 @@ export const AI_PROVIDERS: AiProvider[] = [
logins: ["oauth", "endpoint"],
mark: "unbiased",
},
{
id: "trustedrouter",
name: "TrustedRouter",
summary: "Use a TrustedRouter API key for models from many providers.",
keySummary: "Use a TrustedRouter API key for models from many providers.",
logins: ["endpoint"],
mark: "trustedrouter",
},
{
id: "openai-compatible",
name: "Any OpenAI-compatible endpoint",
Expand Down Expand Up @@ -104,6 +113,12 @@ export const ENDPOINT_PRESETS: Partial<
keyUrl: "https://platform.unbiased.ai/dashboard/keys",
keyLink: "Get an Unbiased AI API key",
},
trustedrouter: {
baseUrl: "https://api.trustedrouter.com/v1",
model: "anthropic/claude-sonnet-5.5",
keyUrl: "https://trustedrouter.com/console/api-keys",
keyLink: "Get a TrustedRouter API key",
},
};

/**
Expand All @@ -119,8 +134,12 @@ export function loginsHere(
);
}

/**
* The row for a provider, by its id. The server's answer can name a provider this app doesn't know
* (the list grows, api/README.md "Enums that grow"): that one has no row, and is shown by its id.
*/
export function providerById(
id: AiConnectionProvider | null | undefined,
id: AiConnectionProviderAnswer | null | undefined,
): AiProvider | undefined {
return AI_PROVIDERS.find((provider) => provider.id === id);
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/api/generated/model/aiConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/
import type { AiConnectionLogin } from "./aiConnectionLogin";
import type { AiConnectionProvider } from "./aiConnectionProvider";
import type { AiConnectionProviderAnswer } from "./aiConnectionProviderAnswer";
import type { AiConnectionSaved } from "./aiConnectionSaved";
import type { AiConnectionSource } from "./aiConnectionSource";

Expand All @@ -11,7 +11,7 @@ import type { AiConnectionSource } from "./aiConnectionSource";
*/
export interface AiConnection {
/** The provider. Null while none is chosen yet. */
provider: AiConnectionProvider | null;
provider: AiConnectionProviderAnswer | null;
/** How OpenBot signs in to it. Null while none is chosen yet. */
login: AiConnectionLogin | null;
/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/api/generated/model/aiConnectionInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { AiConnectionLogin } from "./aiConnectionLogin";
import type { AiConnectionProvider } from "./aiConnectionProvider";

/**
* The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased and openai-compatible take endpoint. Any other pair is refused.
* The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased, trustedrouter and openai-compatible take endpoint. Any other pair is refused.
*/
export interface AiConnectionInput {
provider: AiConnectionProvider;
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/api/generated/model/aiConnectionLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

/**
* How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).
* How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).
*/
export type AiConnectionLogin =
(typeof AiConnectionLogin)[keyof typeof AiConnectionLogin];
Expand Down
3 changes: 2 additions & 1 deletion app/src/lib/api/generated/model/aiConnectionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

/**
* The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.
* The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.
*/
export type AiConnectionProvider =
(typeof AiConnectionProvider)[keyof typeof AiConnectionProvider];
Expand All @@ -14,5 +14,6 @@ export const AiConnectionProvider = {
google: "google",
xai: "xai",
unbiased: "unbiased",
trustedrouter: "trustedrouter",
"openai-compatible": "openai-compatible",
} as const;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/

/**
* The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider.
*/
export type AiConnectionProviderAnswer = string;
4 changes: 2 additions & 2 deletions app/src/lib/api/generated/model/aiConnectionSaved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/
import type { AiConnectionLogin } from "./aiConnectionLogin";
import type { AiConnectionProvider } from "./aiConnectionProvider";
import type { AiConnectionProviderAnswer } from "./aiConnectionProviderAnswer";

/**
* A connection with a key still kept in the vault, which can be used again without pasting the key (useSavedKey). Never the key.
*/
export interface AiConnectionSaved {
provider: AiConnectionProvider;
provider: AiConnectionProviderAnswer;
login: AiConnectionLogin;
/**
* The host of its address, for an endpoint. Null for an API key.
Expand Down
1 change: 1 addition & 0 deletions app/src/lib/api/generated/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export * from "./aiConnectionFixedResponse";
export * from "./aiConnectionInput";
export * from "./aiConnectionLogin";
export * from "./aiConnectionProvider";
export * from "./aiConnectionProviderAnswer";
export * from "./aiConnectionRefusedResponse";
export * from "./aiConnectionSaved";
export * from "./aiConnectionSource";
Expand Down
Loading
Loading