codex-multi-auth 1.2.0 → 1.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/README.md +49 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +929 -1712
- package/dist/index.js.map +1 -1
- package/dist/lib/accounts.d.ts +10 -0
- package/dist/lib/accounts.d.ts.map +1 -1
- package/dist/lib/accounts.js +312 -69
- package/dist/lib/accounts.js.map +1 -1
- package/dist/lib/auth/index.d.ts +2 -0
- package/dist/lib/auth/index.d.ts.map +1 -0
- package/dist/lib/auth/index.js +2 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/circuit-breaker.d.ts +4 -0
- package/dist/lib/circuit-breaker.d.ts.map +1 -1
- package/dist/lib/circuit-breaker.js +33 -1
- package/dist/lib/circuit-breaker.js.map +1 -1
- package/dist/lib/codex-cli/index.d.ts +5 -0
- package/dist/lib/codex-cli/index.d.ts.map +1 -0
- package/dist/lib/codex-cli/index.js +5 -0
- package/dist/lib/codex-cli/index.js.map +1 -0
- package/dist/lib/codex-manager/auth-commands.d.ts +72 -0
- package/dist/lib/codex-manager/auth-commands.d.ts.map +1 -0
- package/dist/lib/codex-manager/auth-commands.js +643 -0
- package/dist/lib/codex-manager/auth-commands.js.map +1 -0
- package/dist/lib/codex-manager/backend-category-entry.d.ts +103 -0
- package/dist/lib/codex-manager/backend-category-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-category-entry.js +23 -0
- package/dist/lib/codex-manager/backend-category-entry.js.map +1 -0
- package/dist/lib/codex-manager/backend-category-helpers.d.ts +10 -0
- package/dist/lib/codex-manager/backend-category-helpers.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-category-helpers.js +29 -0
- package/dist/lib/codex-manager/backend-category-helpers.js.map +1 -0
- package/dist/lib/codex-manager/backend-category-prompt.d.ts +55 -0
- package/dist/lib/codex-manager/backend-category-prompt.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-category-prompt.js +178 -0
- package/dist/lib/codex-manager/backend-category-prompt.js.map +1 -0
- package/dist/lib/codex-manager/backend-settings-controller.d.ts +11 -0
- package/dist/lib/codex-manager/backend-settings-controller.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-settings-controller.js +14 -0
- package/dist/lib/codex-manager/backend-settings-controller.js.map +1 -0
- package/dist/lib/codex-manager/backend-settings-entry.d.ts +20 -0
- package/dist/lib/codex-manager/backend-settings-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-settings-entry.js +12 -0
- package/dist/lib/codex-manager/backend-settings-entry.js.map +1 -0
- package/dist/lib/codex-manager/backend-settings-helpers.d.ts +16 -0
- package/dist/lib/codex-manager/backend-settings-helpers.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-settings-helpers.js +102 -0
- package/dist/lib/codex-manager/backend-settings-helpers.js.map +1 -0
- package/dist/lib/codex-manager/backend-settings-prompt.d.ts +49 -0
- package/dist/lib/codex-manager/backend-settings-prompt.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-settings-prompt.js +121 -0
- package/dist/lib/codex-manager/backend-settings-prompt.js.map +1 -0
- package/dist/lib/codex-manager/backend-settings-schema.d.ts +55 -0
- package/dist/lib/codex-manager/backend-settings-schema.d.ts.map +1 -0
- package/dist/lib/codex-manager/backend-settings-schema.js +264 -0
- package/dist/lib/codex-manager/backend-settings-schema.js.map +1 -0
- package/dist/lib/codex-manager/behavior-settings-panel.d.ts +33 -0
- package/dist/lib/codex-manager/behavior-settings-panel.d.ts.map +1 -0
- package/dist/lib/codex-manager/behavior-settings-panel.js +180 -0
- package/dist/lib/codex-manager/behavior-settings-panel.js.map +1 -0
- package/dist/lib/codex-manager/commands/best.d.ts +81 -0
- package/dist/lib/codex-manager/commands/best.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/best.js +223 -0
- package/dist/lib/codex-manager/commands/best.js.map +1 -0
- package/dist/lib/codex-manager/commands/check.d.ts +7 -0
- package/dist/lib/codex-manager/commands/check.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/check.js +5 -0
- package/dist/lib/codex-manager/commands/check.js.map +1 -0
- package/dist/lib/codex-manager/commands/config-explain.d.ts +7 -0
- package/dist/lib/codex-manager/commands/config-explain.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/config-explain.js +31 -0
- package/dist/lib/codex-manager/commands/config-explain.js.map +1 -0
- package/dist/lib/codex-manager/commands/debug-bundle.d.ts +28 -0
- package/dist/lib/codex-manager/commands/debug-bundle.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/debug-bundle.js +62 -0
- package/dist/lib/codex-manager/commands/debug-bundle.js.map +1 -0
- package/dist/lib/codex-manager/commands/doctor.d.ts +85 -0
- package/dist/lib/codex-manager/commands/doctor.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/doctor.js +424 -0
- package/dist/lib/codex-manager/commands/doctor.js.map +1 -0
- package/dist/lib/codex-manager/commands/fix.d.ts +92 -0
- package/dist/lib/codex-manager/commands/fix.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/fix.js +347 -0
- package/dist/lib/codex-manager/commands/fix.js.map +1 -0
- package/dist/lib/codex-manager/commands/forecast.d.ts +71 -0
- package/dist/lib/codex-manager/commands/forecast.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/forecast.js +371 -0
- package/dist/lib/codex-manager/commands/forecast.js.map +1 -0
- package/dist/lib/codex-manager/commands/init-config.d.ts +15 -0
- package/dist/lib/codex-manager/commands/init-config.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/init-config.js +95 -0
- package/dist/lib/codex-manager/commands/init-config.js.map +1 -0
- package/dist/lib/codex-manager/commands/report.d.ts +25 -0
- package/dist/lib/codex-manager/commands/report.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/report.js +399 -0
- package/dist/lib/codex-manager/commands/report.js.map +1 -0
- package/dist/lib/codex-manager/commands/status.d.ts +23 -0
- package/dist/lib/codex-manager/commands/status.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/status.js +50 -0
- package/dist/lib/codex-manager/commands/status.js.map +1 -0
- package/dist/lib/codex-manager/commands/switch.d.ts +22 -0
- package/dist/lib/codex-manager/commands/switch.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/switch.js +41 -0
- package/dist/lib/codex-manager/commands/switch.js.map +1 -0
- package/dist/lib/codex-manager/commands/verify-flagged.d.ts +69 -0
- package/dist/lib/codex-manager/commands/verify-flagged.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/verify-flagged.js +251 -0
- package/dist/lib/codex-manager/commands/verify-flagged.js.map +1 -0
- package/dist/lib/codex-manager/dashboard-display-panel.d.ts +40 -0
- package/dist/lib/codex-manager/dashboard-display-panel.d.ts.map +1 -0
- package/dist/lib/codex-manager/dashboard-display-panel.js +187 -0
- package/dist/lib/codex-manager/dashboard-display-panel.js.map +1 -0
- package/dist/lib/codex-manager/dashboard-formatters.d.ts +6 -0
- package/dist/lib/codex-manager/dashboard-formatters.d.ts.map +1 -0
- package/dist/lib/codex-manager/dashboard-formatters.js +19 -0
- package/dist/lib/codex-manager/dashboard-formatters.js.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-controller.d.ts +12 -0
- package/dist/lib/codex-manager/dashboard-settings-controller.d.ts.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-controller.js +17 -0
- package/dist/lib/codex-manager/dashboard-settings-controller.js.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-data.d.ts +10 -0
- package/dist/lib/codex-manager/dashboard-settings-data.d.ts.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-data.js +95 -0
- package/dist/lib/codex-manager/dashboard-settings-data.js.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-entry.d.ts +22 -0
- package/dist/lib/codex-manager/dashboard-settings-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/dashboard-settings-entry.js +13 -0
- package/dist/lib/codex-manager/dashboard-settings-entry.js.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-entry.d.ts +7 -0
- package/dist/lib/codex-manager/experimental-settings-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-entry.js +30 -0
- package/dist/lib/codex-manager/experimental-settings-entry.js.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-prompt.d.ts +66 -0
- package/dist/lib/codex-manager/experimental-settings-prompt.d.ts.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-prompt.js +221 -0
- package/dist/lib/codex-manager/experimental-settings-prompt.js.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-schema.d.ts +23 -0
- package/dist/lib/codex-manager/experimental-settings-schema.d.ts.map +1 -0
- package/dist/lib/codex-manager/experimental-settings-schema.js +34 -0
- package/dist/lib/codex-manager/experimental-settings-schema.js.map +1 -0
- package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts +30 -0
- package/dist/lib/codex-manager/experimental-sync-target-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/experimental-sync-target-entry.js +16 -0
- package/dist/lib/codex-manager/experimental-sync-target-entry.js.map +1 -0
- package/dist/lib/codex-manager/experimental-sync-target.d.ts +23 -0
- package/dist/lib/codex-manager/experimental-sync-target.d.ts.map +1 -0
- package/dist/lib/codex-manager/experimental-sync-target.js +39 -0
- package/dist/lib/codex-manager/experimental-sync-target.js.map +1 -0
- package/dist/lib/codex-manager/forecast-report-commands.d.ts +54 -0
- package/dist/lib/codex-manager/forecast-report-commands.d.ts.map +1 -0
- package/dist/lib/codex-manager/forecast-report-commands.js +443 -0
- package/dist/lib/codex-manager/forecast-report-commands.js.map +1 -0
- package/dist/lib/codex-manager/help.d.ts +36 -0
- package/dist/lib/codex-manager/help.d.ts.map +1 -0
- package/dist/lib/codex-manager/help.js +125 -0
- package/dist/lib/codex-manager/help.js.map +1 -0
- package/dist/lib/codex-manager/repair-commands.d.ts +70 -0
- package/dist/lib/codex-manager/repair-commands.d.ts.map +1 -0
- package/dist/lib/codex-manager/repair-commands.js +1671 -0
- package/dist/lib/codex-manager/repair-commands.js.map +1 -0
- package/dist/lib/codex-manager/settings-hub-entry.d.ts +30 -0
- package/dist/lib/codex-manager/settings-hub-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-hub-entry.js +11 -0
- package/dist/lib/codex-manager/settings-hub-entry.js.map +1 -0
- package/dist/lib/codex-manager/settings-hub-menu.d.ts +30 -0
- package/dist/lib/codex-manager/settings-hub-menu.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-hub-menu.js +37 -0
- package/dist/lib/codex-manager/settings-hub-menu.js.map +1 -0
- package/dist/lib/codex-manager/settings-hub-prompt.d.ts +25 -0
- package/dist/lib/codex-manager/settings-hub-prompt.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-hub-prompt.js +23 -0
- package/dist/lib/codex-manager/settings-hub-prompt.js.map +1 -0
- package/dist/lib/codex-manager/settings-hub.d.ts +10 -29
- package/dist/lib/codex-manager/settings-hub.d.ts.map +1 -1
- package/dist/lib/codex-manager/settings-hub.js +260 -2168
- package/dist/lib/codex-manager/settings-hub.js.map +1 -1
- package/dist/lib/codex-manager/settings-panels.d.ts +56 -0
- package/dist/lib/codex-manager/settings-panels.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-panels.js +73 -0
- package/dist/lib/codex-manager/settings-panels.js.map +1 -0
- package/dist/lib/codex-manager/settings-persist-utils.d.ts +9 -0
- package/dist/lib/codex-manager/settings-persist-utils.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-persist-utils.js +33 -0
- package/dist/lib/codex-manager/settings-persist-utils.js.map +1 -0
- package/dist/lib/codex-manager/settings-preview.d.ts +12 -0
- package/dist/lib/codex-manager/settings-preview.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-preview.js +118 -0
- package/dist/lib/codex-manager/settings-preview.js.map +1 -0
- package/dist/lib/codex-manager/settings-write-queue.d.ts +14 -0
- package/dist/lib/codex-manager/settings-write-queue.d.ts.map +1 -0
- package/dist/lib/codex-manager/settings-write-queue.js +88 -0
- package/dist/lib/codex-manager/settings-write-queue.js.map +1 -0
- package/dist/lib/codex-manager/statusline-order.d.ts +3 -0
- package/dist/lib/codex-manager/statusline-order.d.ts.map +1 -0
- package/dist/lib/codex-manager/statusline-order.js +17 -0
- package/dist/lib/codex-manager/statusline-order.js.map +1 -0
- package/dist/lib/codex-manager/statusline-settings-panel.d.ts +40 -0
- package/dist/lib/codex-manager/statusline-settings-panel.d.ts.map +1 -0
- package/dist/lib/codex-manager/statusline-settings-panel.js +167 -0
- package/dist/lib/codex-manager/statusline-settings-panel.js.map +1 -0
- package/dist/lib/codex-manager/theme-settings-panel.d.ts +26 -0
- package/dist/lib/codex-manager/theme-settings-panel.d.ts.map +1 -0
- package/dist/lib/codex-manager/theme-settings-panel.js +131 -0
- package/dist/lib/codex-manager/theme-settings-panel.js.map +1 -0
- package/dist/lib/codex-manager/unified-settings-controller.d.ts +27 -0
- package/dist/lib/codex-manager/unified-settings-controller.d.ts.map +1 -0
- package/dist/lib/codex-manager/unified-settings-controller.js +50 -0
- package/dist/lib/codex-manager/unified-settings-controller.js.map +1 -0
- package/dist/lib/codex-manager/unified-settings-entry.d.ts +6 -0
- package/dist/lib/codex-manager/unified-settings-entry.d.ts.map +1 -0
- package/dist/lib/codex-manager/unified-settings-entry.js +23 -0
- package/dist/lib/codex-manager/unified-settings-entry.js.map +1 -0
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +441 -2199
- package/dist/lib/codex-manager.js.map +1 -1
- package/dist/lib/config.d.ts +38 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +371 -9
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +9 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +13 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/forecast.d.ts +17 -0
- package/dist/lib/forecast.d.ts.map +1 -1
- package/dist/lib/forecast.js +33 -6
- package/dist/lib/forecast.js.map +1 -1
- package/dist/lib/health.d.ts +1 -0
- package/dist/lib/health.d.ts.map +1 -1
- package/dist/lib/health.js +6 -2
- package/dist/lib/health.js.map +1 -1
- package/dist/lib/named-backup-export.js +2 -2
- package/dist/lib/named-backup-export.js.map +1 -1
- package/dist/lib/parallel-probe.d.ts +1 -1
- package/dist/lib/parallel-probe.d.ts.map +1 -1
- package/dist/lib/parallel-probe.js +5 -2
- package/dist/lib/parallel-probe.js.map +1 -1
- package/dist/lib/proactive-refresh.d.ts +1 -1
- package/dist/lib/proactive-refresh.d.ts.map +1 -1
- package/dist/lib/proactive-refresh.js +14 -5
- package/dist/lib/proactive-refresh.js.map +1 -1
- package/dist/lib/prompts/codex.d.ts +8 -3
- package/dist/lib/prompts/codex.d.ts.map +1 -1
- package/dist/lib/prompts/codex.js +16 -26
- package/dist/lib/prompts/codex.js.map +1 -1
- package/dist/lib/refresh-guardian.d.ts +3 -0
- package/dist/lib/refresh-guardian.d.ts.map +1 -1
- package/dist/lib/refresh-guardian.js +142 -52
- package/dist/lib/refresh-guardian.js.map +1 -1
- package/dist/lib/request/failover-config.d.ts +4 -0
- package/dist/lib/request/failover-config.d.ts.map +1 -0
- package/dist/lib/request/failover-config.js +15 -0
- package/dist/lib/request/failover-config.js.map +1 -0
- package/dist/lib/request/fetch-helpers.d.ts +10 -4
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
- package/dist/lib/request/fetch-helpers.js +77 -21
- package/dist/lib/request/fetch-helpers.js.map +1 -1
- package/dist/lib/request/helpers/model-map.d.ts +49 -12
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +303 -108
- package/dist/lib/request/helpers/model-map.js.map +1 -1
- package/dist/lib/request/helpers/tool-utils.d.ts +2 -15
- package/dist/lib/request/helpers/tool-utils.d.ts.map +1 -1
- package/dist/lib/request/helpers/tool-utils.js +40 -27
- package/dist/lib/request/helpers/tool-utils.js.map +1 -1
- package/dist/lib/request/index.d.ts +5 -0
- package/dist/lib/request/index.d.ts.map +1 -0
- package/dist/lib/request/index.js +5 -0
- package/dist/lib/request/index.js.map +1 -0
- package/dist/lib/request/request-init.d.ts +3 -0
- package/dist/lib/request/request-init.d.ts.map +1 -0
- package/dist/lib/request/request-init.js +50 -0
- package/dist/lib/request/request-init.js.map +1 -0
- package/dist/lib/request/request-transformer.d.ts +19 -6
- package/dist/lib/request/request-transformer.d.ts.map +1 -1
- package/dist/lib/request/request-transformer.js +210 -193
- package/dist/lib/request/request-transformer.js.map +1 -1
- package/dist/lib/request/response-compaction.d.ts +20 -0
- package/dist/lib/request/response-compaction.d.ts.map +1 -0
- package/dist/lib/request/response-compaction.js +124 -0
- package/dist/lib/request/response-compaction.js.map +1 -0
- package/dist/lib/request/response-handler.d.ts +2 -0
- package/dist/lib/request/response-handler.d.ts.map +1 -1
- package/dist/lib/request/response-handler.js +567 -11
- package/dist/lib/request/response-handler.js.map +1 -1
- package/dist/lib/request/response-metadata.d.ts +3 -0
- package/dist/lib/request/response-metadata.d.ts.map +1 -0
- package/dist/lib/request/response-metadata.js +61 -0
- package/dist/lib/request/response-metadata.js.map +1 -0
- package/dist/lib/request/wait-utils.d.ts +14 -0
- package/dist/lib/request/wait-utils.d.ts.map +1 -0
- package/dist/lib/request/wait-utils.js +44 -0
- package/dist/lib/request/wait-utils.js.map +1 -0
- package/dist/lib/rotation.d.ts +14 -11
- package/dist/lib/rotation.d.ts.map +1 -1
- package/dist/lib/rotation.js +36 -30
- package/dist/lib/rotation.js.map +1 -1
- package/dist/lib/runtime/account-check-helpers.d.ts +8 -0
- package/dist/lib/runtime/account-check-helpers.d.ts.map +1 -0
- package/dist/lib/runtime/account-check-helpers.js +30 -0
- package/dist/lib/runtime/account-check-helpers.js.map +1 -0
- package/dist/lib/runtime/account-check-types.d.ts +18 -0
- package/dist/lib/runtime/account-check-types.d.ts.map +1 -0
- package/dist/lib/runtime/account-check-types.js +12 -0
- package/dist/lib/runtime/account-check-types.js.map +1 -0
- package/dist/lib/runtime/account-check.d.ts +48 -0
- package/dist/lib/runtime/account-check.d.ts.map +1 -0
- package/dist/lib/runtime/account-check.js +202 -0
- package/dist/lib/runtime/account-check.js.map +1 -0
- package/dist/lib/runtime/account-health-check.d.ts +8 -0
- package/dist/lib/runtime/account-health-check.d.ts.map +1 -0
- package/dist/lib/runtime/account-health-check.js +30 -0
- package/dist/lib/runtime/account-health-check.js.map +1 -0
- package/dist/lib/runtime/account-manager-cache-entry.d.ts +25 -0
- package/dist/lib/runtime/account-manager-cache-entry.d.ts.map +1 -0
- package/dist/lib/runtime/account-manager-cache-entry.js +17 -0
- package/dist/lib/runtime/account-manager-cache-entry.js.map +1 -0
- package/dist/lib/runtime/account-manager-cache.d.ts +25 -0
- package/dist/lib/runtime/account-manager-cache.d.ts.map +1 -0
- package/dist/lib/runtime/account-manager-cache.js +44 -0
- package/dist/lib/runtime/account-manager-cache.js.map +1 -0
- package/dist/lib/runtime/account-pool.d.ts +23 -0
- package/dist/lib/runtime/account-pool.d.ts.map +1 -0
- package/dist/lib/runtime/account-pool.js +138 -0
- package/dist/lib/runtime/account-pool.js.map +1 -0
- package/dist/lib/runtime/account-scope.d.ts +10 -0
- package/dist/lib/runtime/account-scope.d.ts.map +1 -0
- package/dist/lib/runtime/account-scope.js +13 -0
- package/dist/lib/runtime/account-scope.js.map +1 -0
- package/dist/lib/runtime/account-select-event.d.ts +19 -0
- package/dist/lib/runtime/account-select-event.d.ts.map +1 -0
- package/dist/lib/runtime/account-select-event.js +53 -0
- package/dist/lib/runtime/account-select-event.js.map +1 -0
- package/dist/lib/runtime/account-selection.d.ts +28 -0
- package/dist/lib/runtime/account-selection.d.ts.map +1 -0
- package/dist/lib/runtime/account-selection.js +46 -0
- package/dist/lib/runtime/account-selection.js.map +1 -0
- package/dist/lib/runtime/account-state.d.ts +13 -0
- package/dist/lib/runtime/account-state.d.ts.map +1 -0
- package/dist/lib/runtime/account-state.js +38 -0
- package/dist/lib/runtime/account-state.js.map +1 -0
- package/dist/lib/runtime/account-status.d.ts +13 -0
- package/dist/lib/runtime/account-status.d.ts.map +1 -0
- package/dist/lib/runtime/account-status.js +37 -0
- package/dist/lib/runtime/account-status.js.map +1 -0
- package/dist/lib/runtime/account-storage-scope-entry.d.ts +26 -0
- package/dist/lib/runtime/account-storage-scope-entry.d.ts.map +1 -0
- package/dist/lib/runtime/account-storage-scope-entry.js +15 -0
- package/dist/lib/runtime/account-storage-scope-entry.js.map +1 -0
- package/dist/lib/runtime/auth-facade.d.ts +51 -0
- package/dist/lib/runtime/auth-facade.d.ts.map +1 -0
- package/dist/lib/runtime/auth-facade.js +48 -0
- package/dist/lib/runtime/auth-facade.js.map +1 -0
- package/dist/lib/runtime/browser-oauth-flow.d.ts +32 -0
- package/dist/lib/runtime/browser-oauth-flow.d.ts.map +1 -0
- package/dist/lib/runtime/browser-oauth-flow.js +31 -0
- package/dist/lib/runtime/browser-oauth-flow.js.map +1 -0
- package/dist/lib/runtime/capability-boost.d.ts +25 -0
- package/dist/lib/runtime/capability-boost.d.ts.map +1 -0
- package/dist/lib/runtime/capability-boost.js +26 -0
- package/dist/lib/runtime/capability-boost.js.map +1 -0
- package/dist/lib/runtime/event-handler.d.ts +53 -0
- package/dist/lib/runtime/event-handler.d.ts.map +1 -0
- package/dist/lib/runtime/event-handler.js +46 -0
- package/dist/lib/runtime/event-handler.js.map +1 -0
- package/dist/lib/runtime/flagged-verify-types.d.ts +9 -0
- package/dist/lib/runtime/flagged-verify-types.d.ts.map +1 -0
- package/dist/lib/runtime/flagged-verify-types.js +7 -0
- package/dist/lib/runtime/flagged-verify-types.js.map +1 -0
- package/dist/lib/runtime/hydrate-emails.d.ts +13 -0
- package/dist/lib/runtime/hydrate-emails.d.ts.map +1 -0
- package/dist/lib/runtime/hydrate-emails.js +56 -0
- package/dist/lib/runtime/hydrate-emails.js.map +1 -0
- package/dist/lib/runtime/live-sync-entry.d.ts +36 -0
- package/dist/lib/runtime/live-sync-entry.d.ts.map +1 -0
- package/dist/lib/runtime/live-sync-entry.js +14 -0
- package/dist/lib/runtime/live-sync-entry.js.map +1 -0
- package/dist/lib/runtime/live-sync.d.ts +35 -0
- package/dist/lib/runtime/live-sync.d.ts.map +1 -0
- package/dist/lib/runtime/live-sync.js +65 -0
- package/dist/lib/runtime/live-sync.js.map +1 -0
- package/dist/lib/runtime/loader-setup.d.ts +9 -0
- package/dist/lib/runtime/loader-setup.d.ts.map +1 -0
- package/dist/lib/runtime/loader-setup.js +8 -0
- package/dist/lib/runtime/loader-setup.js.map +1 -0
- package/dist/lib/runtime/login-menu-accounts.d.ts +29 -0
- package/dist/lib/runtime/login-menu-accounts.d.ts.map +1 -0
- package/dist/lib/runtime/login-menu-accounts.js +33 -0
- package/dist/lib/runtime/login-menu-accounts.js.map +1 -0
- package/dist/lib/runtime/manual-oauth-flow.d.ts +40 -0
- package/dist/lib/runtime/manual-oauth-flow.d.ts.map +1 -0
- package/dist/lib/runtime/manual-oauth-flow.js +71 -0
- package/dist/lib/runtime/manual-oauth-flow.js.map +1 -0
- package/dist/lib/runtime/metrics.d.ts +29 -0
- package/dist/lib/runtime/metrics.d.ts.map +1 -0
- package/dist/lib/runtime/metrics.js +97 -0
- package/dist/lib/runtime/metrics.js.map +1 -0
- package/dist/lib/runtime/oauth-browser-flow.d.ts +9 -0
- package/dist/lib/runtime/oauth-browser-flow.d.ts.map +1 -0
- package/dist/lib/runtime/oauth-browser-flow.js +34 -0
- package/dist/lib/runtime/oauth-browser-flow.js.map +1 -0
- package/dist/lib/runtime/preemptive-quota.d.ts +13 -0
- package/dist/lib/runtime/preemptive-quota.d.ts.map +1 -0
- package/dist/lib/runtime/preemptive-quota.js +9 -0
- package/dist/lib/runtime/preemptive-quota.js.map +1 -0
- package/dist/lib/runtime/quota-headers.d.ts +12 -0
- package/dist/lib/runtime/quota-headers.d.ts.map +1 -0
- package/dist/lib/runtime/quota-headers.js +131 -0
- package/dist/lib/runtime/quota-headers.js.map +1 -0
- package/dist/lib/runtime/quota-probe.d.ts +18 -0
- package/dist/lib/runtime/quota-probe.d.ts.map +1 -0
- package/dist/lib/runtime/quota-probe.js +82 -0
- package/dist/lib/runtime/quota-probe.js.map +1 -0
- package/dist/lib/runtime/quota-settings.d.ts +14 -0
- package/dist/lib/runtime/quota-settings.d.ts.map +1 -0
- package/dist/lib/runtime/quota-settings.js +12 -0
- package/dist/lib/runtime/quota-settings.js.map +1 -0
- package/dist/lib/runtime/refresh-guardian-entry.d.ts +32 -0
- package/dist/lib/runtime/refresh-guardian-entry.d.ts.map +1 -0
- package/dist/lib/runtime/refresh-guardian-entry.js +12 -0
- package/dist/lib/runtime/refresh-guardian-entry.js.map +1 -0
- package/dist/lib/runtime/refresh-guardian.d.ts +24 -0
- package/dist/lib/runtime/refresh-guardian.d.ts.map +1 -0
- package/dist/lib/runtime/refresh-guardian.js +32 -0
- package/dist/lib/runtime/refresh-guardian.js.map +1 -0
- package/dist/lib/runtime/request-init.d.ts +5 -0
- package/dist/lib/runtime/request-init.d.ts.map +1 -0
- package/dist/lib/runtime/request-init.js +50 -0
- package/dist/lib/runtime/request-init.js.map +1 -0
- package/dist/lib/runtime/runtime-services.d.ts +58 -0
- package/dist/lib/runtime/runtime-services.d.ts.map +1 -0
- package/dist/lib/runtime/runtime-services.js +87 -0
- package/dist/lib/runtime/runtime-services.js.map +1 -0
- package/dist/lib/runtime/session-affinity-entry.d.ts +30 -0
- package/dist/lib/runtime/session-affinity-entry.d.ts.map +1 -0
- package/dist/lib/runtime/session-affinity-entry.js +11 -0
- package/dist/lib/runtime/session-affinity-entry.js.map +1 -0
- package/dist/lib/runtime/session-affinity.d.ts +13 -0
- package/dist/lib/runtime/session-affinity.d.ts.map +1 -0
- package/dist/lib/runtime/session-affinity.js +17 -0
- package/dist/lib/runtime/session-affinity.js.map +1 -0
- package/dist/lib/runtime/session-recovery.d.ts +8 -0
- package/dist/lib/runtime/session-recovery.d.ts.map +1 -0
- package/dist/lib/runtime/session-recovery.js +7 -0
- package/dist/lib/runtime/session-recovery.js.map +1 -0
- package/dist/lib/runtime/status-marker.d.ts +3 -0
- package/dist/lib/runtime/status-marker.d.ts.map +1 -0
- package/dist/lib/runtime/status-marker.js +15 -0
- package/dist/lib/runtime/status-marker.js.map +1 -0
- package/dist/lib/runtime/storage-scope.d.ts +13 -0
- package/dist/lib/runtime/storage-scope.d.ts.map +1 -0
- package/dist/lib/runtime/storage-scope.js +14 -0
- package/dist/lib/runtime/storage-scope.js.map +1 -0
- package/dist/lib/runtime/toast.d.ts +16 -0
- package/dist/lib/runtime/toast.d.ts.map +1 -0
- package/dist/lib/runtime/toast.js +16 -0
- package/dist/lib/runtime/toast.js.map +1 -0
- package/dist/lib/runtime/ui-runtime-entry.d.ts +7 -0
- package/dist/lib/runtime/ui-runtime-entry.d.ts.map +1 -0
- package/dist/lib/runtime/ui-runtime-entry.js +4 -0
- package/dist/lib/runtime/ui-runtime-entry.js.map +1 -0
- package/dist/lib/runtime/ui-runtime.d.ts +9 -0
- package/dist/lib/runtime/ui-runtime.d.ts.map +1 -0
- package/dist/lib/runtime/ui-runtime.js +23 -0
- package/dist/lib/runtime/ui-runtime.js.map +1 -0
- package/dist/lib/runtime/verify-flagged.d.ts +44 -0
- package/dist/lib/runtime/verify-flagged.d.ts.map +1 -0
- package/dist/lib/runtime/verify-flagged.js +84 -0
- package/dist/lib/runtime/verify-flagged.js.map +1 -0
- package/dist/lib/schemas.d.ts +2 -0
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +2 -0
- package/dist/lib/schemas.js.map +1 -1
- package/dist/lib/session-affinity.d.ts +10 -0
- package/dist/lib/session-affinity.d.ts.map +1 -1
- package/dist/lib/session-affinity.js +53 -6
- package/dist/lib/session-affinity.js.map +1 -1
- package/dist/lib/storage/account-clear-entry.d.ts +16 -0
- package/dist/lib/storage/account-clear-entry.d.ts.map +1 -0
- package/dist/lib/storage/account-clear-entry.js +12 -0
- package/dist/lib/storage/account-clear-entry.js.map +1 -0
- package/dist/lib/storage/account-clear.d.ts +8 -0
- package/dist/lib/storage/account-clear.d.ts.map +1 -0
- package/dist/lib/storage/account-clear.js +29 -0
- package/dist/lib/storage/account-clear.js.map +1 -0
- package/dist/lib/storage/account-match-utils.d.ts +9 -0
- package/dist/lib/storage/account-match-utils.d.ts.map +1 -0
- package/dist/lib/storage/account-match-utils.js +45 -0
- package/dist/lib/storage/account-match-utils.js.map +1 -0
- package/dist/lib/storage/account-persistence.d.ts +3 -0
- package/dist/lib/storage/account-persistence.d.ts.map +1 -0
- package/dist/lib/storage/account-persistence.js +12 -0
- package/dist/lib/storage/account-persistence.js.map +1 -0
- package/dist/lib/storage/account-port.d.ts +50 -0
- package/dist/lib/storage/account-port.d.ts.map +1 -0
- package/dist/lib/storage/account-port.js +43 -0
- package/dist/lib/storage/account-port.js.map +1 -0
- package/dist/lib/storage/account-save-entry.d.ts +7 -0
- package/dist/lib/storage/account-save-entry.d.ts.map +1 -0
- package/dist/lib/storage/account-save-entry.js +6 -0
- package/dist/lib/storage/account-save-entry.js.map +1 -0
- package/dist/lib/storage/account-save.d.ts +30 -0
- package/dist/lib/storage/account-save.d.ts.map +1 -0
- package/dist/lib/storage/account-save.js +49 -0
- package/dist/lib/storage/account-save.js.map +1 -0
- package/dist/lib/storage/account-snapshot.d.ts +25 -0
- package/dist/lib/storage/account-snapshot.d.ts.map +1 -0
- package/dist/lib/storage/account-snapshot.js +78 -0
- package/dist/lib/storage/account-snapshot.js.map +1 -0
- package/dist/lib/storage/backup-metadata-builder.d.ts +32 -0
- package/dist/lib/storage/backup-metadata-builder.d.ts.map +1 -0
- package/dist/lib/storage/backup-metadata-builder.js +77 -0
- package/dist/lib/storage/backup-metadata-builder.js.map +1 -0
- package/dist/lib/storage/backup-metadata.d.ts +29 -0
- package/dist/lib/storage/backup-metadata.d.ts.map +1 -0
- package/dist/lib/storage/backup-metadata.js +16 -0
- package/dist/lib/storage/backup-metadata.js.map +1 -0
- package/dist/lib/storage/backup-paths.d.ts +10 -0
- package/dist/lib/storage/backup-paths.d.ts.map +1 -0
- package/dist/lib/storage/backup-paths.js +27 -0
- package/dist/lib/storage/backup-paths.js.map +1 -0
- package/dist/lib/storage/backup-restore.d.ts +11 -0
- package/dist/lib/storage/backup-restore.d.ts.map +1 -0
- package/dist/lib/storage/backup-restore.js +52 -0
- package/dist/lib/storage/backup-restore.js.map +1 -0
- package/dist/lib/storage/cache-artifacts.d.ts +2 -0
- package/dist/lib/storage/cache-artifacts.d.ts.map +1 -0
- package/dist/lib/storage/cache-artifacts.js +4 -0
- package/dist/lib/storage/cache-artifacts.js.map +1 -0
- package/dist/lib/storage/error-hints.d.ts +10 -0
- package/dist/lib/storage/error-hints.d.ts.map +1 -0
- package/dist/lib/storage/error-hints.js +36 -0
- package/dist/lib/storage/error-hints.js.map +1 -0
- package/dist/lib/storage/file-paths.d.ts +6 -0
- package/dist/lib/storage/file-paths.d.ts.map +1 -0
- package/dist/lib/storage/file-paths.js +17 -0
- package/dist/lib/storage/file-paths.js.map +1 -0
- package/dist/lib/storage/fixture-guards.d.ts +4 -0
- package/dist/lib/storage/fixture-guards.d.ts.map +1 -0
- package/dist/lib/storage/fixture-guards.js +27 -0
- package/dist/lib/storage/fixture-guards.js.map +1 -0
- package/dist/lib/storage/flagged-entry.d.ts +15 -0
- package/dist/lib/storage/flagged-entry.d.ts.map +1 -0
- package/dist/lib/storage/flagged-entry.js +12 -0
- package/dist/lib/storage/flagged-entry.js.map +1 -0
- package/dist/lib/storage/flagged-load-entry.d.ts +20 -0
- package/dist/lib/storage/flagged-load-entry.d.ts.map +1 -0
- package/dist/lib/storage/flagged-load-entry.js +13 -0
- package/dist/lib/storage/flagged-load-entry.js.map +1 -0
- package/dist/lib/storage/flagged-save-entry.d.ts +7 -0
- package/dist/lib/storage/flagged-save-entry.d.ts.map +1 -0
- package/dist/lib/storage/flagged-save-entry.js +6 -0
- package/dist/lib/storage/flagged-save-entry.js.map +1 -0
- package/dist/lib/storage/flagged-storage-file.d.ts +7 -0
- package/dist/lib/storage/flagged-storage-file.d.ts.map +1 -0
- package/dist/lib/storage/flagged-storage-file.js +25 -0
- package/dist/lib/storage/flagged-storage-file.js.map +1 -0
- package/dist/lib/storage/flagged-storage-io.d.ts +28 -0
- package/dist/lib/storage/flagged-storage-io.d.ts.map +1 -0
- package/dist/lib/storage/flagged-storage-io.js +135 -0
- package/dist/lib/storage/flagged-storage-io.js.map +1 -0
- package/dist/lib/storage/flagged-storage.d.ts +6 -0
- package/dist/lib/storage/flagged-storage.d.ts.map +1 -0
- package/dist/lib/storage/flagged-storage.js +90 -0
- package/dist/lib/storage/flagged-storage.js.map +1 -0
- package/dist/lib/storage/gitignore.d.ts +7 -0
- package/dist/lib/storage/gitignore.d.ts.map +1 -0
- package/dist/lib/storage/gitignore.js +34 -0
- package/dist/lib/storage/gitignore.js.map +1 -0
- package/dist/lib/storage/hash.d.ts +2 -0
- package/dist/lib/storage/hash.d.ts.map +1 -0
- package/dist/lib/storage/hash.js +5 -0
- package/dist/lib/storage/hash.js.map +1 -0
- package/dist/lib/storage/identity.d.ts +21 -0
- package/dist/lib/storage/identity.d.ts.map +1 -0
- package/dist/lib/storage/identity.js +59 -0
- package/dist/lib/storage/identity.js.map +1 -0
- package/dist/lib/storage/import-export.d.ts +24 -0
- package/dist/lib/storage/import-export.d.ts.map +1 -0
- package/dist/lib/storage/import-export.js +108 -0
- package/dist/lib/storage/import-export.js.map +1 -0
- package/dist/lib/storage/metadata-section.d.ts +16 -0
- package/dist/lib/storage/metadata-section.d.ts.map +1 -0
- package/dist/lib/storage/metadata-section.js +16 -0
- package/dist/lib/storage/metadata-section.js.map +1 -0
- package/dist/lib/storage/named-backup-entry.d.ts +15 -0
- package/dist/lib/storage/named-backup-entry.d.ts.map +1 -0
- package/dist/lib/storage/named-backup-entry.js +7 -0
- package/dist/lib/storage/named-backup-entry.js.map +1 -0
- package/dist/lib/storage/named-backups-entry.d.ts +19 -0
- package/dist/lib/storage/named-backups-entry.d.ts.map +1 -0
- package/dist/lib/storage/named-backups-entry.js +7 -0
- package/dist/lib/storage/named-backups-entry.js.map +1 -0
- package/dist/lib/storage/named-backups.d.ts +15 -0
- package/dist/lib/storage/named-backups.d.ts.map +1 -0
- package/dist/lib/storage/named-backups.js +68 -0
- package/dist/lib/storage/named-backups.js.map +1 -0
- package/dist/lib/storage/path-state.d.ts +9 -0
- package/dist/lib/storage/path-state.d.ts.map +1 -0
- package/dist/lib/storage/path-state.js +20 -0
- package/dist/lib/storage/path-state.js.map +1 -0
- package/dist/lib/storage/project-migration.d.ts +10 -0
- package/dist/lib/storage/project-migration.d.ts.map +1 -0
- package/dist/lib/storage/project-migration.js +38 -0
- package/dist/lib/storage/project-migration.js.map +1 -0
- package/dist/lib/storage/record-utils.d.ts +3 -0
- package/dist/lib/storage/record-utils.d.ts.map +1 -0
- package/dist/lib/storage/record-utils.js +9 -0
- package/dist/lib/storage/record-utils.js.map +1 -0
- package/dist/lib/storage/restore-assessment.d.ts +7 -0
- package/dist/lib/storage/restore-assessment.d.ts.map +1 -0
- package/dist/lib/storage/restore-assessment.js +42 -0
- package/dist/lib/storage/restore-assessment.js.map +1 -0
- package/dist/lib/storage/restore-backup-entry.d.ts +24 -0
- package/dist/lib/storage/restore-backup-entry.d.ts.map +1 -0
- package/dist/lib/storage/restore-backup-entry.js +10 -0
- package/dist/lib/storage/restore-backup-entry.js.map +1 -0
- package/dist/lib/storage/restore-metadata.d.ts +10 -0
- package/dist/lib/storage/restore-metadata.d.ts.map +1 -0
- package/dist/lib/storage/restore-metadata.js +18 -0
- package/dist/lib/storage/restore-metadata.js.map +1 -0
- package/dist/lib/storage/restore.d.ts +14 -0
- package/dist/lib/storage/restore.d.ts.map +1 -0
- package/dist/lib/storage/restore.js +53 -0
- package/dist/lib/storage/restore.js.map +1 -0
- package/dist/lib/storage/snapshot-inspectors.d.ts +22 -0
- package/dist/lib/storage/snapshot-inspectors.d.ts.map +1 -0
- package/dist/lib/storage/snapshot-inspectors.js +95 -0
- package/dist/lib/storage/snapshot-inspectors.js.map +1 -0
- package/dist/lib/storage/storage-parser.d.ts +15 -0
- package/dist/lib/storage/storage-parser.d.ts.map +1 -0
- package/dist/lib/storage/storage-parser.js +16 -0
- package/dist/lib/storage/storage-parser.js.map +1 -0
- package/dist/lib/storage/transactions.d.ts +23 -0
- package/dist/lib/storage/transactions.d.ts.map +1 -0
- package/dist/lib/storage/transactions.js +64 -0
- package/dist/lib/storage/transactions.js.map +1 -0
- package/dist/lib/storage.d.ts +8 -47
- package/dist/lib/storage.d.ts.map +1 -1
- package/dist/lib/storage.js +482 -1044
- package/dist/lib/storage.js.map +1 -1
- package/dist/lib/types.d.ts +80 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +41 -4
- package/scripts/check-pack-budget-lib.js +114 -0
- package/scripts/check-pack-budget.mjs +10 -0
- package/scripts/codex-multi-auth.js +34 -10
- package/scripts/install-codex-auth-utils.js +54 -14
- package/scripts/install-codex-auth.js +62 -33
- package/scripts/update-vendor-provenance.mjs +96 -0
- package/scripts/verify-vendor-provenance.mjs +53 -0
|
@@ -2,7 +2,7 @@ import { logDebug, logWarn } from "../logger.js";
|
|
|
2
2
|
import { TOOL_REMAP_MESSAGE } from "../prompts/codex.js";
|
|
3
3
|
import { CODEX_HOST_BRIDGE } from "../prompts/codex-host-bridge.js";
|
|
4
4
|
import { getHostCodexPrompt } from "../prompts/host-codex-prompt.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getModelCapabilities, getModelProfile, resolveNormalizedModel, } from "./helpers/model-map.js";
|
|
6
6
|
import { filterHostSystemPromptsWithCachedPrompt, normalizeOrphanedToolOutputs, injectMissingToolOutputs, } from "./helpers/input-utils.js";
|
|
7
7
|
import { cleanupToolDefinitions } from "./helpers/tool-utils.js";
|
|
8
8
|
const PLAN_MODE_ONLY_TOOLS = new Set(["request_user_input"]);
|
|
@@ -10,86 +10,14 @@ export { isHostSystemPrompt, filterHostSystemPromptsWithCachedPrompt, } from "./
|
|
|
10
10
|
/**
|
|
11
11
|
* Normalize model name to Codex-supported variants
|
|
12
12
|
*
|
|
13
|
-
* Uses
|
|
14
|
-
*
|
|
13
|
+
* Uses the shared model catalog so request routing, prompt selection, and CLI
|
|
14
|
+
* diagnostics all agree on the same effective model.
|
|
15
15
|
*
|
|
16
16
|
* @param model - Original model name (e.g., "gpt-5-codex-low", "openai/gpt-5-codex")
|
|
17
|
-
* @returns Normalized model name (e.g., "gpt-5-codex", "gpt-5.1-codex-max")
|
|
17
|
+
* @returns Normalized model name (e.g., "gpt-5-codex", "gpt-5.4", "gpt-5.1-codex-max")
|
|
18
18
|
*/
|
|
19
19
|
export function normalizeModel(model) {
|
|
20
|
-
|
|
21
|
-
return "gpt-5.1";
|
|
22
|
-
// Strip provider prefix if present (e.g., "openai/gpt-5-codex" → "gpt-5-codex")
|
|
23
|
-
const modelId = model.includes("/") ? model.split("/").pop() ?? model : model;
|
|
24
|
-
// Try explicit model map first (handles all known model variants)
|
|
25
|
-
const mappedModel = getNormalizedModel(modelId);
|
|
26
|
-
if (mappedModel) {
|
|
27
|
-
return mappedModel;
|
|
28
|
-
}
|
|
29
|
-
// Fallback: Pattern-based matching for unknown/custom model names
|
|
30
|
-
// This preserves backwards compatibility with old verbose names
|
|
31
|
-
// like "GPT 5 Codex Low (ChatGPT Subscription)"
|
|
32
|
-
const normalized = modelId.toLowerCase();
|
|
33
|
-
// Priority order for pattern matching (most specific first):
|
|
34
|
-
// 1. GPT-5.3 Codex Spark (legacy alias -> canonical gpt-5-codex)
|
|
35
|
-
if (normalized.includes("gpt-5.3-codex-spark") ||
|
|
36
|
-
normalized.includes("gpt 5.3 codex spark")) {
|
|
37
|
-
return "gpt-5-codex";
|
|
38
|
-
}
|
|
39
|
-
// 2. GPT-5.3 Codex (legacy alias -> canonical gpt-5-codex)
|
|
40
|
-
if (normalized.includes("gpt-5.3-codex") ||
|
|
41
|
-
normalized.includes("gpt 5.3 codex")) {
|
|
42
|
-
return "gpt-5-codex";
|
|
43
|
-
}
|
|
44
|
-
// 3. GPT-5.2 Codex (legacy alias -> canonical gpt-5-codex)
|
|
45
|
-
if (normalized.includes("gpt-5.2-codex") ||
|
|
46
|
-
normalized.includes("gpt 5.2 codex")) {
|
|
47
|
-
return "gpt-5-codex";
|
|
48
|
-
}
|
|
49
|
-
// 4. GPT-5.2 (general purpose)
|
|
50
|
-
if (normalized.includes("gpt-5.2") || normalized.includes("gpt 5.2")) {
|
|
51
|
-
return "gpt-5.2";
|
|
52
|
-
}
|
|
53
|
-
// 5. GPT-5.1 Codex Max
|
|
54
|
-
if (normalized.includes("gpt-5.1-codex-max") ||
|
|
55
|
-
normalized.includes("gpt 5.1 codex max")) {
|
|
56
|
-
return "gpt-5.1-codex-max";
|
|
57
|
-
}
|
|
58
|
-
// 6. GPT-5.1 Codex Mini
|
|
59
|
-
if (normalized.includes("gpt-5.1-codex-mini") ||
|
|
60
|
-
normalized.includes("gpt 5.1 codex mini")) {
|
|
61
|
-
return "gpt-5.1-codex-mini";
|
|
62
|
-
}
|
|
63
|
-
// 7. Legacy Codex Mini
|
|
64
|
-
if (normalized.includes("codex-mini-latest") ||
|
|
65
|
-
normalized.includes("gpt-5-codex-mini") ||
|
|
66
|
-
normalized.includes("gpt 5 codex mini")) {
|
|
67
|
-
return "gpt-5.1-codex-mini";
|
|
68
|
-
}
|
|
69
|
-
// 8. GPT-5 Codex canonical + GPT-5.1 Codex legacy alias
|
|
70
|
-
if (normalized.includes("gpt-5-codex") ||
|
|
71
|
-
normalized.includes("gpt 5 codex")) {
|
|
72
|
-
return "gpt-5-codex";
|
|
73
|
-
}
|
|
74
|
-
// 9. GPT-5.1 Codex (legacy alias)
|
|
75
|
-
if (normalized.includes("gpt-5.1-codex") ||
|
|
76
|
-
normalized.includes("gpt 5.1 codex")) {
|
|
77
|
-
return "gpt-5-codex";
|
|
78
|
-
}
|
|
79
|
-
// 10. GPT-5.1 (general-purpose)
|
|
80
|
-
if (normalized.includes("gpt-5.1") || normalized.includes("gpt 5.1")) {
|
|
81
|
-
return "gpt-5.1";
|
|
82
|
-
}
|
|
83
|
-
// 11. GPT-5 Codex family (any other variant with "codex")
|
|
84
|
-
if (normalized.includes("codex")) {
|
|
85
|
-
return "gpt-5-codex";
|
|
86
|
-
}
|
|
87
|
-
// 12. GPT-5 family (any variant) - default to 5.1
|
|
88
|
-
if (normalized.includes("gpt-5") || normalized.includes("gpt 5")) {
|
|
89
|
-
return "gpt-5.1";
|
|
90
|
-
}
|
|
91
|
-
// Default fallback
|
|
92
|
-
return "gpt-5.1";
|
|
20
|
+
return resolveNormalizedModel(model);
|
|
93
21
|
}
|
|
94
22
|
/**
|
|
95
23
|
* Extract configuration for a specific model
|
|
@@ -190,6 +118,12 @@ function resolveTextVerbosity(modelConfig, body) {
|
|
|
190
118
|
modelConfig.textVerbosity ??
|
|
191
119
|
"medium");
|
|
192
120
|
}
|
|
121
|
+
function resolvePromptCacheRetention(modelConfig, body) {
|
|
122
|
+
const providerOpenAI = body.providerOptions?.openai;
|
|
123
|
+
return (body.prompt_cache_retention ??
|
|
124
|
+
providerOpenAI?.promptCacheRetention ??
|
|
125
|
+
modelConfig.promptCacheRetention);
|
|
126
|
+
}
|
|
193
127
|
function resolveInclude(modelConfig, body) {
|
|
194
128
|
const providerOpenAI = body.providerOptions?.openai;
|
|
195
129
|
const base = body.include ??
|
|
@@ -202,6 +136,21 @@ function resolveInclude(modelConfig, body) {
|
|
|
202
136
|
}
|
|
203
137
|
return include;
|
|
204
138
|
}
|
|
139
|
+
function isBackgroundModeRequested(body) {
|
|
140
|
+
return body.background === true;
|
|
141
|
+
}
|
|
142
|
+
function assertBackgroundModeCompatibility(body, allowBackgroundResponses) {
|
|
143
|
+
if (!isBackgroundModeRequested(body)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
if (!allowBackgroundResponses) {
|
|
147
|
+
throw new Error("Responses background mode is disabled. Enable pluginConfig.backgroundResponses or CODEX_AUTH_BACKGROUND_RESPONSES=1 to opt in.");
|
|
148
|
+
}
|
|
149
|
+
if (body.store === false || body.providerOptions?.openai?.store === false) {
|
|
150
|
+
throw new Error("Responses background mode requires store=true and cannot be combined with stateless store=false routing.");
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
205
154
|
function parseCollaborationMode(value) {
|
|
206
155
|
if (!value)
|
|
207
156
|
return undefined;
|
|
@@ -263,25 +212,102 @@ function sanitizePlanOnlyTools(tools, mode) {
|
|
|
263
212
|
if (!Array.isArray(tools) || mode === "plan")
|
|
264
213
|
return tools;
|
|
265
214
|
let removed = 0;
|
|
266
|
-
const filtered = tools
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const functionDef = entry.function;
|
|
270
|
-
if (!functionDef || typeof functionDef !== "object")
|
|
271
|
-
return true;
|
|
272
|
-
const name = functionDef.name;
|
|
273
|
-
if (typeof name !== "string")
|
|
274
|
-
return true;
|
|
275
|
-
if (!PLAN_MODE_ONLY_TOOLS.has(name))
|
|
276
|
-
return true;
|
|
277
|
-
removed++;
|
|
278
|
-
return false;
|
|
279
|
-
});
|
|
215
|
+
const filtered = tools
|
|
216
|
+
.map((entry) => sanitizePlanOnlyToolEntry(entry, mode, () => removed++))
|
|
217
|
+
.filter((entry) => entry !== null);
|
|
280
218
|
if (removed > 0) {
|
|
281
219
|
logWarn(`Removed ${removed} plan-mode-only tool definition(s) because collaboration mode is ${mode}`);
|
|
282
220
|
}
|
|
283
221
|
return filtered;
|
|
284
222
|
}
|
|
223
|
+
function sanitizePlanOnlyToolEntry(entry, mode, onRemoved) {
|
|
224
|
+
if (!entry || typeof entry !== "object" || mode === "plan") {
|
|
225
|
+
return entry;
|
|
226
|
+
}
|
|
227
|
+
const record = entry;
|
|
228
|
+
if (record.type === "namespace" && Array.isArray(record.tools)) {
|
|
229
|
+
const namespaceTools = record.tools;
|
|
230
|
+
const nestedTools = namespaceTools
|
|
231
|
+
.map((nestedTool) => sanitizePlanOnlyToolEntry(nestedTool, mode, onRemoved))
|
|
232
|
+
.filter((nestedTool) => nestedTool !== null);
|
|
233
|
+
const changed = nestedTools.length !== namespaceTools.length ||
|
|
234
|
+
nestedTools.some((nestedTool, index) => nestedTool !== namespaceTools[index]);
|
|
235
|
+
if (nestedTools.length === 0) {
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
if (!changed) {
|
|
239
|
+
return entry;
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
...record,
|
|
243
|
+
tools: nestedTools,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
const functionDef = entry.function;
|
|
247
|
+
if (!functionDef || typeof functionDef !== "object") {
|
|
248
|
+
return entry;
|
|
249
|
+
}
|
|
250
|
+
const name = functionDef.name;
|
|
251
|
+
if (typeof name !== "string" || !PLAN_MODE_ONLY_TOOLS.has(name)) {
|
|
252
|
+
return entry;
|
|
253
|
+
}
|
|
254
|
+
onRemoved();
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
const COMPUTER_TOOL_TYPES = new Set(["computer", "computer_use_preview"]);
|
|
258
|
+
function sanitizeModelIncompatibleTools(tools, model) {
|
|
259
|
+
if (!Array.isArray(tools))
|
|
260
|
+
return tools;
|
|
261
|
+
const capabilities = getModelCapabilities(model);
|
|
262
|
+
const removed = {
|
|
263
|
+
toolSearch: 0,
|
|
264
|
+
computerUse: 0,
|
|
265
|
+
};
|
|
266
|
+
const filtered = tools
|
|
267
|
+
.map((tool) => sanitizeModelIncompatibleToolEntry(tool, capabilities, removed))
|
|
268
|
+
.filter((tool) => tool !== null);
|
|
269
|
+
if (removed.toolSearch > 0) {
|
|
270
|
+
logWarn(`Removed ${removed.toolSearch} tool_search definition(s) because ${model ?? "the selected model"} does not support tool search`);
|
|
271
|
+
}
|
|
272
|
+
if (removed.computerUse > 0) {
|
|
273
|
+
logWarn(`Removed ${removed.computerUse} computer tool definition(s) because ${model ?? "the selected model"} does not support computer use`);
|
|
274
|
+
}
|
|
275
|
+
return filtered;
|
|
276
|
+
}
|
|
277
|
+
function sanitizeModelIncompatibleToolEntry(tool, capabilities, removed) {
|
|
278
|
+
if (!tool || typeof tool !== "object") {
|
|
279
|
+
return tool;
|
|
280
|
+
}
|
|
281
|
+
const record = tool;
|
|
282
|
+
const type = typeof record.type === "string" ? record.type : "";
|
|
283
|
+
if (type === "tool_search" && !capabilities.toolSearch) {
|
|
284
|
+
removed.toolSearch += 1;
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
if (COMPUTER_TOOL_TYPES.has(type) && !capabilities.computerUse) {
|
|
288
|
+
removed.computerUse += 1;
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
if (type === "namespace" && Array.isArray(record.tools)) {
|
|
292
|
+
const namespaceTools = record.tools;
|
|
293
|
+
const nestedTools = namespaceTools
|
|
294
|
+
.map((nestedTool) => sanitizeModelIncompatibleToolEntry(nestedTool, capabilities, removed))
|
|
295
|
+
.filter((nestedTool) => nestedTool !== null);
|
|
296
|
+
const changed = nestedTools.length !== namespaceTools.length ||
|
|
297
|
+
nestedTools.some((nestedTool, index) => nestedTool !== namespaceTools[index]);
|
|
298
|
+
if (nestedTools.length === 0) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
if (!changed) {
|
|
302
|
+
return tool;
|
|
303
|
+
}
|
|
304
|
+
return {
|
|
305
|
+
...record,
|
|
306
|
+
tools: nestedTools,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
return tool;
|
|
310
|
+
}
|
|
285
311
|
/**
|
|
286
312
|
* Configure reasoning parameters based on model variant and user config
|
|
287
313
|
*
|
|
@@ -295,96 +321,46 @@ function sanitizePlanOnlyTools(tools, mode) {
|
|
|
295
321
|
* @returns Reasoning configuration
|
|
296
322
|
*/
|
|
297
323
|
export function getReasoningConfig(modelName, userConfig = {}) {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
// Legacy GPT-5.3 Codex alias behavior (supports xhigh, but not "none")
|
|
303
|
-
const isGpt53Codex = normalizedName.includes("gpt-5.3-codex") ||
|
|
304
|
-
normalizedName.includes("gpt 5.3 codex");
|
|
305
|
-
// Legacy GPT-5.2 Codex alias behavior (supports xhigh, but not "none")
|
|
306
|
-
const isGpt52Codex = normalizedName.includes("gpt-5.2-codex") ||
|
|
307
|
-
normalizedName.includes("gpt 5.2 codex");
|
|
308
|
-
// GPT-5.2 general purpose (not codex variant)
|
|
309
|
-
const isGpt52General = (normalizedName.includes("gpt-5.2") || normalizedName.includes("gpt 5.2")) &&
|
|
310
|
-
!isGpt52Codex;
|
|
311
|
-
const isCodexMax = normalizedName.includes("codex-max") ||
|
|
312
|
-
normalizedName.includes("codex max");
|
|
313
|
-
const isCodexMini = normalizedName.includes("codex-mini") ||
|
|
314
|
-
normalizedName.includes("codex mini") ||
|
|
315
|
-
normalizedName.includes("codex_mini") ||
|
|
316
|
-
normalizedName.includes("codex-mini-latest");
|
|
317
|
-
const isCodex = normalizedName.includes("codex") && !isCodexMini;
|
|
318
|
-
const isLightweight = !isCodexMini &&
|
|
319
|
-
(normalizedName.includes("nano") ||
|
|
320
|
-
normalizedName.includes("mini"));
|
|
321
|
-
// GPT-5.1 general purpose (not codex variants) - supports "none" per OpenAI API docs
|
|
322
|
-
const isGpt51General = (normalizedName.includes("gpt-5.1") ||
|
|
323
|
-
normalizedName.includes("gpt 5.1") ||
|
|
324
|
-
normalizedName === "gpt-5" ||
|
|
325
|
-
normalizedName.startsWith("gpt-5-")) &&
|
|
326
|
-
!isCodex &&
|
|
327
|
-
!isGpt52General &&
|
|
328
|
-
!isCodexMax &&
|
|
329
|
-
!isCodexMini;
|
|
330
|
-
// GPT-5.2 general, legacy GPT-5.2/5.3 Codex aliases, and Codex Max support xhigh reasoning
|
|
331
|
-
const supportsXhigh = isGpt52General || isGpt53Codex || isGpt52Codex || isCodexMax;
|
|
332
|
-
// GPT 5.1 general and GPT 5.2 general support "none" reasoning per:
|
|
333
|
-
// - OpenAI API docs: "gpt-5.1 defaults to none, supports: none, low, medium, high"
|
|
334
|
-
// - Codex CLI: ReasoningEffort enum includes None variant (codex-rs/protocol/src/openai_models.rs)
|
|
335
|
-
// - Codex CLI: docs/config.md lists "none" as valid for model_reasoning_effort
|
|
336
|
-
// - gpt-5.2 (being newer) also supports: none, low, medium, high, xhigh
|
|
337
|
-
// - Codex models (including GPT-5 Codex and legacy GPT-5.3/5.2 Codex aliases) do NOT support "none"
|
|
338
|
-
const supportsNone = isGpt52General || isGpt51General;
|
|
339
|
-
// Default based on model type (Codex CLI defaults + plugin opinionated tuning)
|
|
340
|
-
// Note: OpenAI docs say gpt-5.1 defaults to "none", but we default to "medium"
|
|
341
|
-
// for better coding assistance unless user explicitly requests "none".
|
|
342
|
-
// - Canonical GPT-5 Codex defaults to high in stable Codex.
|
|
343
|
-
// - Legacy GPT-5.3/5.2 Codex aliases default to xhigh for backward compatibility.
|
|
344
|
-
const defaultEffort = isCodexMini
|
|
345
|
-
? "medium"
|
|
346
|
-
: isGpt5Codex
|
|
347
|
-
? "high"
|
|
348
|
-
: isGpt53Codex || isGpt52Codex
|
|
349
|
-
? "xhigh"
|
|
350
|
-
: supportsXhigh
|
|
351
|
-
? "high"
|
|
352
|
-
: isLightweight
|
|
353
|
-
? "minimal"
|
|
354
|
-
: "medium";
|
|
355
|
-
// Get user-requested effort
|
|
356
|
-
let effort = userConfig.reasoningEffort || defaultEffort;
|
|
357
|
-
if (isCodexMini) {
|
|
358
|
-
if (effort === "minimal" || effort === "low" || effort === "none") {
|
|
359
|
-
effort = "medium";
|
|
360
|
-
}
|
|
361
|
-
if (effort === "xhigh") {
|
|
362
|
-
effort = "high";
|
|
363
|
-
}
|
|
364
|
-
if (effort !== "high" && effort !== "medium") {
|
|
365
|
-
effort = "medium";
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
// For models that don't support xhigh, downgrade to high
|
|
369
|
-
if (!supportsXhigh && effort === "xhigh") {
|
|
370
|
-
effort = "high";
|
|
371
|
-
}
|
|
372
|
-
// For models that don't support "none", upgrade to "low"
|
|
373
|
-
// (Codex models don't support "none" - only GPT-5.1 and GPT-5.2 general purpose do)
|
|
374
|
-
if (!supportsNone && effort === "none") {
|
|
375
|
-
effort = "low";
|
|
376
|
-
}
|
|
377
|
-
// Normalize "minimal" to "low" for Codex families
|
|
378
|
-
// Codex CLI presets are low/medium/high (or xhigh for Codex Max / GPT-5.3/5.2 Codex)
|
|
379
|
-
if (isCodex && effort === "minimal") {
|
|
380
|
-
effort = "low";
|
|
381
|
-
}
|
|
324
|
+
const profile = getModelProfile(modelName);
|
|
325
|
+
const defaultEffort = profile.defaultReasoningEffort;
|
|
326
|
+
const requestedEffort = userConfig.reasoningEffort ?? defaultEffort;
|
|
327
|
+
const effort = coerceReasoningEffort(profile.normalizedModel, requestedEffort, profile.supportedReasoningEfforts, defaultEffort);
|
|
382
328
|
const summary = sanitizeReasoningSummary(userConfig.reasoningSummary);
|
|
383
329
|
return {
|
|
384
330
|
effort,
|
|
385
331
|
summary,
|
|
386
332
|
};
|
|
387
333
|
}
|
|
334
|
+
const REASONING_FALLBACKS = {
|
|
335
|
+
none: ["none", "low", "minimal", "medium", "high", "xhigh"],
|
|
336
|
+
minimal: ["minimal", "low", "none", "medium", "high", "xhigh"],
|
|
337
|
+
low: ["low", "minimal", "none", "medium", "high", "xhigh"],
|
|
338
|
+
medium: ["medium", "low", "high", "minimal", "none", "xhigh"],
|
|
339
|
+
high: ["high", "medium", "xhigh", "low", "minimal", "none"],
|
|
340
|
+
xhigh: ["xhigh", "high", "medium", "low", "minimal", "none"],
|
|
341
|
+
};
|
|
342
|
+
function coerceReasoningEffort(modelName, effort, supportedEfforts, defaultEffort) {
|
|
343
|
+
if (supportedEfforts.includes(effort)) {
|
|
344
|
+
return effort;
|
|
345
|
+
}
|
|
346
|
+
const fallbackOrder = REASONING_FALLBACKS[effort] ?? [defaultEffort];
|
|
347
|
+
for (const candidate of fallbackOrder) {
|
|
348
|
+
if (supportedEfforts.includes(candidate)) {
|
|
349
|
+
logWarn("Coercing unsupported reasoning effort for model", {
|
|
350
|
+
model: modelName,
|
|
351
|
+
requestedEffort: effort,
|
|
352
|
+
effectiveEffort: candidate,
|
|
353
|
+
});
|
|
354
|
+
return candidate;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
logWarn("Falling back to default reasoning effort for model", {
|
|
358
|
+
model: modelName,
|
|
359
|
+
requestedEffort: effort,
|
|
360
|
+
effectiveEffort: defaultEffort,
|
|
361
|
+
});
|
|
362
|
+
return defaultEffort;
|
|
363
|
+
}
|
|
388
364
|
function sanitizeReasoningSummary(summary) {
|
|
389
365
|
if (!summary)
|
|
390
366
|
return "auto";
|
|
@@ -416,9 +392,10 @@ function sanitizeReasoningSummary(summary) {
|
|
|
416
392
|
* @param input - Original input array from host/AI SDK
|
|
417
393
|
* @returns Filtered input array compatible with Codex API
|
|
418
394
|
*/
|
|
419
|
-
export function filterInput(input) {
|
|
395
|
+
export function filterInput(input, options) {
|
|
420
396
|
if (!Array.isArray(input))
|
|
421
397
|
return input;
|
|
398
|
+
const stripIds = options?.stripIds ?? true;
|
|
422
399
|
const filtered = [];
|
|
423
400
|
for (const item of input) {
|
|
424
401
|
if (!item || typeof item !== "object") {
|
|
@@ -429,7 +406,7 @@ export function filterInput(input) {
|
|
|
429
406
|
continue;
|
|
430
407
|
}
|
|
431
408
|
// Strip IDs from all items (Codex API stateless mode).
|
|
432
|
-
if ("id" in item) {
|
|
409
|
+
if (stripIds && "id" in item) {
|
|
433
410
|
const { id: _omit, ...itemWithoutId } = item;
|
|
434
411
|
void _omit;
|
|
435
412
|
filtered.push(itemWithoutId);
|
|
@@ -574,6 +551,24 @@ function isComplexFastSessionRequest(body, maxItems) {
|
|
|
574
551
|
return true;
|
|
575
552
|
return false;
|
|
576
553
|
}
|
|
554
|
+
export function resolveFastSessionInputTrimPlan(body, fastSession, fastSessionStrategy, fastSessionMaxInputItems) {
|
|
555
|
+
const shouldApplyFastSessionTuning = fastSession &&
|
|
556
|
+
(fastSessionStrategy === "always" ||
|
|
557
|
+
!isComplexFastSessionRequest(body, fastSessionMaxInputItems));
|
|
558
|
+
const latestUserText = getLatestUserText(body.input);
|
|
559
|
+
const isTrivialTurn = isTrivialLatestPrompt(latestUserText ?? "");
|
|
560
|
+
const shouldPreferLatestUserOnly = shouldApplyFastSessionTuning && isTrivialTurn;
|
|
561
|
+
return {
|
|
562
|
+
shouldApply: shouldApplyFastSessionTuning,
|
|
563
|
+
isTrivialTurn,
|
|
564
|
+
trim: shouldApplyFastSessionTuning
|
|
565
|
+
? {
|
|
566
|
+
maxItems: fastSessionMaxInputItems,
|
|
567
|
+
preferLatestUserOnly: shouldPreferLatestUserOnly,
|
|
568
|
+
}
|
|
569
|
+
: undefined,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
577
572
|
function getLatestUserText(input) {
|
|
578
573
|
if (!Array.isArray(input))
|
|
579
574
|
return undefined;
|
|
@@ -665,7 +660,7 @@ export function addToolRemapMessage(input, hasTools) {
|
|
|
665
660
|
};
|
|
666
661
|
return [toolRemapMessage, ...input];
|
|
667
662
|
}
|
|
668
|
-
export async function transformRequestBody(bodyOrParams, codexInstructions, userConfig = { global: {}, models: {} }, codexMode = true, fastSession = false, fastSessionStrategy = "hybrid", fastSessionMaxInputItems = 30) {
|
|
663
|
+
export async function transformRequestBody(bodyOrParams, codexInstructions, userConfig = { global: {}, models: {} }, codexMode = true, fastSession = false, fastSessionStrategy = "hybrid", fastSessionMaxInputItems = 30, deferFastSessionInputTrimming = false, allowBackgroundResponses = false) {
|
|
669
664
|
const useNamedParams = typeof codexInstructions === "undefined" &&
|
|
670
665
|
typeof bodyOrParams === "object" &&
|
|
671
666
|
bodyOrParams !== null &&
|
|
@@ -678,6 +673,8 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
678
673
|
let resolvedFastSession;
|
|
679
674
|
let resolvedFastSessionStrategy;
|
|
680
675
|
let resolvedFastSessionMaxInputItems;
|
|
676
|
+
let resolvedDeferFastSessionInputTrimming;
|
|
677
|
+
let resolvedAllowBackgroundResponses;
|
|
681
678
|
if (useNamedParams) {
|
|
682
679
|
const namedParams = bodyOrParams;
|
|
683
680
|
body = namedParams.body;
|
|
@@ -687,6 +684,10 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
687
684
|
resolvedFastSession = namedParams.fastSession ?? false;
|
|
688
685
|
resolvedFastSessionStrategy = namedParams.fastSessionStrategy ?? "hybrid";
|
|
689
686
|
resolvedFastSessionMaxInputItems = namedParams.fastSessionMaxInputItems ?? 30;
|
|
687
|
+
resolvedDeferFastSessionInputTrimming =
|
|
688
|
+
namedParams.deferFastSessionInputTrimming ?? false;
|
|
689
|
+
resolvedAllowBackgroundResponses =
|
|
690
|
+
namedParams.allowBackgroundResponses ?? false;
|
|
690
691
|
}
|
|
691
692
|
else {
|
|
692
693
|
body = bodyOrParams;
|
|
@@ -696,6 +697,8 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
696
697
|
resolvedFastSession = fastSession;
|
|
697
698
|
resolvedFastSessionStrategy = fastSessionStrategy;
|
|
698
699
|
resolvedFastSessionMaxInputItems = fastSessionMaxInputItems;
|
|
700
|
+
resolvedDeferFastSessionInputTrimming = deferFastSessionInputTrimming;
|
|
701
|
+
resolvedAllowBackgroundResponses = allowBackgroundResponses;
|
|
699
702
|
}
|
|
700
703
|
if (!body || typeof body !== "object") {
|
|
701
704
|
throw new TypeError("transformRequestBody requires body");
|
|
@@ -721,17 +724,16 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
721
724
|
const reasoningModel = shouldUseNormalizedReasoningModel
|
|
722
725
|
? normalizedModel
|
|
723
726
|
: lookupModel;
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
const isTrivialTurn = isTrivialLatestPrompt(latestUserText ?? "");
|
|
727
|
+
const backgroundModeRequested = assertBackgroundModeCompatibility(body, resolvedAllowBackgroundResponses);
|
|
728
|
+
const fastSessionInputTrimPlan = resolveFastSessionInputTrimPlan(body, resolvedFastSession, resolvedFastSessionStrategy, resolvedFastSessionMaxInputItems);
|
|
729
|
+
const shouldApplyFastSessionTuning = !backgroundModeRequested && fastSessionInputTrimPlan.shouldApply;
|
|
730
|
+
const isTrivialTurn = fastSessionInputTrimPlan.isTrivialTurn;
|
|
729
731
|
const shouldDisableToolsForTrivialTurn = shouldApplyFastSessionTuning &&
|
|
730
732
|
isTrivialTurn;
|
|
731
|
-
const shouldPreferLatestUserOnly = shouldApplyFastSessionTuning && isTrivialTurn;
|
|
732
733
|
// Codex required fields
|
|
733
|
-
// ChatGPT backend
|
|
734
|
-
|
|
734
|
+
// ChatGPT backend normally requires store=false (confirmed via testing).
|
|
735
|
+
// Background mode is an explicit opt-in compatibility path that preserves stateful storage.
|
|
736
|
+
body.store = backgroundModeRequested ? true : false;
|
|
735
737
|
// Always set stream=true for API - response handling detects original intent
|
|
736
738
|
body.stream = true;
|
|
737
739
|
// Clean up tool definitions (implement strict "require" logic)
|
|
@@ -745,6 +747,10 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
745
747
|
if (body.tools) {
|
|
746
748
|
body.tools = cleanupToolDefinitions(body.tools);
|
|
747
749
|
body.tools = sanitizePlanOnlyTools(body.tools, collaborationMode);
|
|
750
|
+
body.tools = sanitizeModelIncompatibleTools(body.tools, body.model);
|
|
751
|
+
if (Array.isArray(body.tools) && body.tools.length === 0) {
|
|
752
|
+
body.tools = undefined;
|
|
753
|
+
}
|
|
748
754
|
}
|
|
749
755
|
body.instructions = shouldApplyFastSessionTuning
|
|
750
756
|
? compactInstructionsForFastSession(resolvedCodexInstructions, isTrivialTurn)
|
|
@@ -754,10 +760,10 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
754
760
|
// Filter and transform input
|
|
755
761
|
if (body.input && Array.isArray(body.input)) {
|
|
756
762
|
let inputItems = body.input;
|
|
757
|
-
if (shouldApplyFastSessionTuning) {
|
|
763
|
+
if (shouldApplyFastSessionTuning && !resolvedDeferFastSessionInputTrimming) {
|
|
758
764
|
inputItems =
|
|
759
765
|
trimInputForFastSession(inputItems, resolvedFastSessionMaxInputItems, {
|
|
760
|
-
preferLatestUserOnly:
|
|
766
|
+
preferLatestUserOnly: fastSessionInputTrimPlan.trim?.preferLatestUserOnly ?? false,
|
|
761
767
|
}) ?? inputItems;
|
|
762
768
|
}
|
|
763
769
|
// Debug: Log original input message IDs before filtering
|
|
@@ -767,14 +773,16 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
767
773
|
if (originalIds.length > 0) {
|
|
768
774
|
logDebug(`Filtering ${originalIds.length} message IDs from input:`, originalIds);
|
|
769
775
|
}
|
|
770
|
-
inputItems = filterInput(inputItems
|
|
776
|
+
inputItems = filterInput(inputItems, {
|
|
777
|
+
stripIds: !backgroundModeRequested,
|
|
778
|
+
}) ?? inputItems;
|
|
771
779
|
body.input = inputItems;
|
|
772
|
-
// istanbul ignore next -- filterInput always removes IDs; this is defensive debug code
|
|
780
|
+
// istanbul ignore next -- filterInput always removes IDs in stateless mode; this is defensive debug code
|
|
773
781
|
const remainingIds = (body.input || [])
|
|
774
782
|
.filter((item) => item.id)
|
|
775
783
|
.map((item) => item.id);
|
|
776
|
-
// istanbul ignore if -- filterInput always removes IDs;
|
|
777
|
-
if (remainingIds.length > 0) {
|
|
784
|
+
// istanbul ignore if -- filterInput always removes IDs in stateless mode; background mode intentionally preserves them
|
|
785
|
+
if (remainingIds.length > 0 && !backgroundModeRequested) {
|
|
778
786
|
logWarn(`WARNING: ${remainingIds.length} IDs still present after filtering:`, remainingIds);
|
|
779
787
|
}
|
|
780
788
|
else if (originalIds.length > 0) {
|
|
@@ -805,10 +813,15 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
805
813
|
};
|
|
806
814
|
// Configure text verbosity (support user config)
|
|
807
815
|
// Default: "medium" (matches Codex CLI default for all GPT-5 models)
|
|
816
|
+
// Preserve any structured-output `text.format` contract from the host.
|
|
808
817
|
body.text = {
|
|
809
818
|
...body.text,
|
|
810
819
|
verbosity: resolveTextVerbosity(modelConfig, body),
|
|
811
820
|
};
|
|
821
|
+
const promptCacheRetention = resolvePromptCacheRetention(modelConfig, body);
|
|
822
|
+
if (promptCacheRetention !== undefined) {
|
|
823
|
+
body.prompt_cache_retention = promptCacheRetention;
|
|
824
|
+
}
|
|
812
825
|
if (shouldApplyFastSessionTuning) {
|
|
813
826
|
// In fast-session mode, prioritize speed by clamping to minimum reasoning + verbosity.
|
|
814
827
|
// getReasoningConfig normalizes unsupported values per model family.
|
|
@@ -828,7 +841,11 @@ export async function transformRequestBody(bodyOrParams, codexInstructions, user
|
|
|
828
841
|
// Add include for encrypted reasoning content
|
|
829
842
|
// Default: ["reasoning.encrypted_content"] (required for stateless operation with store=false)
|
|
830
843
|
// This allows reasoning context to persist across turns without server-side storage
|
|
831
|
-
body.include =
|
|
844
|
+
body.include = backgroundModeRequested
|
|
845
|
+
? body.include ??
|
|
846
|
+
body.providerOptions?.openai?.include ??
|
|
847
|
+
modelConfig.include
|
|
848
|
+
: resolveInclude(modelConfig, body);
|
|
832
849
|
// Remove unsupported parameters
|
|
833
850
|
body.max_output_tokens = undefined;
|
|
834
851
|
body.max_completion_tokens = undefined;
|