@resolveio/server-lib 22.0.14 → 22.0.15

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.
@@ -1591,7 +1591,10 @@ function executeAiAssistantCodexRun(payload, context) {
1591
1591
  workingDirectory: workspaceRoot,
1592
1592
  sandboxMode: 'read-only',
1593
1593
  skipGitRepoCheck: true,
1594
- modelReasoningEffort: resolveCodexThoughtLevel(),
1594
+ modelReasoningEffort: resolveCodexThoughtLevel({
1595
+ message: message,
1596
+ attachmentText: attachmentData.promptText
1597
+ }),
1595
1598
  networkAccessEnabled: false,
1596
1599
  webSearchMode: 'disabled',
1597
1600
  webSearchEnabled: false,
@@ -9210,7 +9213,62 @@ function resolveCodexFallbackModels(config, primaryModel) {
9210
9213
  }
9211
9214
  return models;
9212
9215
  }
9213
- function resolveCodexThoughtLevel() {
9216
+ var CODEX_THOUGHT_LEVEL_VALUES = ['minimal', 'low', 'medium', 'high', 'xhigh'];
9217
+ function normalizeCodexThoughtLevel(value) {
9218
+ var normalized = normalizeOptionalString(value).toLowerCase();
9219
+ if (!normalized) {
9220
+ return undefined;
9221
+ }
9222
+ if (CODEX_THOUGHT_LEVEL_VALUES.includes(normalized)) {
9223
+ return normalized;
9224
+ }
9225
+ return undefined;
9226
+ }
9227
+ function resolveConfiguredCodexAutoThoughtLevel(kind) {
9228
+ var config = resolveio_server_app_1.ResolveIOServer.getServerConfig() || {};
9229
+ var levelKey = kind === 'simple' ? 'SIMPLE' : 'COMPLEX';
9230
+ var fallbackLevel = kind === 'simple' ? 'medium' : 'high';
9231
+ var configured = normalizeCodexThoughtLevel(config["AI_ASSISTANT_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]
9232
+ || process.env["AI_ASSISTANT_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]
9233
+ || config["AI_TERMINAL_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]
9234
+ || process.env["AI_TERMINAL_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]
9235
+ || config["AI_DASHBOARD_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]
9236
+ || process.env["AI_DASHBOARD_CODEX_".concat(levelKey, "_THOUGHT_LEVEL")]);
9237
+ return configured || fallbackLevel;
9238
+ }
9239
+ function resolveAutoCodexThoughtLevel(params) {
9240
+ var combinedText = [
9241
+ normalizeOptionalString(params === null || params === void 0 ? void 0 : params.message),
9242
+ normalizeOptionalString(params === null || params === void 0 ? void 0 : params.attachmentText)
9243
+ ].filter(Boolean).join('\n').toLowerCase();
9244
+ var simpleLevel = resolveConfiguredCodexAutoThoughtLevel('simple');
9245
+ var complexLevel = resolveConfiguredCodexAutoThoughtLevel('complex');
9246
+ if (!combinedText) {
9247
+ return simpleLevel;
9248
+ }
9249
+ var bugOrIssuePatterns = [
9250
+ /\bbug\b/i,
9251
+ /\bissue\b/i,
9252
+ /\berror\b/i,
9253
+ /\bexception\b/i,
9254
+ /\bfail(?:ed|ing|ure)?\b/i,
9255
+ /\bbroken\b/i,
9256
+ /\bnot\s+working\b/i,
9257
+ /\bdoesn['’]t\s+work\b/i,
9258
+ /\bwhy\s+is\s+this\s+happening\b/i,
9259
+ /\broot\s+cause\b/i,
9260
+ /\bregression\b/i,
9261
+ /\bdebug\b/i,
9262
+ /\binvestigat(?:e|ion)\b/i,
9263
+ /\bfix\b/i,
9264
+ /\bcrash(?:ed|ing)?\b/i,
9265
+ /\btimeout\b/i,
9266
+ /\bwrong\b/i,
9267
+ /\bincorrect\b/i
9268
+ ];
9269
+ return bugOrIssuePatterns.some(function (pattern) { return pattern.test(combinedText); }) ? complexLevel : simpleLevel;
9270
+ }
9271
+ function resolveCodexThoughtLevel(params) {
9214
9272
  var config = resolveio_server_app_1.ResolveIOServer.getServerConfig() || {};
9215
9273
  var raw = normalizeOptionalString(config['AI_ASSISTANT_CODEX_THOUGHT_LEVEL']
9216
9274
  || process.env.AI_ASSISTANT_CODEX_THOUGHT_LEVEL
@@ -9219,10 +9277,14 @@ function resolveCodexThoughtLevel() {
9219
9277
  || config['AI_DASHBOARD_CODEX_THOUGHT_LEVEL']
9220
9278
  || process.env.AI_DASHBOARD_CODEX_THOUGHT_LEVEL);
9221
9279
  var normalized = (raw || '').trim().toLowerCase();
9222
- if (normalized === 'minimal' || normalized === 'low' || normalized === 'medium' || normalized === 'high' || normalized === 'xhigh') {
9223
- return normalized;
9280
+ var explicitLevel = normalizeCodexThoughtLevel(normalized);
9281
+ if (explicitLevel) {
9282
+ return explicitLevel;
9283
+ }
9284
+ if (normalized === 'auto' || !normalized) {
9285
+ return resolveAutoCodexThoughtLevel(params);
9224
9286
  }
9225
- return 'low';
9287
+ return 'medium';
9226
9288
  }
9227
9289
  function resolveCodexSettings(options) {
9228
9290
  var serverConfig = resolveio_server_app_1.ResolveIOServer.getServerConfig() || {};