@opengeni/worker-bundle 2.0.1 → 2.0.2-canary.38686408778001
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/activities/agent-run-admission.d.ts +1 -12
- package/dist/activities/agent-turn/admission.d.ts +88 -10
- package/dist/activities/agent-turn/agent-build.d.ts +14 -3
- package/dist/activities/agent-turn/claim.d.ts +4 -1
- package/dist/activities/agent-turn/claude-core.d.ts +195 -0
- package/dist/activities/agent-turn/code-search.d.ts +60 -0
- package/dist/activities/agent-turn/codex-capacity.d.ts +3 -0
- package/dist/activities/agent-turn/codex-core-capacity.d.ts +37 -0
- package/dist/activities/agent-turn/codex-core-claim.d.ts +40 -0
- package/dist/activities/agent-turn/codex-core-errors.d.ts +102 -0
- package/dist/activities/agent-turn/codex-core-failover.d.ts +15 -0
- package/dist/activities/agent-turn/codex-core-requests.d.ts +28 -0
- package/dist/activities/agent-turn/codex-core-settlement.d.ts +77 -0
- package/dist/activities/agent-turn/codex-credit-policy.d.ts +30 -0
- package/dist/activities/agent-turn/codex-plan-entitlement.d.ts +105 -0
- package/dist/activities/agent-turn/codex-usage-policy.d.ts +2 -0
- package/dist/activities/agent-turn/codex.d.ts +2 -19
- package/dist/activities/agent-turn/compaction-interruption.d.ts +32 -0
- package/dist/activities/agent-turn/compaction-prep.d.ts +30 -1
- package/dist/activities/agent-turn/credential-leases.d.ts +64 -37
- package/dist/activities/agent-turn/credential-restriction.d.ts +3 -0
- package/dist/activities/agent-turn/errors.d.ts +172 -28
- package/dist/activities/agent-turn/failure-settlement.d.ts +10 -43
- package/dist/activities/agent-turn/final-reply.d.ts +18 -0
- package/dist/activities/agent-turn/finalization-monitor.d.ts +7 -2
- package/dist/activities/agent-turn/finalization.d.ts +2 -0
- package/dist/activities/agent-turn/github-repository-bindings.d.ts +2 -0
- package/dist/activities/agent-turn/governance-model.d.ts +13 -1
- package/dist/activities/agent-turn/history-sink.d.ts +3 -1
- package/dist/activities/agent-turn/history.d.ts +2 -0
- package/dist/activities/agent-turn/input-wait-reply.d.ts +76 -0
- package/dist/activities/agent-turn/meaningful-output.d.ts +9 -0
- package/dist/activities/agent-turn/media-artifacts.d.ts +5 -3
- package/dist/activities/agent-turn/model-call-admission.d.ts +15 -0
- package/dist/activities/agent-turn/model-usage.d.ts +56 -14
- package/dist/activities/agent-turn/model-wire-dispatch.d.ts +15 -0
- package/dist/activities/agent-turn/optional-repositories.d.ts +59 -0
- package/dist/activities/agent-turn/prompt-tool-availability.d.ts +17 -0
- package/dist/activities/agent-turn/provider-dispatch-barrier.d.ts +12 -1
- package/dist/activities/agent-turn/provider-recovery-copy.d.ts +24 -0
- package/dist/activities/agent-turn/provider-recovery-metrics.d.ts +18 -0
- package/dist/activities/agent-turn/provider-recovery-policy.d.ts +6 -0
- package/dist/activities/agent-turn/quiescence.d.ts +6 -7
- package/dist/activities/agent-turn/recovery-warning.d.ts +6 -5
- package/dist/activities/agent-turn/refresh-credentials.d.ts +6 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +9 -5
- package/dist/activities/agent-turn/run.d.ts +27 -2
- package/dist/activities/agent-turn/sandbox-establish.d.ts +1 -0
- package/dist/activities/agent-turn/sandbox-provision.d.ts +25 -1
- package/dist/activities/agent-turn/sandbox-route.d.ts +3 -0
- package/dist/activities/agent-turn/sandbox-runtime.d.ts +1 -1
- package/dist/activities/agent-turn/secret-resolver.d.ts +64 -0
- package/dist/activities/agent-turn/session-title.d.ts +60 -3
- package/dist/activities/agent-turn/session-usage-custody.d.ts +66 -0
- package/dist/activities/agent-turn/skill-checkout.d.ts +25 -6
- package/dist/activities/agent-turn/skill-read.d.ts +70 -2
- package/dist/activities/agent-turn/skill-search.d.ts +2 -0
- package/dist/activities/agent-turn/skill-tools.d.ts +41 -4
- package/dist/activities/agent-turn/skill-transfer.d.ts +18 -6
- package/dist/activities/agent-turn/stream-attempt.d.ts +6 -3
- package/dist/activities/agent-turn/subscription-capacity-arming.d.ts +41 -0
- package/dist/activities/agent-turn/subscription-core-capacity.d.ts +86 -0
- package/dist/activities/agent-turn/subscription-core-failover.d.ts +69 -0
- package/dist/activities/agent-turn/subscription-core-placed.d.ts +14 -0
- package/dist/activities/agent-turn/subscription-core-requests.d.ts +109 -0
- package/dist/activities/agent-turn/subscription-core-settlement.d.ts +112 -0
- package/dist/activities/agent-turn/subscription-lease.d.ts +44 -0
- package/dist/activities/agent-turn/subscription-serving-capacity.d.ts +6 -0
- package/dist/activities/agent-turn/subscription-serving-catalog.d.ts +13 -0
- package/dist/activities/agent-turn/subscription-serving-claim.d.ts +30 -0
- package/dist/activities/agent-turn/subscription-serving-providers.d.ts +2 -0
- package/dist/activities/agent-turn/tool-environment.d.ts +30 -6
- package/dist/activities/agent-turn/tool-policy.d.ts +55 -3
- package/dist/activities/agent-turn/turn-context.d.ts +104 -5
- package/dist/activities/agent-turn/web-search.d.ts +57 -0
- package/dist/activities/agent-turn/xai-core.d.ts +96 -0
- package/dist/activities/automations.d.ts +3 -1
- package/dist/activities/browser-deadline-checkpoint.d.ts +34 -0
- package/dist/activities/capabilities.d.ts +8 -20
- package/dist/activities/codemode-dispatcher.d.ts +20 -3
- package/dist/activities/codex-capacity.d.ts +1 -56
- package/dist/activities/codex-image-generation.d.ts +49 -3
- package/dist/activities/common.d.ts +3 -1
- package/dist/activities/context-compaction.d.ts +41 -2
- package/dist/activities/environment.d.ts +1 -19
- package/dist/activities/gmail-files.d.ts +50 -0
- package/dist/activities/goals.d.ts +1 -9
- package/dist/activities/incident-telemetry-authority.d.ts +5 -2
- package/dist/activities/incident-telemetry-preflight.d.ts +10 -3
- package/dist/activities/knowledge-indexing.d.ts +19 -0
- package/dist/activities/mcp-account-routes.d.ts +2 -21
- package/dist/activities/model-call-fact-reconciler.d.ts +34 -0
- package/dist/activities/open-suffix-resume.d.ts +15 -0
- package/dist/activities/parent-wake.d.ts +17 -12
- package/dist/activities/programmatic-approvals.d.ts +10 -0
- package/dist/activities/requester-unavailable-receipt.d.ts +8 -0
- package/dist/activities/retained-screenshots.d.ts +7 -2
- package/dist/activities/run-credential-renewal.d.ts +1 -0
- package/dist/activities/run-credentials.d.ts +16 -4
- package/dist/activities/run-input.d.ts +17 -0
- package/dist/activities/sandbox-lease.d.ts +132 -12
- package/dist/activities/scheduled-tasks.d.ts +4 -35
- package/dist/activities/session-archive.d.ts +58 -0
- package/dist/activities/session-state.d.ts +15 -3
- package/dist/activities/session-storage.d.ts +44 -0
- package/dist/activities/subscription-core-claude-waits.d.ts +2 -0
- package/dist/activities/subscription-core-codex-quota.d.ts +25 -0
- package/dist/activities/subscription-core-codex-waits.d.ts +153 -0
- package/dist/activities/subscription-core-image-operation.d.ts +29 -0
- package/dist/activities/subscription-core-usage-recheck.d.ts +49 -0
- package/dist/activities/subscription-core-wait-bindings.d.ts +3 -0
- package/dist/activities/subscription-core-xai-quota.d.ts +30 -0
- package/dist/activities/subscription-core-xai-waits.d.ts +2 -0
- package/dist/activities/types.d.ts +68 -5
- package/dist/activities/video-generation-admission.d.ts +2 -8
- package/dist/activities/video-generation-credential.d.ts +15 -12
- package/dist/activities/video-generation-subscription-core.d.ts +70 -0
- package/dist/activities/workspace-capture.d.ts +2 -0
- package/dist/activities/workspace-credential-provider.d.ts +47 -0
- package/dist/activities/xai-auth.d.ts +6 -18
- package/dist/activities/xai-image-generation.d.ts +22 -6
- package/dist/{activities-control-QA6OLRQY.js → activities-control-NTXZHYET.js} +1552 -2876
- package/dist/activities-control-NTXZHYET.js.map +1 -0
- package/dist/activities-control.d.ts +64 -4
- package/dist/{activities-turn-YVVKCGAK.js → activities-turn-RKRI5GY4.js} +9238 -4392
- package/dist/activities-turn-RKRI5GY4.js.map +1 -0
- package/dist/activities.d.ts +64 -4
- package/dist/artifact-materializer-entry.js +104 -35
- package/dist/artifact-materializer-entry.js.map +1 -1
- package/dist/artifact-outbox-entry.js +132 -61
- package/dist/artifact-outbox-entry.js.map +1 -1
- package/dist/browser-deadline-checkpoint-contract.d.ts +2 -0
- package/dist/{chunk-GDCLDKSH.js → chunk-24GP3BX5.js} +79 -72
- package/dist/chunk-24GP3BX5.js.map +1 -0
- package/dist/{chunk-RAMNYSAW.js → chunk-4ER3YXOT.js} +22 -4
- package/dist/chunk-4ER3YXOT.js.map +1 -0
- package/dist/{chunk-I7HKKMUJ.js → chunk-5NNS4327.js} +734 -58
- package/dist/chunk-5NNS4327.js.map +1 -0
- package/dist/{chunk-M3NVMF2V.js → chunk-7BIHFUGB.js} +2293 -3956
- package/dist/chunk-7BIHFUGB.js.map +1 -0
- package/dist/chunk-MVESOYFC.js +3746 -0
- package/dist/chunk-MVESOYFC.js.map +1 -0
- package/dist/chunk-NQDVJ6RI.js +2823 -0
- package/dist/chunk-NQDVJ6RI.js.map +1 -0
- package/dist/chunk-O7UPBWXK.js +79 -0
- package/dist/chunk-O7UPBWXK.js.map +1 -0
- package/dist/chunk-W2QSM5HR.js +414 -0
- package/dist/chunk-W2QSM5HR.js.map +1 -0
- package/dist/chunk-ZN3XJR33.js +227 -0
- package/dist/chunk-ZN3XJR33.js.map +1 -0
- package/dist/editable-artifact-outbox-dispatcher.d.ts +12 -1
- package/dist/editable-artifact-outbox-service.d.ts +3 -1
- package/dist/host-export-pump.d.ts +3 -1
- package/dist/host-export.d.ts +2 -2
- package/dist/host-export.js +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +49 -48
- package/dist/index.js +835 -256
- package/dist/index.js.map +1 -1
- package/dist/internal-maintenance.d.ts +63 -0
- package/dist/maintenance-cadence.d.ts +43 -0
- package/dist/observability-metrics.d.ts +293 -24
- package/dist/onepassword-vault-provider.d.ts +7 -0
- package/dist/parent-wake-PCLH7A3Y.js +24 -0
- package/dist/parent-wake-PCLH7A3Y.js.map +1 -0
- package/dist/personal-github-git-credentials.d.ts +1 -1
- package/dist/readiness-checks.d.ts +39 -0
- package/dist/retained-process-retry.d.ts +7 -0
- package/dist/sandbox-lease-BJYU72N3.js +84 -0
- package/dist/sandbox-lease-BJYU72N3.js.map +1 -0
- package/dist/sandbox-reaper-contract.d.ts +25 -0
- package/dist/sandbox-resume.d.ts +72 -4
- package/dist/sandbox-routing.d.ts +4 -2
- package/dist/session-event-fanout.d.ts +6 -0
- package/dist/site-auth-maintenance-WK3MR2PV.js +12 -0
- package/dist/site-auth-maintenance-WK3MR2PV.js.map +1 -0
- package/dist/telemetry-scheduler.d.ts +14 -0
- package/dist/temporal-runtime-logger.d.ts +22 -0
- package/dist/turn-task-queue-reader.d.ts +18 -0
- package/dist/turn-worker-activity-telemetry.d.ts +47 -0
- package/dist/worker-service-lifecycle.d.ts +12 -0
- package/dist/workflow-bundle.js +468 -71
- package/dist/workflows/activities.d.ts +1 -1
- package/dist/workflows/browser-deadline-checkpoint.d.ts +10 -0
- package/dist/workflows/sandbox-reaper.d.ts +10 -1
- package/dist/workflows/scheduled-tasks.d.ts +4 -0
- package/dist/workflows/session-storage.d.ts +2 -0
- package/dist/workflows/session.d.ts +36 -0
- package/dist/workflows/site-auth-maintenance.d.ts +2 -1
- package/dist/workflows/workflow-wake.d.ts +14 -3
- package/dist/workflows.d.ts +3 -1
- package/package.json +26 -20
- package/src/activities/agent-run-admission.ts +1 -82
- package/src/activities/agent-turn/admission.ts +175 -24
- package/src/activities/agent-turn/agent-build.ts +226 -145
- package/src/activities/agent-turn/claim.ts +363 -64
- package/src/activities/agent-turn/claude-core.ts +587 -0
- package/src/activities/agent-turn/code-search.ts +275 -0
- package/src/activities/agent-turn/codex-capacity.ts +30 -757
- package/src/activities/agent-turn/codex-core-capacity.ts +190 -0
- package/src/activities/agent-turn/codex-core-claim.ts +83 -0
- package/src/activities/agent-turn/codex-core-errors.ts +308 -0
- package/src/activities/agent-turn/codex-core-failover.ts +73 -0
- package/src/activities/agent-turn/codex-core-requests.ts +86 -0
- package/src/activities/agent-turn/codex-core-settlement.ts +263 -0
- package/src/activities/agent-turn/codex-credit-policy.ts +247 -0
- package/src/activities/agent-turn/codex-plan-entitlement.ts +254 -0
- package/src/activities/agent-turn/codex-usage-policy.ts +2 -0
- package/src/activities/agent-turn/codex.ts +8 -76
- package/src/activities/agent-turn/compaction-interruption.ts +56 -0
- package/src/activities/agent-turn/compaction-prep.ts +249 -36
- package/src/activities/agent-turn/credential-leases.ts +269 -214
- package/src/activities/agent-turn/credential-restriction.ts +14 -0
- package/src/activities/agent-turn/errors.ts +1134 -82
- package/src/activities/agent-turn/failure-settlement.ts +879 -886
- package/src/activities/agent-turn/final-reply.ts +46 -0
- package/src/activities/agent-turn/finalization-monitor.ts +17 -5
- package/src/activities/agent-turn/finalization.ts +107 -88
- package/src/activities/agent-turn/github-repository-bindings.ts +3 -1
- package/src/activities/agent-turn/governance-model.ts +90 -22
- package/src/activities/agent-turn/history-sink.ts +26 -4
- package/src/activities/agent-turn/history.ts +25 -5
- package/src/activities/agent-turn/input-wait-reply.ts +139 -0
- package/src/activities/agent-turn/knowledge-source-tools.ts +2 -0
- package/src/activities/agent-turn/meaningful-output.ts +44 -0
- package/src/activities/agent-turn/media-artifacts.ts +3 -1
- package/src/activities/agent-turn/model-call-admission.ts +94 -0
- package/src/activities/agent-turn/model-usage.ts +299 -233
- package/src/activities/agent-turn/model-wire-dispatch.ts +27 -0
- package/src/activities/agent-turn/optional-repositories.ts +224 -0
- package/src/activities/agent-turn/prompt-tool-availability.ts +27 -0
- package/src/activities/agent-turn/provider-dispatch-barrier.ts +22 -0
- package/src/activities/agent-turn/provider-recovery-copy.ts +76 -0
- package/src/activities/agent-turn/provider-recovery-metrics.ts +64 -0
- package/src/activities/agent-turn/provider-recovery-policy.ts +25 -0
- package/src/activities/agent-turn/quiescence.ts +7 -7
- package/src/activities/agent-turn/recovery-warning.ts +6 -8
- package/src/activities/agent-turn/refresh-credentials.ts +44 -0
- package/src/activities/agent-turn/run-credentials.ts +124 -76
- package/src/activities/agent-turn/run.ts +501 -112
- package/src/activities/agent-turn/sandbox-establish.ts +152 -75
- package/src/activities/agent-turn/sandbox-provision.ts +54 -1
- package/src/activities/agent-turn/sandbox-route.ts +4 -1
- package/src/activities/agent-turn/sandbox-runtime.ts +319 -11
- package/src/activities/agent-turn/secret-resolver.ts +155 -0
- package/src/activities/agent-turn/session-title.ts +177 -12
- package/src/activities/agent-turn/session-usage-custody.ts +170 -0
- package/src/activities/agent-turn/skill-checkout.ts +111 -24
- package/src/activities/agent-turn/skill-install.ts +1 -1
- package/src/activities/agent-turn/skill-read.ts +374 -28
- package/src/activities/agent-turn/skill-save.ts +35 -7
- package/src/activities/agent-turn/skill-search.ts +9 -0
- package/src/activities/agent-turn/skill-selection.ts +4 -0
- package/src/activities/agent-turn/skill-tools.ts +208 -21
- package/src/activities/agent-turn/skill-transfer.ts +68 -23
- package/src/activities/agent-turn/stream-attempt.ts +599 -110
- package/src/activities/agent-turn/subscription-capacity-arming.ts +81 -0
- package/src/activities/agent-turn/subscription-core-capacity.ts +439 -0
- package/src/activities/agent-turn/subscription-core-failover.ts +229 -0
- package/src/activities/agent-turn/subscription-core-placed.ts +37 -0
- package/src/activities/agent-turn/subscription-core-requests.ts +271 -0
- package/src/activities/agent-turn/subscription-core-settlement.ts +234 -0
- package/src/activities/agent-turn/subscription-lease.ts +140 -0
- package/src/activities/agent-turn/subscription-serving-capacity.ts +195 -0
- package/src/activities/agent-turn/subscription-serving-catalog.ts +71 -0
- package/src/activities/agent-turn/subscription-serving-claim.ts +178 -0
- package/src/activities/agent-turn/subscription-serving-providers.ts +15 -0
- package/src/activities/agent-turn/tool-environment.ts +384 -292
- package/src/activities/agent-turn/tool-policy.ts +104 -4
- package/src/activities/agent-turn/tool-result-spill.ts +1 -0
- package/src/activities/agent-turn/turn-context.ts +124 -8
- package/src/activities/agent-turn/web-search.ts +431 -0
- package/src/activities/agent-turn/xai-core.ts +301 -0
- package/src/activities/automations.ts +81 -6
- package/src/activities/browser-deadline-checkpoint.ts +297 -0
- package/src/activities/capabilities.ts +53 -213
- package/src/activities/codemode-dispatcher.ts +236 -14
- package/src/activities/codex-capacity.ts +27 -380
- package/src/activities/codex-image-generation.ts +252 -42
- package/src/activities/common.ts +12 -0
- package/src/activities/connector-attachments.ts +3 -1
- package/src/activities/context-compaction.ts +162 -21
- package/src/activities/environment.ts +18 -106
- package/src/activities/gmail-files.ts +108 -0
- package/src/activities/goals.ts +120 -204
- package/src/activities/image-generation-operation.ts +1 -1
- package/src/activities/incident-telemetry-authority.ts +80 -50
- package/src/activities/incident-telemetry-preflight.ts +27 -15
- package/src/activities/knowledge-indexing.ts +287 -17
- package/src/activities/knowledge-source-sync.ts +10 -0
- package/src/activities/mcp-account-routes.ts +2 -124
- package/src/activities/model-call-fact-reconciler.ts +112 -0
- package/src/activities/open-suffix-resume.ts +122 -88
- package/src/activities/parent-wake.ts +89 -21
- package/src/activities/programmatic-approvals.ts +26 -0
- package/src/activities/requester-unavailable-receipt.ts +14 -0
- package/src/activities/retained-screenshots.ts +135 -24
- package/src/activities/run-credential-renewal.ts +13 -1
- package/src/activities/run-credentials.ts +61 -19
- package/src/activities/run-input.ts +116 -9
- package/src/activities/sandbox-lease.ts +1615 -73
- package/src/activities/scheduled-tasks.ts +758 -141
- package/src/activities/session-archive.ts +382 -0
- package/src/activities/session-state.ts +219 -10
- package/src/activities/session-storage.ts +124 -0
- package/src/activities/site-auth-maintenance.ts +5 -2
- package/src/activities/subscription-core-claude-waits.ts +49 -0
- package/src/activities/subscription-core-codex-quota.ts +46 -0
- package/src/activities/subscription-core-codex-waits.ts +488 -0
- package/src/activities/subscription-core-image-operation.ts +126 -0
- package/src/activities/subscription-core-usage-recheck.ts +146 -0
- package/src/activities/subscription-core-wait-bindings.ts +12 -0
- package/src/activities/subscription-core-xai-quota.ts +85 -0
- package/src/activities/subscription-core-xai-waits.ts +48 -0
- package/src/activities/types.ts +85 -9
- package/src/activities/video-generation-admission.ts +1 -36
- package/src/activities/video-generation-credential.ts +38 -56
- package/src/activities/video-generation-reconciliation.ts +150 -131
- package/src/activities/video-generation-subscription-core.ts +180 -0
- package/src/activities/workspace-capture.ts +13 -2
- package/src/activities/workspace-credential-provider.ts +302 -0
- package/src/activities/xai-auth.ts +34 -112
- package/src/activities/xai-image-generation.ts +84 -36
- package/src/activities-control.ts +8 -0
- package/src/activities-turn.ts +5 -0
- package/src/activities.ts +17 -0
- package/src/activity-services.ts +29 -4
- package/src/browser-deadline-checkpoint-contract.ts +5 -0
- package/src/editable-artifact-hint-broker.ts +3 -0
- package/src/editable-artifact-materializer-service.ts +79 -38
- package/src/editable-artifact-materializer-subprocess.ts +47 -2
- package/src/editable-artifact-outbox-dispatcher.ts +107 -46
- package/src/editable-artifact-outbox-service.ts +55 -25
- package/src/github-rest-mcp.ts +1 -1
- package/src/host-export-pump.ts +26 -4
- package/src/host-export.ts +4 -1
- package/src/http.ts +4 -2
- package/src/index.ts +222 -282
- package/src/internal-maintenance.ts +347 -0
- package/src/maintenance-cadence.ts +156 -0
- package/src/observability-metrics.ts +1173 -73
- package/src/onepassword-vault-provider.ts +11 -0
- package/src/personal-github-git-credentials.ts +3 -1
- package/src/pr-review-credentials.ts +1 -1
- package/src/readiness-checks.ts +113 -0
- package/src/retained-process-retry.ts +36 -0
- package/src/sandbox-reaper-contract.ts +33 -0
- package/src/sandbox-resume.ts +444 -73
- package/src/sandbox-routing.ts +230 -75
- package/src/session-event-fanout.ts +23 -0
- package/src/telemetry-scheduler.ts +53 -0
- package/src/temporal-runtime-logger.ts +44 -0
- package/src/turn-task-queue-reader.ts +110 -0
- package/src/turn-worker-activity-telemetry.ts +209 -0
- package/src/worker-service-lifecycle.ts +54 -1
- package/src/workflows/activities.ts +16 -1
- package/src/workflows/browser-deadline-checkpoint.ts +55 -0
- package/src/workflows/file-upload-reaper.ts +2 -0
- package/src/workflows/sandbox-reaper.ts +88 -0
- package/src/workflows/scheduled-tasks.ts +26 -13
- package/src/workflows/session-storage.ts +19 -0
- package/src/workflows/session.ts +238 -33
- package/src/workflows/site-auth-maintenance.ts +2 -1
- package/src/workflows/workflow-wake.ts +26 -4
- package/src/workflows.ts +7 -0
- package/dist/activities/agent-turn/xai-capacity.d.ts +0 -2
- package/dist/activities/codex-fleet-shadow.d.ts +0 -74
- package/dist/activities/codex-rotation.d.ts +0 -200
- package/dist/activities/xai-quota.d.ts +0 -3
- package/dist/activities-control-QA6OLRQY.js.map +0 -1
- package/dist/activities-turn-YVVKCGAK.js.map +0 -1
- package/dist/chunk-GDCLDKSH.js.map +0 -1
- package/dist/chunk-I7HKKMUJ.js.map +0 -1
- package/dist/chunk-M3NVMF2V.js.map +0 -1
- package/dist/chunk-RAMNYSAW.js.map +0 -1
- package/src/activities/agent-turn/xai-capacity.ts +0 -257
- package/src/activities/codex-fleet-shadow.ts +0 -306
- package/src/activities/codex-rotation.ts +0 -685
- package/src/activities/xai-quota.ts +0 -35
|
@@ -2,8 +2,11 @@ import {
|
|
|
2
2
|
desktopCapableBackend,
|
|
3
3
|
type ComputerToolMode,
|
|
4
4
|
type LazyToolTransport,
|
|
5
|
+
type OpenGeniRuntime,
|
|
5
6
|
} from "@opengeni/runtime";
|
|
7
|
+
import type { TurnExecutionPolicyV1 } from "@opengeni/contracts";
|
|
6
8
|
import {
|
|
9
|
+
configuredModelForAcceptedTurnExecutionPolicy,
|
|
7
10
|
isDirectOpenAiApiBaseUrl,
|
|
8
11
|
type ModelProviderApi,
|
|
9
12
|
type ResolvedModelProvider,
|
|
@@ -84,10 +87,86 @@ export function structuredToolTransportForTurn(
|
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
90
|
+
* `text.verbosity: "low"` is the Codex CLI default for its GPT-5-family models
|
|
91
|
+
* and keeps final answers short. Send it only where the wire is known to accept
|
|
92
|
+
* it: the ChatGPT/Codex subscription backend, direct OpenAI Responses, and the
|
|
93
|
+
* Azure OpenAI Responses wire, where the parallel session-title request already
|
|
94
|
+
* sends the same field with the turn's model. Gateways, xAI, other
|
|
95
|
+
* OpenAI-compatible endpoints and chat wires keep their provider default. The
|
|
96
|
+
* result depends only on the route and model, so a session sends the same value
|
|
97
|
+
* on every request until its model changes, and a model change already starts a
|
|
98
|
+
* new prompt-cache prefix.
|
|
99
|
+
*/
|
|
100
|
+
export function textVerbosityForTurn(
|
|
101
|
+
resolvedModel: {
|
|
102
|
+
provider: {
|
|
103
|
+
id: string;
|
|
104
|
+
kind: ResolvedModelProvider["kind"];
|
|
105
|
+
api: ModelProviderApi;
|
|
106
|
+
wireProfile: "openai" | "azure-openai";
|
|
107
|
+
builtin: boolean;
|
|
108
|
+
baseUrl?: string | undefined;
|
|
109
|
+
};
|
|
110
|
+
} | null,
|
|
111
|
+
upstreamModelId: string,
|
|
112
|
+
): "low" | undefined {
|
|
113
|
+
if (resolvedModel?.provider.api !== "responses") return undefined;
|
|
114
|
+
const provider = resolvedModel.provider;
|
|
115
|
+
const acceptsVerbosity =
|
|
116
|
+
provider.kind === "codex-subscription" ||
|
|
117
|
+
provider.wireProfile === "azure-openai" ||
|
|
118
|
+
(provider.builtin && provider.id === "openai" && isDirectOpenAiApiBaseUrl(provider.baseUrl));
|
|
119
|
+
return acceptsVerbosity && modelAcceptsTextVerbosity(upstreamModelId) ? "low" : undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// GPT-5 and later accept low/medium/high. Earlier models and the -codex and
|
|
123
|
+
// -chat variants accept only the default, so a non-default value is rejected.
|
|
124
|
+
function modelAcceptsTextVerbosity(upstreamModelId: string): boolean {
|
|
125
|
+
return (
|
|
126
|
+
/^gpt-(?:[5-9]|[1-9]\d)(?:[.-]|$)/.test(upstreamModelId) &&
|
|
127
|
+
!/-(?:codex|chat)(?:-|$)/.test(upstreamModelId)
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Ask supported reasoning Responses routes for their provider-selected summary
|
|
133
|
+
* format. This is public summary text, never private or encrypted reasoning.
|
|
134
|
+
* Codex and unverified compatible wires retain the existing detailed setting.
|
|
135
|
+
*/
|
|
136
|
+
export function reasoningSummaryForTurn(
|
|
137
|
+
resolvedModel: {
|
|
138
|
+
provider: {
|
|
139
|
+
id: string;
|
|
140
|
+
api: ModelProviderApi;
|
|
141
|
+
wireProfile: "openai" | "azure-openai";
|
|
142
|
+
builtin: boolean;
|
|
143
|
+
baseUrl?: string | undefined;
|
|
144
|
+
};
|
|
145
|
+
configured: {
|
|
146
|
+
upstreamModelId: string;
|
|
147
|
+
capabilities: { reasoning: { runnable: boolean } };
|
|
148
|
+
};
|
|
149
|
+
} | null,
|
|
150
|
+
): "auto" | undefined {
|
|
151
|
+
if (
|
|
152
|
+
resolvedModel?.provider.api !== "responses" ||
|
|
153
|
+
!resolvedModel.configured.capabilities.reasoning.runnable ||
|
|
154
|
+
!modelAcceptsTextVerbosity(resolvedModel.configured.upstreamModelId)
|
|
155
|
+
) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
const provider = resolvedModel.provider;
|
|
159
|
+
return provider.wireProfile === "azure-openai" ||
|
|
160
|
+
(provider.builtin && provider.id === "openai" && isDirectOpenAiApiBaseUrl(provider.baseUrl))
|
|
161
|
+
? "auto"
|
|
162
|
+
: undefined;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Progressive tool disclosure is universal for supported Opengeni turns; only
|
|
88
167
|
* its contained transport differs. Codex keeps its native path, built-in direct
|
|
89
168
|
* OpenAI/Azure Responses use native client tool search, and every other ordinary
|
|
90
|
-
* function-calling provider uses
|
|
169
|
+
* function-calling provider uses Opengeni's stable search/invoke dispatcher.
|
|
91
170
|
*/
|
|
92
171
|
export function lazyToolTransportForTurn(
|
|
93
172
|
resolvedModel: {
|
|
@@ -132,6 +211,28 @@ export function shouldDeferNonEagerToolPreparation(args: {
|
|
|
132
211
|
);
|
|
133
212
|
}
|
|
134
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Resolve the provider routing/gating shape for an accepted turn. The current
|
|
216
|
+
* definition is projected back onto the verified frozen policy: a turn
|
|
217
|
+
* accepted before hosted web search was enabled keeps its frozen tool set on
|
|
218
|
+
* every recovery attempt (stable tool prefix, exact accepted definition); the
|
|
219
|
+
* next accepted logical turn resolves the newly enabled tool.
|
|
220
|
+
*/
|
|
221
|
+
export function resolveAcceptedTurnModel(
|
|
222
|
+
runtime: Pick<OpenGeniRuntime, "resolveTurnModel">,
|
|
223
|
+
settings: Settings,
|
|
224
|
+
policy: TurnExecutionPolicyV1,
|
|
225
|
+
): ReturnType<OpenGeniRuntime["resolveTurnModel"]> {
|
|
226
|
+
const current = runtime.resolveTurnModel(settings, policy.productModelId);
|
|
227
|
+
if (!current) return null;
|
|
228
|
+
const configured = configuredModelForAcceptedTurnExecutionPolicy(
|
|
229
|
+
current.configured,
|
|
230
|
+
current.provider,
|
|
231
|
+
policy,
|
|
232
|
+
);
|
|
233
|
+
return configured === current.configured ? current : { ...current, configured };
|
|
234
|
+
}
|
|
235
|
+
|
|
135
236
|
/**
|
|
136
237
|
* Native web search is a runtime capability, not part of the session's MCP
|
|
137
238
|
* allow-list. Attach it whenever the resolved provider advertises runnable
|
|
@@ -218,9 +319,8 @@ export function modelAttachmentInputPolicyForTurn(
|
|
|
218
319
|
};
|
|
219
320
|
} | null,
|
|
220
321
|
): ModelAttachmentInputPolicy {
|
|
221
|
-
const typedTransport = resolvedModel === null || resolvedModel.provider.api === "responses";
|
|
222
322
|
return {
|
|
223
|
-
supportsImageInput:
|
|
323
|
+
supportsImageInput: modelSupportsImageInputForTurn(resolvedModel),
|
|
224
324
|
inputFileMediaTypes: [],
|
|
225
325
|
};
|
|
226
326
|
}
|
|
@@ -226,6 +226,7 @@ export class ToolResultSpill {
|
|
|
226
226
|
session as CodemodeTokenWriterSession,
|
|
227
227
|
[download],
|
|
228
228
|
{
|
|
229
|
+
sandboxBackend: this.deps.getSandboxFileDownloadBackend(),
|
|
229
230
|
onRuntimeEvent: async (event) => {
|
|
230
231
|
await publish?.([{ type: event.type, payload: event.payload }], true);
|
|
231
232
|
},
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { TurnHeartbeatDetails } from "../../op-journal";
|
|
2
2
|
import type { Settings } from "@opengeni/config";
|
|
3
3
|
import type { CodexUsageHeaderSnapshot } from "@opengeni/codex";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
AppendEventInput,
|
|
6
|
+
ApplySessionTurnSettlementInput,
|
|
7
|
+
SubscriptionCoreTurnIdentity,
|
|
8
|
+
} from "@opengeni/db";
|
|
5
9
|
import type {
|
|
6
10
|
CodexCredentialPolicySnapshotV1,
|
|
7
11
|
ModelContextContributionSummary,
|
|
8
12
|
SessionStatus,
|
|
9
|
-
XaiProviderAccountAuthoritySnapshotV1,
|
|
10
13
|
} from "@opengeni/contracts";
|
|
11
14
|
import type {
|
|
12
15
|
EstablishedSandboxSession,
|
|
@@ -26,6 +29,7 @@ import type { TurnOutcome } from "../../observability-metrics";
|
|
|
26
29
|
import type { ResumedTurnSandbox, TurnSandboxLeaseHolderId } from "../../sandbox-resume";
|
|
27
30
|
import type { TurnEventPublisher } from "./model-usage";
|
|
28
31
|
import type { TurnSandboxProvisioner } from "./sandbox-provision";
|
|
32
|
+
import { InitialModelWireDispatchClock } from "./model-wire-dispatch";
|
|
29
33
|
|
|
30
34
|
/** Stamps the claimed turn/attempt ids onto a phase's own outcome. */
|
|
31
35
|
export type ClaimedResult = (
|
|
@@ -48,8 +52,10 @@ export type TurnSettleFn = (input: {
|
|
|
48
52
|
sessionStatus: SessionStatus;
|
|
49
53
|
activeTurnId: string | null;
|
|
50
54
|
suppressGoalContinuation?: boolean;
|
|
55
|
+
allowanceGoalPause?: ApplySessionTurnSettlementInput["allowanceGoalPause"];
|
|
51
56
|
consumeRequestedCompactionFailure?: boolean;
|
|
52
57
|
runState?: ApplySessionTurnSettlementInput["runState"];
|
|
58
|
+
notStartedToolCallIds?: readonly string[];
|
|
53
59
|
}) => Promise<boolean>;
|
|
54
60
|
|
|
55
61
|
export type TurnControlState = {
|
|
@@ -66,6 +72,17 @@ export type AttemptIdentityState = {
|
|
|
66
72
|
triggerEventId: string | undefined;
|
|
67
73
|
executionGeneration: number;
|
|
68
74
|
providerRecoveryCount: number;
|
|
75
|
+
/** Durable recovery policy reason; never inferred from display wording. */
|
|
76
|
+
providerRecoveryPolicyCode?: string | undefined;
|
|
77
|
+
providerRecoveryStartedAt?: number | undefined;
|
|
78
|
+
providerRecoveryObservation?:
|
|
79
|
+
| import("./provider-recovery-metrics").ProviderRecoveryObservation
|
|
80
|
+
| undefined;
|
|
81
|
+
modelMetricRoute?: { provider: string; model: string };
|
|
82
|
+
/** Public display labels of the accepted model route, for recovery copy only. */
|
|
83
|
+
modelRoutePresentation?: { model: string; modelLabel: string; providerLabel: string };
|
|
84
|
+
/** The stored shared-core lease-busy chain this turn's previous attempt recorded. */
|
|
85
|
+
subscriptionLeaseBusy?: { startedAt: number; executionGeneration: number } | undefined;
|
|
69
86
|
modelRequestStarted: boolean;
|
|
70
87
|
redispatchesAtDispatch: number;
|
|
71
88
|
// Held for same-turn recovery: an approval-decision rerun must re-enter
|
|
@@ -76,6 +93,7 @@ export type AttemptIdentityState = {
|
|
|
76
93
|
export type BillingState = {
|
|
77
94
|
isCodexTurn: boolean;
|
|
78
95
|
isXaiTurn: boolean;
|
|
96
|
+
isClaudeTurn: boolean;
|
|
79
97
|
isExternallyBilledTurn: boolean;
|
|
80
98
|
chargesOpenGeniCredits: boolean;
|
|
81
99
|
countsTowardTokenCap: boolean;
|
|
@@ -95,6 +113,9 @@ export type SandboxRuntimeState = {
|
|
|
95
113
|
}>;
|
|
96
114
|
turnSandboxProvisioner: TurnSandboxProvisioner<ResumedTurnSandbox> | null;
|
|
97
115
|
resumeManagedGroupBox: (() => Promise<ResumedTurnSandbox>) | null;
|
|
116
|
+
/** Physical resumeBoxForTurn promises still running for this attempt; the
|
|
117
|
+
* finalizer joins them so a cancelled establish completes its own cleanup. */
|
|
118
|
+
inFlightSandboxResumes: Set<Promise<unknown>>;
|
|
98
119
|
prefetchedManagedBox: Promise<ResumedTurnSandbox> | null;
|
|
99
120
|
prefetchedManagedBoxResult: ResumedTurnSandbox | null;
|
|
100
121
|
setupBoxSession: unknown;
|
|
@@ -113,10 +134,14 @@ export type SandboxRuntimeState = {
|
|
|
113
134
|
};
|
|
114
135
|
|
|
115
136
|
export type RenewalState = {
|
|
137
|
+
/** Secret-only local state; closed on every attempt finalization path. */
|
|
138
|
+
runMcpCredentials?: { close(): void };
|
|
116
139
|
gitCredentialRenewals: GitCredentialRenewalController[];
|
|
117
140
|
gitCredentialRenewalClosed: boolean;
|
|
118
141
|
runCredentialRenewal: RunCredentialRenewalController | null;
|
|
119
142
|
runCredentialRenewalClosed: boolean;
|
|
143
|
+
/** Outcome of the most recent renewal attempt, for on-demand refresh reporting. */
|
|
144
|
+
runCredentialRenewalOutcome: "completed" | "auth_needed" | "error" | null;
|
|
120
145
|
runCredentialSession: RunCredentialCommandSession | null;
|
|
121
146
|
codemodeTokenRenewal: CodemodeTokenRenewalController | null;
|
|
122
147
|
codemodeTokenRenewalClosed: boolean;
|
|
@@ -136,11 +161,19 @@ export type EventingState = {
|
|
|
136
161
|
settle: TurnSettleFn | null;
|
|
137
162
|
turnStartedPublished: boolean;
|
|
138
163
|
stream: Awaited<ReturnType<OpenGeniRuntime["runStream"]>> | undefined;
|
|
164
|
+
/** Set by the stream attempt: refuses a wait that would leave a person unanswered. */
|
|
165
|
+
inputWaitReplyGuard: (() => Promise<string | null>) | null;
|
|
139
166
|
modelRunSettings: Settings;
|
|
140
167
|
firstModelRequestPreparationStartedAt: number | null;
|
|
141
168
|
firstModelRequestPreparationRecorded: boolean;
|
|
142
169
|
firstModelRequestCheckpointAt: number | null;
|
|
170
|
+
initialModelWireDispatch: InitialModelWireDispatchClock;
|
|
171
|
+
/** Diagnostic only: the current stream's timing hook for a native transport's
|
|
172
|
+
* literal provider dispatch. Never joins, fences or fails the request. */
|
|
173
|
+
providerDispatchObserver: (() => void) | null;
|
|
143
174
|
companyBrainContextContributions: readonly ModelContextContributionSummary[] | null;
|
|
175
|
+
/** Skill ids in this turn's frozen, model-visible Skill index; telemetry only. */
|
|
176
|
+
modelVisibleSkillIds: ReadonlySet<string> | null;
|
|
144
177
|
};
|
|
145
178
|
|
|
146
179
|
/** Rig telemetry (M3): set once the session loads; empty string for a rig-less
|
|
@@ -151,6 +184,37 @@ export type WorkspaceRefState = {
|
|
|
151
184
|
rigVersionId: string;
|
|
152
185
|
};
|
|
153
186
|
|
|
187
|
+
/** A chat turn placed by the shared subscription core, for any provider. */
|
|
188
|
+
export type SubscriptionCoreTurn = {
|
|
189
|
+
identity: SubscriptionCoreTurnIdentity;
|
|
190
|
+
connectionId: string;
|
|
191
|
+
/** Refresh generation of the connection when it was placed. */
|
|
192
|
+
placedRefreshGeneration: number;
|
|
193
|
+
/**
|
|
194
|
+
* Refresh generation of the credential the latest request carried, when
|
|
195
|
+
* the provider's resolver reports it (SuperGrok and Claude; Codex keeps its
|
|
196
|
+
* own field).
|
|
197
|
+
*/
|
|
198
|
+
credentialVersion?: number;
|
|
199
|
+
personal: boolean;
|
|
200
|
+
/**
|
|
201
|
+
* The accepted product model id, for a provider whose refusals cool one
|
|
202
|
+
* model of the connection (Claude's per-model rate limits).
|
|
203
|
+
*/
|
|
204
|
+
productModelId?: string;
|
|
205
|
+
requests?: import("./subscription-core-requests").CoreSubscriptionRequests;
|
|
206
|
+
titleRequests?: import("./subscription-core-requests").CoreSubscriptionRequests;
|
|
207
|
+
/**
|
|
208
|
+
* The turn's quota observations from its responses (usage headers), when
|
|
209
|
+
* the provider reports them per response (Claude). `settled` joins every
|
|
210
|
+
* write so far and is true when one ended a stored exhaustion.
|
|
211
|
+
*/
|
|
212
|
+
quota?: { settled(): Promise<boolean> };
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
/** A Codex chat turn running on the shared subscription core (M3 name). */
|
|
216
|
+
export type CodexSubscriptionCoreTurn = SubscriptionCoreTurn;
|
|
217
|
+
|
|
154
218
|
export type ProviderTurnState = {
|
|
155
219
|
// The Codex account this turn runs on (pin > workspace active), resolved once
|
|
156
220
|
// a codex-billed turn is confirmed and threaded into the token resolver.
|
|
@@ -159,13 +223,37 @@ export type ProviderTurnState = {
|
|
|
159
223
|
effectiveCodexCredentialVersion: number | null;
|
|
160
224
|
/** Frozen alternate-account ceiling observed by the fenced allocator. */
|
|
161
225
|
codexCredentialFailoverLimit: number;
|
|
226
|
+
/**
|
|
227
|
+
* Accepted product model id (`codex/<slug>`) the Codex allocator filtered
|
|
228
|
+
* for. Failure settlement scopes plan entitlement and failover to it.
|
|
229
|
+
*/
|
|
230
|
+
codexProductModelId?: string | null;
|
|
162
231
|
/** Accepted Codex allocator policy captured with the first durable lease. */
|
|
163
232
|
codexPolicySnapshot: CodexCredentialPolicySnapshotV1 | null;
|
|
233
|
+
/**
|
|
234
|
+
* Set only when this Codex turn was placed by the shared subscription core
|
|
235
|
+
* (the account's Codex cutover is enabled). `effectiveCodexCredentialId` is
|
|
236
|
+
* then a core connection id: legacy Codex tables must never receive it.
|
|
237
|
+
*/
|
|
238
|
+
codexSubscriptionCore: CodexSubscriptionCoreTurn | null;
|
|
239
|
+
/** Epoch ms of the latest Codex model call that produced a response. */
|
|
240
|
+
lastCodexResponseCompletedAt?: number | null;
|
|
241
|
+
effectiveClaudeCredentialId: string | null;
|
|
242
|
+
/**
|
|
243
|
+
* Set only when this Claude turn was placed by the shared subscription core
|
|
244
|
+
* (the organization's Claude cutover committed and is enabled).
|
|
245
|
+
* `effectiveClaudeCredentialId` is then a core connection id: legacy Claude
|
|
246
|
+
* tables must never receive it.
|
|
247
|
+
*/
|
|
248
|
+
claudeSubscriptionCore: SubscriptionCoreTurn | null;
|
|
164
249
|
effectiveXaiCredentialId: string | null;
|
|
165
|
-
xaiRotationEnabled: boolean;
|
|
166
|
-
xaiAuthoritySnapshot: XaiProviderAccountAuthoritySnapshotV1 | null;
|
|
167
250
|
xaiRequestContext: XaiSubscriptionRequestContext | null;
|
|
168
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Set when this SuperGrok turn was placed by the shared subscription core,
|
|
253
|
+
* the only SuperGrok path. `effectiveXaiCredentialId` is then its core
|
|
254
|
+
* connection id.
|
|
255
|
+
*/
|
|
256
|
+
xaiSubscriptionCore: SubscriptionCoreTurn | null;
|
|
169
257
|
// The session's Codex credential BEFORE this turn resolved its own — captured
|
|
170
258
|
// before recordSessionActiveCodexCredential overwrites the durable pointer, so
|
|
171
259
|
// a per-call usage log can report whether the serving account CHANGED since the
|
|
@@ -218,6 +306,7 @@ export function createTurnContext(input: {
|
|
|
218
306
|
billingState: {
|
|
219
307
|
isCodexTurn: false,
|
|
220
308
|
isXaiTurn: false,
|
|
309
|
+
isClaudeTurn: false,
|
|
221
310
|
isExternallyBilledTurn: false,
|
|
222
311
|
chargesOpenGeniCredits: true,
|
|
223
312
|
countsTowardTokenCap: true,
|
|
@@ -232,6 +321,7 @@ export function createTurnContext(input: {
|
|
|
232
321
|
firstModelPreparationNestedSandboxPhases: [],
|
|
233
322
|
turnSandboxProvisioner: null,
|
|
234
323
|
resumeManagedGroupBox: null,
|
|
324
|
+
inFlightSandboxResumes: new Set(),
|
|
235
325
|
prefetchedManagedBox: null,
|
|
236
326
|
prefetchedManagedBoxResult: null,
|
|
237
327
|
setupBoxSession: null,
|
|
@@ -249,6 +339,7 @@ export function createTurnContext(input: {
|
|
|
249
339
|
gitCredentialRenewals: [],
|
|
250
340
|
gitCredentialRenewalClosed: false,
|
|
251
341
|
runCredentialRenewal: null,
|
|
342
|
+
runCredentialRenewalOutcome: null,
|
|
252
343
|
runCredentialRenewalClosed: false,
|
|
253
344
|
runCredentialSession: null,
|
|
254
345
|
codemodeTokenRenewal: null,
|
|
@@ -268,11 +359,15 @@ export function createTurnContext(input: {
|
|
|
268
359
|
settle: null,
|
|
269
360
|
turnStartedPublished: false,
|
|
270
361
|
stream: undefined,
|
|
362
|
+
inputWaitReplyGuard: null,
|
|
271
363
|
modelRunSettings: input.settings,
|
|
272
364
|
firstModelRequestPreparationStartedAt: null,
|
|
273
365
|
firstModelRequestPreparationRecorded: false,
|
|
274
366
|
firstModelRequestCheckpointAt: null,
|
|
367
|
+
initialModelWireDispatch: new InitialModelWireDispatchClock(),
|
|
368
|
+
providerDispatchObserver: null,
|
|
275
369
|
companyBrainContextContributions: null,
|
|
370
|
+
modelVisibleSkillIds: null,
|
|
276
371
|
},
|
|
277
372
|
workspaceRefs: {
|
|
278
373
|
variableSetId: "",
|
|
@@ -284,14 +379,35 @@ export function createTurnContext(input: {
|
|
|
284
379
|
effectiveCodexCredentialVersion: null,
|
|
285
380
|
codexCredentialFailoverLimit: 1,
|
|
286
381
|
codexPolicySnapshot: null,
|
|
382
|
+
codexSubscriptionCore: null,
|
|
383
|
+
lastCodexResponseCompletedAt: null,
|
|
384
|
+
effectiveClaudeCredentialId: null,
|
|
385
|
+
claudeSubscriptionCore: null,
|
|
287
386
|
effectiveXaiCredentialId: null,
|
|
288
|
-
xaiRotationEnabled: false,
|
|
289
|
-
xaiAuthoritySnapshot: null,
|
|
290
387
|
xaiRequestContext: null,
|
|
291
|
-
|
|
388
|
+
xaiSubscriptionCore: null,
|
|
292
389
|
priorSessionCodexCredentialId: null,
|
|
293
390
|
latestCodexUsage: null,
|
|
294
391
|
lastCodexRequestOpaqueArtifacts: [],
|
|
295
392
|
},
|
|
296
393
|
};
|
|
297
394
|
}
|
|
395
|
+
|
|
396
|
+
/** The turn's shared-core placement, whichever provider placed it (at most one does). */
|
|
397
|
+
export function subscriptionCoreTurnOf(
|
|
398
|
+
providerTurn: SubscriptionCorePlacedFields,
|
|
399
|
+
): SubscriptionCoreTurn | null {
|
|
400
|
+
return (
|
|
401
|
+
providerTurn.codexSubscriptionCore ??
|
|
402
|
+
providerTurn.xaiSubscriptionCore ??
|
|
403
|
+
providerTurn.claudeSubscriptionCore ??
|
|
404
|
+
null
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/** The provider fields that can hold a turn's shared-core placement. */
|
|
409
|
+
export type SubscriptionCorePlacedFields = Pick<
|
|
410
|
+
ProviderTurnState,
|
|
411
|
+
"codexSubscriptionCore" | "xaiSubscriptionCore"
|
|
412
|
+
> &
|
|
413
|
+
Partial<Pick<ProviderTurnState, "claudeSubscriptionCore">>;
|