fix(server): allow undefined Grok effort on session/set_model

exactOptionalPropertyTypes rejected passing string | undefined into the optional effort fields, which also leaked unknown into the adapter Effect error channel.

Made with Grok 4.6.
This commit is contained in:
Theo Browne committed 2026-08-12 14:49:39 -07:00
1 parent fbd04178e1
commit 5f56ea5fb9
2 files changed
+3 -3

No files matched your search

@@ -67,7 +67,7 @@ describe("parseGrokAcpModelMeta", () => {
expect(meta.reasoningEffort).toBe("high");
expect(meta.totalContextTokens).toBe(500000);
expect(meta.reasoningEfforts.map((choice) => choice.id)).toEqual(["xhigh", "high", "medium"]);
expect(grokReasoningEffortCapabilities(meta.reasoningEfforts).optionDescriptors[0]?.id).toBe(
expect(grokReasoningEffortCapabilities(meta.reasoningEfforts).optionDescriptors?.[0]?.id).toBe(
GROK_REASONING_EFFORT_OPTION_ID,
);
});
@@ -341,8 +341,8 @@ export function applyGrokAcpModelSelection<E>(input: {
readonly runtime: Pick<AcpSessionRuntime.AcpSessionRuntime["Service"], "setSessionModel">;
readonly currentModelId: string | undefined;
readonly requestedModelId: string | undefined;
readonly currentReasoningEffort?: string;
readonly requestedReasoningEffort?: string;
readonly currentReasoningEffort?: string | undefined;
readonly requestedReasoningEffort?: string | undefined;
readonly mapError: (cause: EffectAcpErrors.AcpError) => E;
}): Effect.Effect<GrokAcpSelection, E> {
const nextModelId = input.requestedModelId ?? input.currentModelId;