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:
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;
|
||||
|
||||
Reference in new issue
Block a user