@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.
- package/CHANGELOG.md +86 -1
- package/README.md +23 -10
- package/SECURITY.md +1 -1
- package/bin/haze.js +27 -7
- package/dist/buildInfo.json +3 -3
- package/dist/cli/chat/BusyBar.d.ts +7 -0
- package/dist/cli/chat/BusyBar.js +8 -0
- package/dist/cli/chat/DynamicFrame.d.ts +37 -0
- package/dist/cli/chat/DynamicFrame.js +43 -0
- package/dist/cli/chat/busyIndicator.d.ts +3 -1
- package/dist/cli/chat/busyIndicator.js +11 -9
- package/dist/cli/chat/chatMetrics.d.ts +1 -1
- package/dist/cli/chat/chatMetrics.js +3 -3
- package/dist/cli/chat/inputSuggestions.js +4 -0
- package/dist/cli/chat/liveMessages.d.ts +36 -0
- package/dist/cli/chat/liveMessages.js +64 -0
- package/dist/cli/chat/liveRegion.js +1 -1
- package/dist/cli/chat/messages.js +27 -16
- package/dist/cli/chat/sessionLifecycle.d.ts +5 -2
- package/dist/cli/chat/sessionLifecycle.js +36 -4
- package/dist/cli/chat/sessionRecorder.d.ts +2 -1
- package/dist/cli/chat/sessionRecorder.js +8 -0
- package/dist/cli/chat/shutdown.d.ts +27 -0
- package/dist/cli/chat/shutdown.js +79 -0
- package/dist/cli/chat/terminalControl.d.ts +45 -0
- package/dist/cli/chat/terminalControl.js +107 -0
- package/dist/cli/chat/tips.js +1 -0
- package/dist/cli/chat/userInput.d.ts +43 -0
- package/dist/cli/chat/userInput.js +63 -0
- package/dist/cli/chat/wizard/sessionThemeHandlers.d.ts +1 -1
- package/dist/cli/chat/wizard/sessionThemeHandlers.js +24 -1
- package/dist/cli/chat/wizard/types.d.ts +8 -1
- package/dist/cli/chat/wizardDispatch.js +1 -1
- package/dist/cli/commands/chat.js +277 -193
- package/dist/cli/commands/commandHelp.js +6 -0
- package/dist/cli/commands/commands.d.ts +8 -0
- package/dist/cli/commands/commands.js +13 -0
- package/dist/cli/commands/formatters.d.ts +1 -1
- package/dist/cli/commands/formatters.js +25 -3
- package/dist/cli/commands/logsCommand.js +21 -2
- package/dist/cli/commands/ndjsonSink.d.ts +12 -0
- package/dist/cli/commands/ndjsonSink.js +29 -0
- package/dist/cli/commands/reasoningCommand.d.ts +44 -0
- package/dist/cli/commands/reasoningCommand.js +79 -0
- package/dist/cli/commands/runCommand.d.ts +14 -0
- package/dist/cli/commands/runCommand.js +56 -22
- package/dist/cli/commands/settingsSummary.js +2 -0
- package/dist/cli/commands/streaming/agentAttempt.d.ts +3 -0
- package/dist/cli/commands/streaming/agentAttempt.js +2 -2
- package/dist/cli/commands/streaming/assistantSegments.d.ts +0 -7
- package/dist/cli/commands/streaming/assistantSegments.js +1 -1
- package/dist/cli/commands/streaming/attemptLifecycle.js +13 -9
- package/dist/cli/commands/streaming/attemptOutcome.d.ts +2 -0
- package/dist/cli/commands/streaming/attemptOutcome.js +24 -9
- package/dist/cli/commands/streaming/attemptSetup.d.ts +4 -0
- package/dist/cli/commands/streaming/attemptSetup.js +21 -7
- package/dist/cli/commands/streaming/goalCheckpoint.d.ts +14 -1
- package/dist/cli/commands/streaming/goalCheckpoint.js +4 -2
- package/dist/cli/commands/streaming/goalSupervisor.d.ts +9 -0
- package/dist/cli/commands/streaming/goalSupervisor.js +51 -10
- package/dist/cli/commands/streaming/prepareStep.d.ts +0 -3
- package/dist/cli/commands/streaming/prepareStep.js +14 -5
- package/dist/cli/commands/streaming/streamLoop.d.ts +5 -0
- package/dist/cli/commands/streaming/streamLoop.js +3 -0
- package/dist/cli/commands/streaming/toolPartHandlers.js +6 -0
- package/dist/cli/commands/streaming.d.ts +8 -3
- package/dist/cli/commands/streaming.js +46 -21
- package/dist/cli/commands/wizardFlow.d.ts +10 -0
- package/dist/cli/commands/wizardFlow.js +34 -5
- package/dist/cli/index.js +22 -2
- package/dist/config/contextFiles.d.ts +9 -0
- package/dist/config/contextFiles.js +21 -1
- package/dist/config/modelCatalog.d.ts +3 -0
- package/dist/config/modelCatalog.js +29 -0
- package/dist/config/modelDiscovery.js +68 -5
- package/dist/config/providerPresets.d.ts +1 -1
- package/dist/config/providerPresets.js +42 -3
- package/dist/config/settings.d.ts +14 -6
- package/dist/config/settings.js +16 -1
- package/dist/core/agent/budgets.d.ts +13 -17
- package/dist/core/agent/budgets.js +15 -19
- package/dist/core/agent/completionController.d.ts +14 -2
- package/dist/core/agent/completionController.js +48 -3
- package/dist/core/agent/events.d.ts +2 -1
- package/dist/core/agent/goalPolicy.d.ts +17 -0
- package/dist/core/agent/goalPolicy.js +53 -6
- package/dist/core/agent/projectPreflight.d.ts +2 -0
- package/dist/core/agent/projectPreflight.js +56 -0
- package/dist/core/agent/reasoningPolicy.d.ts +76 -10
- package/dist/core/agent/reasoningPolicy.js +72 -9
- package/dist/core/agent/toolCapabilities.d.ts +3 -3
- package/dist/core/agent/toolCapabilities.js +31 -7
- package/dist/core/agent/workState.d.ts +14 -4
- package/dist/core/agent/workState.js +229 -34
- package/dist/core/deadline.js +22 -24
- package/dist/core/providerContracts.d.ts +29 -0
- package/dist/core/providerContracts.js +1 -0
- package/dist/core/safety/secretPaths.js +10 -7
- package/dist/core/safety/shellClassifier.d.ts +2 -0
- package/dist/core/safety/shellClassifier.js +9 -1
- package/dist/core/session/sessionReport.d.ts +33 -0
- package/dist/core/session/sessionReport.js +121 -0
- package/dist/core/session/sessionSlimming.d.ts +2 -0
- package/dist/core/session/sessionSlimming.js +59 -4
- package/dist/core/session/sessionStore.d.ts +16 -8
- package/dist/core/session/sessionStore.js +71 -34
- package/dist/core/shellOutput/reducers/git.js +7 -2
- package/dist/core/shellOutput/reducers/validation.d.ts +1 -1
- package/dist/core/shellOutput/reducers/validation.js +14 -1
- package/dist/core/shellOutput/registry.js +3 -2
- package/dist/core/subagent/contracts.d.ts +3 -18
- package/dist/core/subagent/executionProfiles.js +4 -4
- package/dist/core/tasks/taskStorage.js +8 -1
- package/dist/core/validation/outputParser.d.ts +6 -1
- package/dist/core/validation/outputParser.js +30 -2
- package/dist/llm/client.d.ts +6 -3
- package/dist/llm/client.js +28 -11
- package/dist/llm/hazeTools.d.ts +9161 -7135
- package/dist/llm/hazeTools.js +6 -462
- package/dist/llm/lsp/client.d.ts +7 -1
- package/dist/llm/lsp/client.js +58 -9
- package/dist/llm/lsp/pool.d.ts +11 -0
- package/dist/llm/lsp/pool.js +61 -4
- package/dist/llm/lsp/protocol.d.ts +6 -23
- package/dist/llm/lsp/requests.d.ts +54 -60
- package/dist/llm/lsp/requests.js +152 -28
- package/dist/llm/lsp/symbols.d.ts +16 -0
- package/dist/llm/lsp/symbols.js +70 -0
- package/dist/llm/lsp/workspaceEdit.d.ts +43 -0
- package/dist/llm/lsp/workspaceEdit.js +117 -0
- package/dist/llm/lspTools.d.ts +7518 -2859
- package/dist/llm/lspTools.js +195 -110
- package/dist/llm/mcp.js +3 -0
- package/dist/llm/requestContext.d.ts +4 -3
- package/dist/llm/requestContext.js +9 -5
- package/dist/{core/subagent → llm}/subagentRunner.d.ts +13 -9
- package/dist/{core/subagent → llm}/subagentRunner.js +54 -49
- package/dist/llm/systemPrompt.d.ts +11 -1
- package/dist/llm/systemPrompt.js +4 -13
- package/dist/llm/tools/fetchTool.d.ts +34 -30
- package/dist/llm/tools/fileTools.d.ts +7768 -0
- package/dist/llm/tools/fileTools.js +510 -0
- package/dist/llm/tools/processTool.d.ts +34 -30
- package/dist/llm/tools/replaceInFiles.d.ts +105 -0
- package/dist/llm/tools/replaceInFiles.js +131 -0
- package/dist/llm/tools/shellTool.d.ts +34 -30
- package/dist/llm/tools/shellTool.js +8 -4
- package/dist/llm/tools/storedOutputTool.d.ts +4 -0
- package/dist/llm/tools/taskTool.d.ts +4 -0
- package/dist/llm/tools/toolContext.d.ts +3 -29
- package/dist/llm/tools/toolContext.js +56 -53
- package/dist/llm/tools/toolContextState.d.ts +40 -0
- package/dist/llm/tools/toolContextState.js +34 -0
- package/dist/llm/workerContext.d.ts +7 -0
- package/dist/llm/workerContext.js +18 -1
- package/dist/skills/SkillLoader.js +30 -4
- package/dist/skills/SkillRegistry.js +3 -3
- package/dist/skills/builder/SkillBuilder.js +3 -3
- package/dist/skills/confinement.d.ts +7 -0
- package/dist/skills/confinement.js +15 -0
- package/dist/ui/codeHighlight.js +4 -4
- package/dist/ui/components/MarkdownText.js +7 -8
- package/dist/ui/components/NativeIndicators.d.ts +15 -0
- package/dist/ui/components/NativeIndicators.js +32 -0
- package/dist/ui/components/StreamingMarkdownText.d.ts +9 -0
- package/dist/ui/components/StreamingMarkdownText.js +38 -0
- package/dist/ui/components/TextInput.d.ts +7 -2
- package/dist/ui/components/TextInput.js +103 -46
- package/dist/ui/components/WizardChoices.d.ts +18 -0
- package/dist/ui/components/WizardChoices.js +32 -0
- package/dist/ui/components/useInputSuggestions.js +18 -6
- package/dist/ui/inputBuffer.js +12 -6
- package/dist/ui/textGeometry.d.ts +14 -0
- package/dist/ui/textGeometry.js +31 -0
- package/dist/utils/buildInfo.js +29 -8
- package/dist/utils/fs.js +5 -1
- package/package.json +23 -22
- /package/dist/cli/{contextReport.d.ts → contextReportCli.d.ts} +0 -0
- /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
|
-
|
|
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 =
|
|
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.`
|
package/dist/llm/client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readSettings, type HazeProviderSettings } from '../config/settings.js';
|
|
2
|
-
import type { ProviderCapabilities, ProviderRequestOptions
|
|
3
|
-
import {
|
|
4
|
-
|
|
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;
|
package/dist/llm/client.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
}
|