Skip to content

Commit 67233ae

Browse files
committed
Address follow-up Copilot review feedback
1 parent 2aae280 commit 67233ae

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

apps/server/src/provider/Layers/ProviderHealth.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ class CopilotHealthProbeError extends Data.TaggedError("CopilotHealthProbeError"
4949
cause: unknown;
5050
}> {}
5151

52+
function formatHealthProbeCause(cause: unknown): string {
53+
return cause instanceof Error ? cause.message : String(cause);
54+
}
55+
5256
// ── Pure helpers ────────────────────────────────────────────────────
5357

5458
export interface CommandResult {
@@ -324,7 +328,7 @@ export const checkCopilotProviderStatus: Effect.Effect<ServerProviderStatus, nev
324328
checkedAt,
325329
message:
326330
error instanceof CopilotHealthProbeError
327-
? `Failed to start GitHub Copilot CLI: ${String(error.cause)}.`
331+
? `Failed to start GitHub Copilot CLI: ${formatHealthProbeCause(error.cause)}.`
328332
: "Failed to start GitHub Copilot CLI.",
329333
} satisfies ServerProviderStatus;
330334
}
@@ -367,7 +371,7 @@ export const checkCopilotProviderStatus: Effect.Effect<ServerProviderStatus, nev
367371
checkedAt,
368372
message:
369373
error instanceof CopilotHealthProbeError
370-
? `Could not verify GitHub Copilot authentication status: ${String(error.cause)}.`
374+
? `Could not verify GitHub Copilot authentication status: ${formatHealthProbeCause(error.cause)}.`
371375
: "Could not verify GitHub Copilot authentication status.",
372376
} satisfies ServerProviderStatus;
373377
}

apps/web/src/components/chat/composerProviderRegistry.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,21 @@ const composerProviderRegistry: Record<ProviderKind, ProviderRegistryEntry> = {
121121
renderTraitsPicker: () => null,
122122
},
123123
copilot: {
124-
getState: ({ modelOptions }) => ({
125-
provider: "copilot",
126-
promptEffort: modelOptions?.copilot?.reasoningEffort ?? null,
127-
modelOptionsForDispatch: modelOptions?.copilot?.reasoningEffort
128-
? { copilot: { reasoningEffort: modelOptions.copilot.reasoningEffort } }
129-
: undefined,
130-
}),
124+
getState: ({ modelOptions }) => {
125+
const defaultPromptEffort = getDefaultReasoningEffort("copilot");
126+
const promptEffort =
127+
resolveReasoningEffortForProvider("copilot", modelOptions?.copilot?.reasoningEffort) ??
128+
defaultPromptEffort;
129+
130+
return {
131+
provider: "copilot",
132+
promptEffort,
133+
modelOptionsForDispatch:
134+
promptEffort !== defaultPromptEffort
135+
? { copilot: { reasoningEffort: promptEffort } }
136+
: undefined,
137+
};
138+
},
131139
renderTraitsMenuContent: () => null,
132140
renderTraitsPicker: () => null,
133141
},

0 commit comments

Comments
 (0)