Skip to content

Commit 929cf13

Browse files
committed
fix: add missing fields to oRPC provider and workspace schemas
The ProviderConfigInfoSchema was missing couponCodeSet (for Mux Gateway) and aws (for Bedrock). oRPC strips fields not in the schema, so these values were never reaching the frontend UI. Also fixes workspace.fork to use FrontendWorkspaceMetadataSchema instead of WorkspaceMetadataSchema, ensuring namedWorkspacePath is not stripped.
1 parent 936bfc4 commit 929cf13

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/common/orpc/schemas/api.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ import {
1414
TerminalSessionSchema,
1515
} from "./terminal";
1616
import { BashToolResultSchema, FileTreeNodeSchema } from "./tools";
17-
import {
18-
FrontendWorkspaceMetadataSchema,
19-
WorkspaceActivitySnapshotSchema,
20-
WorkspaceMetadataSchema,
21-
} from "./workspace";
17+
import { FrontendWorkspaceMetadataSchema, WorkspaceActivitySnapshotSchema } from "./workspace";
2218

2319
// --- API Router Schemas ---
2420

@@ -39,10 +35,21 @@ export const tokenizer = {
3935
};
4036

4137
// Providers
38+
export const AWSCredentialStatusSchema = z.object({
39+
region: z.string().optional(),
40+
bearerTokenSet: z.boolean(),
41+
accessKeyIdSet: z.boolean(),
42+
secretAccessKeySet: z.boolean(),
43+
});
44+
4245
export const ProviderConfigInfoSchema = z.object({
4346
apiKeySet: z.boolean(),
4447
baseUrl: z.string().optional(),
4548
models: z.array(z.string()).optional(),
49+
/** AWS-specific fields (only present for bedrock provider) */
50+
aws: AWSCredentialStatusSchema.optional(),
51+
/** Mux Gateway-specific fields */
52+
couponCodeSet: z.boolean().optional(),
4653
});
4754

4855
export const ProvidersConfigMapSchema = z.record(z.string(), ProviderConfigInfoSchema);
@@ -155,7 +162,7 @@ export const workspace = {
155162
output: z.discriminatedUnion("success", [
156163
z.object({
157164
success: z.literal(true),
158-
metadata: WorkspaceMetadataSchema,
165+
metadata: FrontendWorkspaceMetadataSchema,
159166
projectPath: z.string(),
160167
}),
161168
z.object({ success: z.literal(false), error: z.string() }),

0 commit comments

Comments
 (0)