Skip to content

Commit 36537fa

Browse files
committed
Resolve rebase conflicts on main
1 parent ddb5655 commit 36537fa

5 files changed

Lines changed: 41 additions & 14 deletions

File tree

apps/server/src/sme/Layers/SmeChatServiceLive.ts

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ const makeSmeChatService = (options: SmeChatServiceLiveOptions = {}) =>
192192
new SmeChatError("validateSetup", "Failed to validate Codex setup.", cause),
193193
});
194194

195+
case "copilot":
196+
return {
197+
ok: false,
198+
severity: "warning" as const,
199+
message: "GitHub Copilot is not available in SME Chat yet.",
200+
resolvedAuthMethod: "auto" as const,
201+
};
202+
195203
case "openclaw":
196204
return validateOpenClawSetup({
197205
authMethod: conversation.authMethod as Extract<
@@ -499,18 +507,25 @@ const makeSmeChatService = (options: SmeChatServiceLiveOptions = {}) =>
499507
abortSignal: controller.signal,
500508
}).pipe(Effect.ensuring(clearInterrupt(input.conversationId)));
501509
})
502-
: sendSmeViaProviderRuntime({
503-
providerService,
504-
provider: conv.provider,
505-
conversationId: input.conversationId,
506-
assistantMessageId,
507-
model: conv.model,
508-
compiledPrompt,
509-
...(input.providerOptions ? { providerOptions: input.providerOptions } : {}),
510-
...(onEvent ? { onEvent } : {}),
511-
setInterruptEffect: (interrupt) => setInterrupt(input.conversationId, interrupt),
512-
clearInterruptEffect: clearInterrupt(input.conversationId),
513-
});
510+
: conv.provider === "codex" || conv.provider === "openclaw"
511+
? sendSmeViaProviderRuntime({
512+
providerService,
513+
provider: conv.provider,
514+
conversationId: input.conversationId,
515+
assistantMessageId,
516+
model: conv.model,
517+
compiledPrompt,
518+
...(input.providerOptions ? { providerOptions: input.providerOptions } : {}),
519+
...(onEvent ? { onEvent } : {}),
520+
setInterruptEffect: (interrupt) => setInterrupt(input.conversationId, interrupt),
521+
clearInterruptEffect: clearInterrupt(input.conversationId),
522+
})
523+
: Effect.fail(
524+
new SmeChatError(
525+
"sendMessage:validate",
526+
"GitHub Copilot is not available in SME Chat yet.",
527+
),
528+
);
514529

515530
const responseText = yield* sendEffect.pipe(
516531
Effect.mapError((cause) =>

apps/server/src/sme/authValidation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export function getAllowedSmeAuthMethods(provider: ProviderKind): readonly SmeAu
6363
switch (provider) {
6464
case "claudeAgent":
6565
return ["auto", "apiKey", "authToken"];
66+
case "copilot":
67+
return ["auto"];
6668
case "codex":
6769
return ["auto", "chatgpt", "apiKey", "customProvider"];
6870
case "openclaw":
@@ -74,6 +76,8 @@ export function getDefaultSmeAuthMethod(provider: ProviderKind): SmeAuthMethod {
7476
switch (provider) {
7577
case "claudeAgent":
7678
return "apiKey";
79+
case "copilot":
80+
return "auto";
7781
case "codex":
7882
return "chatgpt";
7983
case "openclaw":

apps/web/src/components/sme/SmeConversationDialog.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export function SmeConversationDialog({
8383
{
8484
codex: settings.customCodexModels,
8585
claudeAgent: settings.customClaudeModels,
86+
copilot: settings.customCopilotModels,
8687
openclaw: settings.customOpenClawModels,
8788
},
8889
null,
@@ -97,6 +98,7 @@ export function SmeConversationDialog({
9798
conversation,
9899
open,
99100
settings.customClaudeModels,
101+
settings.customCopilotModels,
100102
settings.customCodexModels,
101103
settings.customOpenClawModels,
102104
]);
@@ -111,6 +113,7 @@ export function SmeConversationDialog({
111113
{
112114
codex: settings.customCodexModels,
113115
claudeAgent: settings.customClaudeModels,
116+
copilot: settings.customCopilotModels,
114117
openclaw: settings.customOpenClawModels,
115118
},
116119
nextProvider === "openclaw" ? "default" : null,

apps/web/src/components/sme/smeConversationConfig.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ import type { ProviderKind, SmeAuthMethod } from "@okcode/contracts";
33
export const SME_PROVIDER_LABELS: Record<ProviderKind, string> = {
44
codex: "Codex / ChatGPT",
55
claudeAgent: "Anthropic",
6+
copilot: "GitHub Copilot",
67
openclaw: "OpenClaw",
78
};
89

910
export function getDefaultSmeAuthMethod(provider: ProviderKind): SmeAuthMethod {
1011
switch (provider) {
1112
case "claudeAgent":
1213
return "apiKey";
14+
case "copilot":
15+
return "auto";
1316
case "codex":
1417
return "chatgpt";
1518
case "openclaw":
@@ -27,6 +30,8 @@ export function getSmeAuthMethodOptions(
2730
{ value: "authToken", label: "Auth Token" },
2831
{ value: "auto", label: "Auto" },
2932
];
33+
case "copilot":
34+
return [{ value: "auto", label: "Auto" }];
3035
case "codex":
3136
return [
3237
{ value: "chatgpt", label: "ChatGPT OAuth" },

apps/web/src/routes/_chat.settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,13 +2294,13 @@ function SettingsRouteView() {
22942294
: providerSettings.provider === "copilot"
22952295
? settings.copilotBinaryPath !== defaults.copilotBinaryPath ||
22962296
settings.copilotConfigDir !== defaults.copilotConfigDir
2297-
: settings.claudeBinaryPath !== defaults.claudeBinaryPath;
2297+
: settings.claudeBinaryPath !== defaults.claudeBinaryPath;
22982298
const binaryPathValue =
22992299
providerSettings.binaryPathKey === "claudeBinaryPath"
23002300
? claudeBinaryPath
23012301
: providerSettings.binaryPathKey === "copilotBinaryPath"
23022302
? copilotBinaryPath
2303-
: codexBinaryPath;
2303+
: codexBinaryPath;
23042304

23052305
return (
23062306
<Collapsible

0 commit comments

Comments
 (0)