@agentconnect/host 0.2.1 → 0.2.2
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/dist/providers/codex.js +42 -2
- package/package.json +1 -1
package/dist/providers/codex.js
CHANGED
|
@@ -227,7 +227,7 @@ async function hasCodexAuth() {
|
|
|
227
227
|
return false;
|
|
228
228
|
}
|
|
229
229
|
function buildCodexExecArgs(options) {
|
|
230
|
-
const { prompt, cdTarget, resumeSessionId, model, reasoningEffort, mode } = options;
|
|
230
|
+
const { prompt, cdTarget, resumeSessionId, model, reasoningEffort, providerDetailLevel, mode } = options;
|
|
231
231
|
const args = ['exec', '--skip-git-repo-check'];
|
|
232
232
|
if (mode === 'legacy') {
|
|
233
233
|
args.push('--json', '-C', cdTarget);
|
|
@@ -236,6 +236,27 @@ function buildCodexExecArgs(options) {
|
|
|
236
236
|
args.push('--experimental-json', '--cd', cdTarget);
|
|
237
237
|
}
|
|
238
238
|
args.push('--yolo');
|
|
239
|
+
const summarySetting = process.env.AGENTCONNECT_CODEX_REASONING_SUMMARY;
|
|
240
|
+
const summary = summarySetting && summarySetting.trim()
|
|
241
|
+
? summarySetting.trim()
|
|
242
|
+
: 'detailed';
|
|
243
|
+
const summaryDisabled = ['0', 'false', 'off', 'none'].includes(summary.toLowerCase());
|
|
244
|
+
if (!summaryDisabled) {
|
|
245
|
+
args.push('--config', `model_reasoning_summary=${summary}`);
|
|
246
|
+
const supportsSetting = process.env.AGENTCONNECT_CODEX_SUPPORTS_REASONING_SUMMARIES;
|
|
247
|
+
const supportsValue = supportsSetting && supportsSetting.trim() ? supportsSetting.trim() : 'true';
|
|
248
|
+
args.push('--config', `model_supports_reasoning_summaries=${supportsValue}`);
|
|
249
|
+
}
|
|
250
|
+
const verbositySetting = process.env.AGENTCONNECT_CODEX_MODEL_VERBOSITY;
|
|
251
|
+
if (verbositySetting && verbositySetting.trim()) {
|
|
252
|
+
args.push('--config', `model_verbosity=${verbositySetting.trim()}`);
|
|
253
|
+
}
|
|
254
|
+
const rawSetting = process.env.AGENTCONNECT_CODEX_SHOW_RAW_REASONING;
|
|
255
|
+
const rawEnabled = providerDetailLevel === 'raw' ||
|
|
256
|
+
(rawSetting ? ['1', 'true', 'yes', 'on'].includes(rawSetting.trim().toLowerCase()) : false);
|
|
257
|
+
if (rawEnabled) {
|
|
258
|
+
args.push('--config', 'show_raw_agent_reasoning=true');
|
|
259
|
+
}
|
|
239
260
|
if (model) {
|
|
240
261
|
args.push('--model', String(model));
|
|
241
262
|
}
|
|
@@ -637,6 +658,7 @@ export function runCodexPrompt({ prompt, resumeSessionId, model, reasoningEffort
|
|
|
637
658
|
resumeSessionId,
|
|
638
659
|
model,
|
|
639
660
|
reasoningEffort,
|
|
661
|
+
providerDetailLevel,
|
|
640
662
|
mode,
|
|
641
663
|
});
|
|
642
664
|
const argsPreview = [...args];
|
|
@@ -646,7 +668,25 @@ export function runCodexPrompt({ prompt, resumeSessionId, model, reasoningEffort
|
|
|
646
668
|
debugLog('Codex', 'spawn', { command, args: argsPreview, cwd: runDir, mode });
|
|
647
669
|
const child = spawn(command, args, {
|
|
648
670
|
cwd: runDir,
|
|
649
|
-
env:
|
|
671
|
+
env: (() => {
|
|
672
|
+
const env = { ...process.env };
|
|
673
|
+
if (!env.RUST_LOG) {
|
|
674
|
+
const override = process.env.AGENTCONNECT_CODEX_RUST_LOG;
|
|
675
|
+
if (override && override.trim()) {
|
|
676
|
+
env.RUST_LOG = override.trim();
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
const debugFlag = process.env.AGENTCONNECT_CODEX_DEBUG_LOGS;
|
|
680
|
+
const enabled = debugFlag
|
|
681
|
+
? ['1', 'true', 'yes', 'on'].includes(debugFlag.trim().toLowerCase())
|
|
682
|
+
: false;
|
|
683
|
+
if (enabled) {
|
|
684
|
+
env.RUST_LOG = 'codex_exec=debug,codex_core=debug';
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
return env;
|
|
689
|
+
})(),
|
|
650
690
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
651
691
|
});
|
|
652
692
|
if (signal) {
|