@denizokcu/haze 1.2.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/CHANGELOG.md +86 -1
  2. package/README.md +23 -10
  3. package/SECURITY.md +1 -1
  4. package/bin/haze.js +27 -7
  5. package/dist/buildInfo.json +3 -3
  6. package/dist/cli/chat/BusyBar.d.ts +7 -0
  7. package/dist/cli/chat/BusyBar.js +8 -0
  8. package/dist/cli/chat/DynamicFrame.d.ts +37 -0
  9. package/dist/cli/chat/DynamicFrame.js +43 -0
  10. package/dist/cli/chat/busyIndicator.d.ts +3 -1
  11. package/dist/cli/chat/busyIndicator.js +11 -9
  12. package/dist/cli/chat/chatMetrics.d.ts +1 -1
  13. package/dist/cli/chat/chatMetrics.js +3 -3
  14. package/dist/cli/chat/inputSuggestions.js +4 -0
  15. package/dist/cli/chat/liveMessages.d.ts +36 -0
  16. package/dist/cli/chat/liveMessages.js +64 -0
  17. package/dist/cli/chat/liveRegion.js +1 -1
  18. package/dist/cli/chat/messages.js +27 -16
  19. package/dist/cli/chat/sessionLifecycle.d.ts +5 -2
  20. package/dist/cli/chat/sessionLifecycle.js +36 -4
  21. package/dist/cli/chat/sessionRecorder.d.ts +2 -1
  22. package/dist/cli/chat/sessionRecorder.js +8 -0
  23. package/dist/cli/chat/shutdown.d.ts +27 -0
  24. package/dist/cli/chat/shutdown.js +79 -0
  25. package/dist/cli/chat/terminalControl.d.ts +45 -0
  26. package/dist/cli/chat/terminalControl.js +107 -0
  27. package/dist/cli/chat/tips.js +1 -0
  28. package/dist/cli/chat/userInput.d.ts +43 -0
  29. package/dist/cli/chat/userInput.js +63 -0
  30. package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +1 -1
  31. package/dist/cli/chat/wizard/sessionThemeHandlers.js +24 -1
  32. package/dist/cli/chat/wizard/types.d.ts +8 -1
  33. package/dist/cli/chat/wizardDispatch.js +1 -1
  34. package/dist/cli/commands/chat.js +277 -193
  35. package/dist/cli/commands/commandHelp.js +6 -0
  36. package/dist/cli/commands/commands.d.ts +8 -0
  37. package/dist/cli/commands/commands.js +13 -0
  38. package/dist/cli/commands/formatters.d.ts +1 -1
  39. package/dist/cli/commands/formatters.js +25 -3
  40. package/dist/cli/commands/logsCommand.js +21 -2
  41. package/dist/cli/commands/ndjsonSink.d.ts +12 -0
  42. package/dist/cli/commands/ndjsonSink.js +29 -0
  43. package/dist/cli/commands/reasoningCommand.d.ts +44 -0
  44. package/dist/cli/commands/reasoningCommand.js +79 -0
  45. package/dist/cli/commands/runCommand.d.ts +14 -0
  46. package/dist/cli/commands/runCommand.js +56 -22
  47. package/dist/cli/commands/settingsSummary.js +2 -0
  48. package/dist/cli/commands/streaming/agentAttempt.d.ts +3 -0
  49. package/dist/cli/commands/streaming/agentAttempt.js +2 -2
  50. package/dist/cli/commands/streaming/assistantSegments.d.ts +0 -7
  51. package/dist/cli/commands/streaming/assistantSegments.js +1 -1
  52. package/dist/cli/commands/streaming/attemptLifecycle.js +13 -9
  53. package/dist/cli/commands/streaming/attemptOutcome.d.ts +2 -0
  54. package/dist/cli/commands/streaming/attemptOutcome.js +24 -9
  55. package/dist/cli/commands/streaming/attemptSetup.d.ts +4 -0
  56. package/dist/cli/commands/streaming/attemptSetup.js +21 -7
  57. package/dist/cli/commands/streaming/goalCheckpoint.d.ts +14 -1
  58. package/dist/cli/commands/streaming/goalCheckpoint.js +4 -2
  59. package/dist/cli/commands/streaming/goalSupervisor.d.ts +9 -0
  60. package/dist/cli/commands/streaming/goalSupervisor.js +51 -10
  61. package/dist/cli/commands/streaming/prepareStep.d.ts +0 -3
  62. package/dist/cli/commands/streaming/prepareStep.js +14 -5
  63. package/dist/cli/commands/streaming/streamLoop.d.ts +5 -0
  64. package/dist/cli/commands/streaming/streamLoop.js +3 -0
  65. package/dist/cli/commands/streaming/toolPartHandlers.js +6 -0
  66. package/dist/cli/commands/streaming.d.ts +8 -3
  67. package/dist/cli/commands/streaming.js +46 -21
  68. package/dist/cli/commands/wizardFlow.d.ts +10 -0
  69. package/dist/cli/commands/wizardFlow.js +34 -5
  70. package/dist/cli/index.js +22 -2
  71. package/dist/config/contextFiles.d.ts +9 -0
  72. package/dist/config/contextFiles.js +21 -1
  73. package/dist/config/modelCatalog.d.ts +3 -0
  74. package/dist/config/modelCatalog.js +29 -0
  75. package/dist/config/modelDiscovery.js +68 -5
  76. package/dist/config/providerPresets.d.ts +1 -1
  77. package/dist/config/providerPresets.js +42 -3
  78. package/dist/config/settings.d.ts +14 -6
  79. package/dist/config/settings.js +16 -1
  80. package/dist/core/agent/budgets.d.ts +13 -17
  81. package/dist/core/agent/budgets.js +15 -19
  82. package/dist/core/agent/completionController.d.ts +14 -2
  83. package/dist/core/agent/completionController.js +48 -3
  84. package/dist/core/agent/events.d.ts +2 -1
  85. package/dist/core/agent/goalPolicy.d.ts +17 -0
  86. package/dist/core/agent/goalPolicy.js +53 -6
  87. package/dist/core/agent/projectPreflight.d.ts +2 -0
  88. package/dist/core/agent/projectPreflight.js +56 -0
  89. package/dist/core/agent/reasoningPolicy.d.ts +76 -10
  90. package/dist/core/agent/reasoningPolicy.js +72 -9
  91. package/dist/core/agent/toolCapabilities.d.ts +3 -3
  92. package/dist/core/agent/toolCapabilities.js +31 -7
  93. package/dist/core/agent/workState.d.ts +14 -4
  94. package/dist/core/agent/workState.js +229 -34
  95. package/dist/core/deadline.js +22 -24
  96. package/dist/core/providerContracts.d.ts +29 -0
  97. package/dist/core/providerContracts.js +1 -0
  98. package/dist/core/safety/secretPaths.js +10 -7
  99. package/dist/core/safety/shellClassifier.d.ts +2 -0
  100. package/dist/core/safety/shellClassifier.js +9 -1
  101. package/dist/core/session/sessionReport.d.ts +33 -0
  102. package/dist/core/session/sessionReport.js +121 -0
  103. package/dist/core/session/sessionSlimming.d.ts +2 -0
  104. package/dist/core/session/sessionSlimming.js +59 -4
  105. package/dist/core/session/sessionStore.d.ts +16 -8
  106. package/dist/core/session/sessionStore.js +71 -34
  107. package/dist/core/shellOutput/reducers/git.js +7 -2
  108. package/dist/core/shellOutput/reducers/validation.d.ts +1 -1
  109. package/dist/core/shellOutput/reducers/validation.js +14 -1
  110. package/dist/core/shellOutput/registry.js +3 -2
  111. package/dist/core/subagent/contracts.d.ts +3 -18
  112. package/dist/core/subagent/executionProfiles.js +4 -4
  113. package/dist/core/tasks/taskStorage.js +8 -1
  114. package/dist/core/validation/outputParser.d.ts +6 -1
  115. package/dist/core/validation/outputParser.js +30 -2
  116. package/dist/llm/client.d.ts +6 -3
  117. package/dist/llm/client.js +28 -11
  118. package/dist/llm/hazeTools.d.ts +9161 -7135
  119. package/dist/llm/hazeTools.js +6 -462
  120. package/dist/llm/lsp/client.d.ts +7 -1
  121. package/dist/llm/lsp/client.js +58 -9
  122. package/dist/llm/lsp/pool.d.ts +11 -0
  123. package/dist/llm/lsp/pool.js +61 -4
  124. package/dist/llm/lsp/protocol.d.ts +6 -23
  125. package/dist/llm/lsp/requests.d.ts +54 -60
  126. package/dist/llm/lsp/requests.js +152 -28
  127. package/dist/llm/lsp/symbols.d.ts +16 -0
  128. package/dist/llm/lsp/symbols.js +70 -0
  129. package/dist/llm/lsp/workspaceEdit.d.ts +43 -0
  130. package/dist/llm/lsp/workspaceEdit.js +117 -0
  131. package/dist/llm/lspTools.d.ts +7518 -2859
  132. package/dist/llm/lspTools.js +195 -110
  133. package/dist/llm/mcp.js +3 -0
  134. package/dist/llm/requestContext.d.ts +4 -3
  135. package/dist/llm/requestContext.js +9 -5
  136. package/dist/{core/subagent → llm}/subagentRunner.d.ts +13 -9
  137. package/dist/{core/subagent → llm}/subagentRunner.js +54 -49
  138. package/dist/llm/systemPrompt.d.ts +11 -1
  139. package/dist/llm/systemPrompt.js +4 -13
  140. package/dist/llm/tools/fetchTool.d.ts +34 -30
  141. package/dist/llm/tools/fileTools.d.ts +7768 -0
  142. package/dist/llm/tools/fileTools.js +510 -0
  143. package/dist/llm/tools/processTool.d.ts +34 -30
  144. package/dist/llm/tools/replaceInFiles.d.ts +105 -0
  145. package/dist/llm/tools/replaceInFiles.js +131 -0
  146. package/dist/llm/tools/shellTool.d.ts +34 -30
  147. package/dist/llm/tools/shellTool.js +8 -4
  148. package/dist/llm/tools/storedOutputTool.d.ts +4 -0
  149. package/dist/llm/tools/taskTool.d.ts +4 -0
  150. package/dist/llm/tools/toolContext.d.ts +3 -29
  151. package/dist/llm/tools/toolContext.js +56 -53
  152. package/dist/llm/tools/toolContextState.d.ts +40 -0
  153. package/dist/llm/tools/toolContextState.js +34 -0
  154. package/dist/llm/workerContext.d.ts +7 -0
  155. package/dist/llm/workerContext.js +18 -1
  156. package/dist/skills/SkillLoader.js +30 -4
  157. package/dist/skills/SkillRegistry.js +3 -3
  158. package/dist/skills/builder/SkillBuilder.js +3 -3
  159. package/dist/skills/confinement.d.ts +7 -0
  160. package/dist/skills/confinement.js +15 -0
  161. package/dist/ui/codeHighlight.js +4 -4
  162. package/dist/ui/components/MarkdownText.js +7 -8
  163. package/dist/ui/components/NativeIndicators.d.ts +15 -0
  164. package/dist/ui/components/NativeIndicators.js +32 -0
  165. package/dist/ui/components/StreamingMarkdownText.d.ts +9 -0
  166. package/dist/ui/components/StreamingMarkdownText.js +38 -0
  167. package/dist/ui/components/TextInput.d.ts +7 -2
  168. package/dist/ui/components/TextInput.js +103 -46
  169. package/dist/ui/components/WizardChoices.d.ts +18 -0
  170. package/dist/ui/components/WizardChoices.js +32 -0
  171. package/dist/ui/components/useInputSuggestions.js +18 -6
  172. package/dist/ui/inputBuffer.js +12 -6
  173. package/dist/ui/textGeometry.d.ts +14 -0
  174. package/dist/ui/textGeometry.js +31 -0
  175. package/dist/utils/buildInfo.js +29 -8
  176. package/dist/utils/fs.js +5 -1
  177. package/package.json +23 -22
  178. /package/dist/cli/{contextReport.d.ts → contextReportCli.d.ts} +0 -0
  179. /package/dist/cli/{contextReport.js → contextReportCli.js} +0 -0
@@ -1,5 +1,10 @@
1
1
  import { type ShellClassification } from '../safety/shellClassifier.js';
2
- import type { ValidationSummary } from '../../llm/toolResultTypes.js';
2
+ import type { ValidationKind, ValidationSummary } from '../../llm/toolResultTypes.js';
3
+ /**
4
+ * Shape-only kind inference on the unquoted command, exported for per-stage
5
+ * classification of `&&` compounds in work-state validation recording.
6
+ */
7
+ export declare function inferValidationKind(command: string, classification?: ShellClassification): ValidationKind;
3
8
  export declare function parseValidationOutput(input: {
4
9
  command: string;
5
10
  code: number | null;
@@ -3,7 +3,11 @@ import { capOutputForProcessing } from '../toolOutput/reduction.js';
3
3
  function uniq(values) {
4
4
  return [...new Set(values.filter(Boolean))];
5
5
  }
6
- function inferKind(command, classification) {
6
+ /**
7
+ * Shape-only kind inference on the unquoted command, exported for per-stage
8
+ * classification of `&&` compounds in work-state validation recording.
9
+ */
10
+ export function inferValidationKind(command, classification) {
7
11
  // Shape-only inference on the unquoted command: kind authority must come
8
12
  // from running a recognized tool, never from words the model authored
9
13
  // inside a quoted payload (found by the honest-impossibility eval — a
@@ -25,7 +29,7 @@ export function parseValidationOutput(input) {
25
29
  const diagnostics = [];
26
30
  const failedTests = [];
27
31
  const failedFiles = [];
28
- const kind = inferKind(input.command, input.classification);
32
+ const kind = inferValidationKind(input.command, input.classification);
29
33
  for (let index = 0; index < lines.length; index++) {
30
34
  const line = lines[index];
31
35
  const ts = line.match(/^(.+?\.(?:ts|tsx|js|jsx|mts|cts))\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(.+)$/);
@@ -90,6 +94,30 @@ export function parseValidationOutput(input) {
90
94
  summaryText = `${kind} failed: ${diagCount} diagnostic${diagCount === 1 ? '' : 's'}${uniqueFiles.length ? ` in ${uniqueFiles.join(', ')}` : ''}`;
91
95
  else
92
96
  summaryText = `${kind} ${status}`;
97
+ // First distinct failure lines are the diagnostic, not noise (RT-04): the
98
+ // live review session saw "release:verify" summarized as "10 failed tests"
99
+ // while the handle held 32 distinct mismatches, forcing a readToolOutput
100
+ // round-trip (a full model step) before the real failures were visible.
101
+ // Preserve up to three distinct first failure lines inline, bounded.
102
+ if (status !== 'passed' && status !== 'timed_out') {
103
+ const failureLines = [];
104
+ for (const line of lines) {
105
+ const trimmed = line.trim();
106
+ if (!trimmed)
107
+ continue;
108
+ const isFailureLine = /^(?:✗|FAIL|FAILED|AssertionError|Error:|error|✖|×|●)/i.test(trimmed)
109
+ || /^\S+\.(?:ts|tsx|js|jsx|mts|cts):\d+/i.test(trimmed)
110
+ || /\b(failed|mismatch|does not|missing|unexpected)\b/i.test(trimmed);
111
+ if (!isFailureLine)
112
+ continue;
113
+ if (!failureLines.some(existing => existing === trimmed))
114
+ failureLines.push(trimmed.length > 200 ? `${trimmed.slice(0, 199)}…` : trimmed);
115
+ if (failureLines.length >= 3)
116
+ break;
117
+ }
118
+ if (failureLines.length > 0)
119
+ summaryText = `${summaryText} — ${failureLines.join(' | ')}`;
120
+ }
93
121
  const suggestedNextStep = status === 'failed'
94
122
  ? uniqueFiles.length > 0
95
123
  ? `Inspect ${uniqueFiles.slice(0, 3).join(', ')} and fix the first relevant failure.`
@@ -1,7 +1,8 @@
1
1
  import { readSettings, type HazeProviderSettings } from '../config/settings.js';
2
- import type { ProviderCapabilities, ProviderRequestOptions, WorkerRuntime } from '../core/subagent/contracts.js';
3
- import { type ResolvedReasoningPolicy } from '../core/agent/reasoningPolicy.js';
4
- export type { ProviderCapabilities, ProviderRequestOptions } from '../core/subagent/contracts.js';
2
+ import type { ProviderCapabilities, ProviderRequestOptions } from '../core/providerContracts.js';
3
+ import type { WorkerRuntime } from '../core/subagent/contracts.js';
4
+ import { type ResolvedReasoningPolicy, type StoredReasoningSetting } from '../core/agent/reasoningPolicy.js';
5
+ export type { ProviderCapabilities, ProviderRequestOptions } from '../core/providerContracts.js';
5
6
  export interface ModelRuntimeSelection {
6
7
  model: WorkerRuntime['model'];
7
8
  config: ModelRuntimeConfig;
@@ -32,6 +33,8 @@ export declare function isLocalProviderUrl(url: string): boolean;
32
33
  export declare function modelWithConfig(session?: {
33
34
  cwd?: string;
34
35
  modelSelector?: string;
36
+ reasoningOverride?: StoredReasoningSetting;
37
+ reasoningByModel?: Record<string, StoredReasoningSetting>;
35
38
  }, settings?: Awaited<ReturnType<typeof readSettings>>): Promise<ModelRuntimeSelection | undefined>;
36
39
  export declare function resolveWorkerRuntime(input: {
37
40
  active: ModelRuntimeSelection;
@@ -4,7 +4,7 @@ import { readSettings } from '../config/settings.js';
4
4
  import { catalogLimitsFor } from '../config/modelCatalog.js';
5
5
  import { activeModel, modelSelector, resolveModelSelector } from '../config/providers.js';
6
6
  import { assertCredentialedEndpointSecure } from '../config/endpointSecurity.js';
7
- import { resolveReasoningPolicy } from '../core/agent/reasoningPolicy.js';
7
+ import { effectiveRequestedReasoning, isStoredReasoning, reasoningCallSetting, resolveAttemptReasoning, resolveReasoningPolicy } from '../core/agent/reasoningPolicy.js';
8
8
  import { FALLBACK_CONTEXT_WINDOW_TOKENS, FALLBACK_LOCAL_CONTEXT_TOKENS } from '../core/agent/contextBudget.js';
9
9
  import { createChatGptCodexFetch } from './openaiCodex.js';
10
10
  const HAZE_SITE_URL = 'https://denizokcu.github.io/haze/';
@@ -34,7 +34,9 @@ function capabilities(providerName, baseURL, providerKind) {
34
34
  supportsStickySessionId: openRouter,
35
35
  supportsServerCompaction: false,
36
36
  supportsTextVerbosity: directOpenAI,
37
- supportsReasoningEffort: directOpenAI,
37
+ // Pass-through marker: the SDK maps the top-level `reasoning` parameter
38
+ // per provider and endpoints without native support ignore the field.
39
+ supportsReasoningEffort: true,
38
40
  };
39
41
  }
40
42
  /** True for loopback/local inference servers, whose effective window is server-configured (often far below the model's). */
@@ -47,7 +49,7 @@ export function isLocalProviderUrl(url) {
47
49
  return false;
48
50
  }
49
51
  }
50
- function runtimeForSelection(settings, selection, cwd) {
52
+ function runtimeForSelection(settings, selection, cwd, reasoningOverride, sessionReasoningByModel) {
51
53
  const baseURL = selection.provider.url;
52
54
  const providerKind = selection.provider.kind;
53
55
  const configuredKey = providerKind === 'chatgpt-codex' ? undefined : selection.provider.key ?? settings.apiKey;
@@ -57,7 +59,20 @@ function runtimeForSelection(settings, selection, cwd) {
57
59
  const cacheSeed = cwd ?? process.cwd();
58
60
  const cacheKey = crypto.createHash('sha256').update(`${cacheSeed}\0${name}`).digest('hex').slice(0, 32);
59
61
  const caps = capabilities(selection.provider.name, baseURL, providerKind);
60
- const requestedReasoning = isReasoningLevel(settings.reasoning) ? settings.reasoning : undefined;
62
+ const selector = modelSelector(selection.provider, name);
63
+ // The full precedence chain lives in one pure resolver
64
+ // (`resolveAttemptReasoning`): run-scoped override → session per-model map →
65
+ // global settings → built-in default (medium). The stored or session
66
+ // `provider-default` sentinel sends no parameter at all. The capability gate
67
+ // in resolveReasoningPolicy is unchanged — nothing forces the parameter onto
68
+ // an unsupported protocol.
69
+ const storedReasoning = resolveAttemptReasoning({
70
+ modelSelector: selector,
71
+ runOverride: reasoningOverride,
72
+ sessionReasoningByModel,
73
+ globalSetting: isStoredReasoning(settings.reasoning) ? settings.reasoning : undefined,
74
+ });
75
+ const requestedReasoning = effectiveRequestedReasoning(storedReasoning);
61
76
  const reasoningPolicy = resolveReasoningPolicy({ requested: requestedReasoning, capabilities: caps });
62
77
  const openai = providerKind === 'chatgpt-codex'
63
78
  ? createOpenAI({ apiKey: OAUTH_SDK_SENTINEL, baseURL, fetch: createChatGptCodexFetch(selection.provider.name) })
@@ -83,7 +98,7 @@ function runtimeForSelection(settings, selection, cwd) {
83
98
  const maxOutputTokens = limits.maxOutputTokens ?? catalog?.maxOutputTokens;
84
99
  return {
85
100
  model: providerKind === 'chatgpt-codex' ? openai.responses(name) : openai.chat(name),
86
- selector: modelSelector(selection.provider, name),
101
+ selector,
87
102
  config: {
88
103
  providerName: selection.provider.name,
89
104
  providerKind,
@@ -110,9 +125,6 @@ function modelLimitsFor(provider, modelName) {
110
125
  out.maxOutputTokens = limits.maxOutputTokens;
111
126
  return out;
112
127
  }
113
- function isReasoningLevel(value) {
114
- return value === 'low' || value === 'medium' || value === 'high';
115
- }
116
128
  export async function modelWithConfig(session, settings) {
117
129
  // Callers may pass pre-read settings so a turn performs a single settings
118
130
  // read (CR-024); otherwise read fresh.
@@ -126,7 +138,7 @@ export async function modelWithConfig(session, settings) {
126
138
  }
127
139
  else
128
140
  selection = activeModel(resolvedSettings);
129
- return selection ? runtimeForSelection(resolvedSettings, selection, session?.cwd) : undefined;
141
+ return selection ? runtimeForSelection(resolvedSettings, selection, session?.cwd, session?.reasoningOverride, session?.reasoningByModel) : undefined;
130
142
  }
131
143
  export async function resolveWorkerRuntime(input) {
132
144
  const requested = input.selector?.trim();
@@ -140,11 +152,17 @@ export async function resolveWorkerRuntime(input) {
140
152
  return { status: 'found', runtime: { model: selected.model, selector: selected.selector, providerName: selected.config.providerName, capabilities: selected.config.capabilities, requestOptions: providerRequestSettings(selected.config) } };
141
153
  }
142
154
  export function providerRequestSettings(config) {
155
+ // Top-level AI SDK `reasoning` setting; the key is omitted entirely when the
156
+ // policy is disabled so the parameter is never sent (and never merged with a
157
+ // providerOptions reasoning key — the SDK ignores the top-level value then).
158
+ const setting = reasoningCallSetting(config.reasoningPolicy);
159
+ const reasoning = setting !== undefined && setting !== 'provider-default' ? setting : undefined;
143
160
  if (config.providerKind === 'chatgpt-codex') {
144
161
  return {
145
162
  omitMaxOutputTokens: true,
146
163
  providerOptions: { openai: { store: false, include: ['reasoning.encrypted_content'] } },
147
164
  headers: { 'session-id': config.cacheKey },
165
+ ...(reasoning ? { reasoning } : {}),
148
166
  };
149
167
  }
150
168
  const caps = config.capabilities;
@@ -153,11 +171,10 @@ export function providerRequestSettings(config) {
153
171
  openaiOptions.promptCacheKey = config.cacheKey;
154
172
  if (caps.supportsTextVerbosity)
155
173
  openaiOptions.textVerbosity = 'low';
156
- if (config.reasoningPolicy.effective !== 'disabled')
157
- openaiOptions.reasoningEffort = config.reasoningPolicy.effective;
158
174
  const providerOptions = Object.keys(openaiOptions).length > 0 ? { openai: openaiOptions } : undefined;
159
175
  return {
160
176
  ...(providerOptions ? { providerOptions } : {}),
161
177
  ...(caps.supportsStickySessionId ? { headers: { 'x-session-id': config.cacheKey } } : {}),
178
+ ...(reasoning ? { reasoning } : {}),
162
179
  };
163
180
  }