@sema-agent/server 7.148.0 → 7.149.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +429 -0
- package/README.md +16 -1
- package/README.zh-CN.md +4 -0
- package/USAGE.md +89 -55
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +32 -32
- package/dist/approval-leg-origin.d.ts +33 -0
- package/dist/approval-leg-origin.js +4 -0
- package/dist/auth-bridge.d.ts +9 -1
- package/dist/auth-bridge.js +4 -4
- package/dist/auth-keys.d.ts +10 -1
- package/dist/auth-keys.js +8 -0
- package/dist/boot/execution-env.js +10 -11
- package/dist/boot/execution-lane.d.ts +6 -4
- package/dist/boot/execution-lane.js +3 -1
- package/dist/boot/org-delivery.d.ts +3 -2
- package/dist/boot/resolve-spec.js +6 -4
- package/dist/boot/runner-deps.js +3 -1
- package/dist/boot/stage-01-config.d.ts +1 -0
- package/dist/boot/stage-01-config.js +4 -3
- package/dist/boot/stage-02-web-admin-pull.d.ts +1 -0
- package/dist/boot/stage-02-web-admin-pull.js +10 -2
- package/dist/boot/stage-03-store-backend.d.ts +1 -0
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -0
- package/dist/boot/stage-05-execution-env.d.ts +1 -0
- package/dist/boot/stage-06-runners.d.ts +2 -1
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-10-http-server.d.ts +2 -1
- package/dist/boot/stores.d.ts +3 -0
- package/dist/boot/stores.js +22 -19
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +5 -4
- package/dist/capability-facts.js +3 -14
- package/dist/card-settle-stored-scope.d.ts +56 -0
- package/dist/card-settle-stored-scope.js +27 -0
- package/dist/card-void.d.ts +7 -12
- package/dist/card-void.js +2 -7
- package/dist/config-catalog.d.ts +12 -0
- package/dist/config-catalog.js +36 -32
- package/dist/config-invariants.d.ts +5 -4
- package/dist/config-invariants.js +4 -4
- package/dist/config-types.d.ts +37 -5
- package/dist/config.d.ts +6 -5
- package/dist/config.js +35 -24
- package/dist/context-window-notice.d.ts +31 -0
- package/dist/context-window-notice.js +28 -0
- package/dist/deployment-shape.d.ts +20 -11
- package/dist/deployment-shape.js +1 -0
- package/dist/env-name-allowlist-knobs.d.ts +6 -5
- package/dist/env-name-allowlist-knobs.js +5 -0
- package/dist/execution-lane-caps.d.ts +20 -5
- package/dist/execution-lane-caps.js +18 -4
- package/dist/hooks/command-spawn.d.ts +7 -2
- package/dist/hooks/command-spawn.js +13 -6
- package/dist/hooks/hook-runner.d.ts +5 -0
- package/dist/hooks/hook-runner.js +11 -7
- package/dist/http/admission.js +3 -3
- package/dist/http/approval-sweeps.js +3 -2
- package/dist/http/claim-heartbeat.d.ts +3 -3
- package/dist/http/claim-heartbeat.js +3 -3
- package/dist/http/claimed-run.d.ts +16 -9
- package/dist/http/claimed-run.js +8 -0
- package/dist/http/dispatch.js +5 -3
- package/dist/http/durable-run-leg.d.ts +8 -1
- package/dist/http/durable-run-leg.js +30 -11
- package/dist/http/execution-context.d.ts +115 -14
- package/dist/http/execution-context.js +130 -40
- package/dist/http/owner-access.d.ts +3 -2
- package/dist/http/owner-access.js +2 -3
- package/dist/http/principal-gate.d.ts +18 -11
- package/dist/http/principal-gate.js +3 -1
- package/dist/http/resume-ctx-read.d.ts +14 -3
- package/dist/http/resume-ctx-read.js +8 -2
- package/dist/http/resume-legs.d.ts +35 -3
- package/dist/http/resume-legs.js +244 -92
- package/dist/http/route-ctx.d.ts +6 -0
- package/dist/http/routes/a2a-serve.js +2 -0
- package/dist/http/routes/approvals-assistant.js +3 -2
- package/dist/http/routes/capabilities.js +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -1
- package/dist/http/routes/diagnostics.js +30 -5
- package/dist/http/routes/principal-inbox.d.ts +3 -1
- package/dist/http/routes/principal-inbox.js +3 -2
- package/dist/http/routes/runs.js +10 -7
- package/dist/http/routes/session-sync.d.ts +24 -5
- package/dist/http/routes/session-sync.js +46 -34
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/tasks.js +127 -93
- package/dist/http/server.d.ts +4 -5
- package/dist/http/server.js +30 -5
- package/dist/http/submit-ctx.d.ts +1 -0
- package/dist/http/submit-ctx.js +2 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/leg-facts.d.ts +7 -2
- package/dist/leg-facts.js +1 -0
- package/dist/local-store-declaration.d.ts +54 -0
- package/dist/local-store-declaration.js +59 -0
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/mcp-assertion-header.js +1 -1
- package/dist/memory-project-layer.js +1 -1
- package/dist/memory-scope.d.ts +4 -4
- package/dist/memory-scope.js +4 -4
- package/dist/memory-sync-client.js +2 -2
- package/dist/model-context-window.d.ts +50 -11
- package/dist/model-context-window.js +20 -1
- package/dist/model-entry-refusal.d.ts +5 -4
- package/dist/model-entry-refusal.js +17 -3
- package/dist/model-reach-scope.d.ts +2 -1
- package/dist/observability/fail-open.d.ts +14 -2
- package/dist/observability/fail-open.js +14 -2
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/run-terminal.js +1 -0
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/org-delivery-gate.d.ts +31 -6
- package/dist/org-delivery-gate.js +7 -4
- package/dist/owner-faces.d.ts +3 -2
- package/dist/park-row-commit.d.ts +67 -0
- package/dist/park-row-commit.js +76 -0
- package/dist/parked-decide.d.ts +9 -7
- package/dist/parked-decide.js +25 -6
- package/dist/peer-directory.d.ts +1 -1
- package/dist/plugins/adoption-log-sql.d.ts +3 -3
- package/dist/plugins/adoption-log-sql.js +19 -19
- package/dist/plugins/approval-ask-store-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-sql.js +3 -5
- package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
- package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
- package/dist/plugins/approval-exemption-skill-m46.d.ts +0 -6
- package/dist/plugins/approval-exemption-skill-m46.js +6 -10
- package/dist/plugins/approval-exemption-store.d.ts +26 -1
- package/dist/plugins/approval-exemption-store.js +28 -19
- package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -3
- package/dist/plugins/ensure-schema-lock-policy.js +75 -9
- package/dist/plugins/file-run-store.d.ts +22 -9
- package/dist/plugins/file-run-store.js +50 -22
- package/dist/plugins/local-checkpoint-store.d.ts +4 -0
- package/dist/plugins/local-checkpoint-store.js +2 -1
- package/dist/plugins/local-data-root-admission.d.ts +52 -0
- package/dist/plugins/local-data-root-admission.js +100 -0
- package/dist/plugins/local-engine-high-water.d.ts +28 -7
- package/dist/plugins/local-engine-high-water.js +27 -22
- package/dist/plugins/local-session-store.d.ts +134 -49
- package/dist/plugins/local-session-store.js +149 -108
- package/dist/plugins/memory-run-store.d.ts +14 -9
- package/dist/plugins/memory-run-store.js +47 -21
- package/dist/plugins/one-time-migration-marker.d.ts +19 -3
- package/dist/plugins/one-time-migration-marker.js +7 -1
- package/dist/plugins/one-time-migrations.d.ts +46 -20
- package/dist/plugins/one-time-migrations.js +102 -79
- package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
- package/dist/plugins/org-delivery-quota-store.js +29 -14
- package/dist/plugins/permission-rule-store-sql.d.ts +1 -1
- package/dist/plugins/permission-rule-store-sql.js +5 -9
- package/dist/plugins/pg-pool.d.ts +1 -1
- package/dist/plugins/pg-pool.js +10 -12
- package/dist/plugins/remote-env-device.d.ts +3 -2
- package/dist/plugins/remote-env-e2b.d.ts +1 -7
- package/dist/plugins/remote-env-e2b.js +10 -7
- package/dist/plugins/remote-env-host.d.ts +50 -9
- package/dist/plugins/remote-env-host.js +77 -20
- package/dist/plugins/remote-env-k8s.js +4 -2
- package/dist/plugins/remote-env-local-docker.d.ts +6 -3
- package/dist/plugins/remote-env-local-docker.js +8 -23
- package/dist/plugins/run-store-sql.d.ts +26 -7
- package/dist/plugins/run-store-sql.js +44 -16
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +3 -1
- package/dist/plugins/scenario-prefix-switch-m42.js +4 -3
- package/dist/plugins/schema-consistency.d.ts +89 -5
- package/dist/plugins/schema-consistency.js +176 -7
- package/dist/plugins/schema-drift-sentence.d.ts +6 -5
- package/dist/plugins/schema-drift-sentence.js +13 -5
- package/dist/plugins/session-placement.d.ts +5 -4
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +22 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +6 -0
- package/dist/plugins/stop-then-start-sentence.d.ts +16 -0
- package/dist/plugins/stop-then-start-sentence.js +7 -0
- package/dist/plugins/store-backend.d.ts +22 -8
- package/dist/plugins/store-backend.js +58 -24
- package/dist/plugins/store-contracts.d.ts +33 -3
- package/dist/plugins/store-contracts.js +16 -0
- package/dist/plugins/tidb-pool.d.ts +11 -6
- package/dist/plugins/tidb-pool.js +18 -12
- package/dist/plugins/workspace-custody.d.ts +44 -0
- package/dist/plugins/workspace-custody.js +47 -0
- package/dist/project-identity.d.ts +8 -7
- package/dist/project-identity.js +40 -17
- package/dist/project-layer-key.d.ts +13 -2
- package/dist/project-layer-key.js +9 -1
- package/dist/read-deny-floor-notice.d.ts +36 -0
- package/dist/read-deny-floor-notice.js +40 -0
- package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
- package/dist/request-declaration-disposition.js +39 -0
- package/dist/run-cancel-card.d.ts +28 -0
- package/dist/run-cancel-card.js +19 -0
- package/dist/run-cancel-context.d.ts +10 -0
- package/dist/run-cancel-context.js +1 -0
- package/dist/run-local.js +28 -13
- package/dist/runs.d.ts +31 -7
- package/dist/runs.js +34 -16
- package/dist/security.d.ts +2 -2
- package/dist/server-secret-env.d.ts +34 -20
- package/dist/server-secret-env.js +61 -18
- package/dist/session-agent.d.ts +3 -2
- package/dist/session-children-retire.d.ts +6 -3
- package/dist/session-children-retire.js +2 -5
- package/dist/session-workspace.d.ts +3 -3
- package/dist/store-admission.d.ts +33 -0
- package/dist/store-admission.js +49 -0
- package/dist/store-posture.d.ts +5 -0
- package/dist/store-posture.js +18 -1
- package/dist/stores-sql/checkpoint-store-sql.d.ts +1 -1
- package/dist/stores-sql/checkpoint-store-sql.js +3 -5
- package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
- package/dist/stores-sql/file-history-store-sql.js +3 -5
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +4 -6
- package/dist/task-a2a.d.ts +3 -8
- package/dist/task-a2a.js +25 -27
- package/dist/task-cwd.d.ts +23 -7
- package/dist/task-cwd.js +3 -0
- package/dist/task-mcp.d.ts +3 -3
- package/dist/task-mcp.js +1 -1
- package/dist/task-settings.js +1 -0
- package/dist/terminal.d.ts +2 -0
- package/dist/terminal.js +21 -6
- package/dist/tool-approval.d.ts +44 -36
- package/dist/tool-approval.js +66 -47
- package/dist/trace/engine-notice-wire.d.ts +24 -21
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/ledger-sink.d.ts +3 -1
- package/dist/trace/project.d.ts +4 -2
- package/dist/trace/project.js +8 -7
- package/dist/trace/redact.d.ts +12 -0
- package/dist/trace/redact.js +5 -1
- package/dist/trace/self-minted-wire.d.ts +131 -52
- package/dist/trace/self-minted-wire.js +71 -39
- package/dist/web-admin-client/apply-effective.js +22 -9
- package/docs/error-text-lexicon.json +317 -0
- package/package.json +3 -1
- package/scripts/embed-minimal.mjs +183 -0
- package/wire-changes/server@7.149.0.json +372 -0
- package/dist/plain-string-record.js +0 -70
|
@@ -36,15 +36,18 @@ export const SELF_MINTED_WIRE = {
|
|
|
36
36
|
stall_verdict: { attr: "-", since: "7.148.0" },
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
+
runResultSideKey: {
|
|
40
|
+
at: "run 结果顶层侧记键(GET /v1/runs/:id → result · done.result · POST /v1/tasks 200 体顶层 · 账本 done 行 result;<键> → 在场律)",
|
|
41
|
+
members: {
|
|
42
|
+
readDenyFloor: { attr: "present-iff the run went ahead while its read-deny rules are not byte-enforced (rows, an execution environment that does not keep the floor, READ_DENY_FLOOR_REQUIRED unset); { code, message } equals that run's engine_notice frame", since: "7.149.0" },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
39
45
|
runStallVerdictFace: {
|
|
40
46
|
at: "run 流死亡终帧键 · 会话占用冲突体键",
|
|
41
47
|
members: {
|
|
42
48
|
"GET /v1/runs/:id/events#failed.errorCode(死亡判决的终帧从行合成时恒在场 = 行上的码 run.stalled / run.orphaned;本连接已投账本终帧则不合成)": { attr: "verdict", since: "7.148.0" },
|
|
43
49
|
},
|
|
44
|
-
retired: {
|
|
45
|
-
"409 conflict.session_active_run#stale(只为 true 时在场)": { attr: "true-only", since: "7.37.0", until: "7.148.0" },
|
|
46
|
-
"POST /v1/tasks/stream done.result(conflict.session_active_run)#stale(只为 true 时在场)": { attr: "true-only", since: "7.37.0", until: "7.148.0" },
|
|
47
|
-
},
|
|
50
|
+
retired: {},
|
|
48
51
|
},
|
|
49
52
|
sessionMemoryEraseStatus: {
|
|
50
53
|
at: "POST /v1/sessions/:id/memory/erase(已分类拒 errorCode → HTTP 状态)",
|
|
@@ -57,7 +60,7 @@ export const SELF_MINTED_WIRE = {
|
|
|
57
60
|
"memory.erasure_selector_mismatch": { attr: 409, since: "7.108.0" },
|
|
58
61
|
"memory.erasure_census_incomplete": { attr: 409, since: "7.108.0" },
|
|
59
62
|
"internal.memory_control_plane_corrupt": { attr: 500, since: "7.108.0" },
|
|
60
|
-
"request.memory_layer": { attr: 400,
|
|
63
|
+
"request.memory_layer": { attr: 400, since: "7.148.0" },
|
|
61
64
|
},
|
|
62
65
|
},
|
|
63
66
|
askTerminalReason: {
|
|
@@ -370,6 +373,14 @@ export const SELF_MINTED_WIRE = {
|
|
|
370
373
|
supportsThinkingOff: { attr: "always", since: "7.138.0" },
|
|
371
374
|
thinkingLevelMap: { attr: "present-iff declared", since: "7.147.0" },
|
|
372
375
|
defaultThinking: { attr: "present-iff declared", since: "7.148.0" },
|
|
376
|
+
contextWindowSource: { attr: "present-iff contextWindow is present", since: "7.149.0" },
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
modelsContextWindowSource: {
|
|
380
|
+
at: "GET /v1/models models[].contextWindowSource(present-iff contextWindow)",
|
|
381
|
+
members: {
|
|
382
|
+
declared: { attr: "-", since: "7.149.0" },
|
|
383
|
+
assumed: { attr: "-", since: "7.149.0" },
|
|
373
384
|
},
|
|
374
385
|
},
|
|
375
386
|
modelsRowAnthropicCompatKey: {
|
|
@@ -491,22 +502,22 @@ export const SELF_MINTED_WIRE = {
|
|
|
491
502
|
fieldConflictReason: {
|
|
492
503
|
at: "400 / 409 / 422 request.field_conflict reason",
|
|
493
504
|
members: {
|
|
494
|
-
cascade_verify: { attr: "-",
|
|
495
|
-
image_profile: { attr: "-",
|
|
496
|
-
resume_anchor: { attr: "-",
|
|
497
|
-
system_prompt_fold: { attr: "-",
|
|
498
|
-
file_history_restore: { attr: "-",
|
|
499
|
-
skills_disabled: { attr: "-",
|
|
500
|
-
existing_session: { attr: "-",
|
|
501
|
-
fork_target: { attr: "-",
|
|
502
|
-
scratchpad_root: { attr: "-",
|
|
503
|
-
ask_answer: { attr: "-",
|
|
504
|
-
policy_person_ask: { attr: "-",
|
|
505
|
-
plan_edit: { attr: "-",
|
|
506
|
-
plan_mode_after: { attr: "-",
|
|
507
|
-
bound_call_door: { attr: "-",
|
|
508
|
-
remember_decision: { attr: "-",
|
|
509
|
-
approval_feedback: { attr: "-",
|
|
505
|
+
cascade_verify: { attr: "-", since: "7.148.0" },
|
|
506
|
+
image_profile: { attr: "-", since: "7.148.0" },
|
|
507
|
+
resume_anchor: { attr: "-", since: "7.148.0" },
|
|
508
|
+
system_prompt_fold: { attr: "-", since: "7.148.0" },
|
|
509
|
+
file_history_restore: { attr: "-", since: "7.148.0" },
|
|
510
|
+
skills_disabled: { attr: "-", since: "7.148.0" },
|
|
511
|
+
existing_session: { attr: "-", since: "7.148.0" },
|
|
512
|
+
fork_target: { attr: "-", since: "7.148.0" },
|
|
513
|
+
scratchpad_root: { attr: "-", since: "7.148.0" },
|
|
514
|
+
ask_answer: { attr: "-", since: "7.148.0" },
|
|
515
|
+
policy_person_ask: { attr: "-", since: "7.148.0" },
|
|
516
|
+
plan_edit: { attr: "-", since: "7.148.0" },
|
|
517
|
+
plan_mode_after: { attr: "-", since: "7.148.0" },
|
|
518
|
+
bound_call_door: { attr: "-", since: "7.148.0" },
|
|
519
|
+
remember_decision: { attr: "-", since: "7.148.0" },
|
|
520
|
+
approval_feedback: { attr: "-", since: "7.148.0" },
|
|
510
521
|
},
|
|
511
522
|
},
|
|
512
523
|
hooksRefusalReason: {
|
|
@@ -606,7 +617,7 @@ export const SELF_MINTED_WIRE = {
|
|
|
606
617
|
"POST /v1/runs|/v1/tasks Idempotency-Key#conflict.run_exists": { attr: 409, since: "7.125.0" },
|
|
607
618
|
"POST /v1/runs|/v1/tasks Idempotency-Key#conflict.idempotency_payload_mismatch": { attr: 409, since: "7.126.0" },
|
|
608
619
|
"POST /v1/tasks|/v1/tasks/stream#replay_first_answer_envelope(同键重放的体 = 首答的信封 + replay: true:终局 = 引擎结果(result 是串),停驻 = 结果 + 回执三键,行还在跑 = 回执三键;流式腿放进 done.result)": { attr: 200, since: "7.142.0" },
|
|
609
|
-
"POST /v1/tasks|/v1/tasks/stream#replay_bit_one_rule(replay: true ⇔ 200 结局不是本次请求产出的:读行重放 + 在飞合流的跟随方,两腿同读;拒绝永不带位;流式终帧 done.replay = done.result.replay)": { attr: 200,
|
|
620
|
+
"POST /v1/tasks|/v1/tasks/stream#replay_bit_one_rule(replay: true ⇔ 200 结局不是本次请求产出的:读行重放 + 在飞合流的跟随方,两腿同读;拒绝永不带位;流式终帧 done.replay = done.result.replay)": { attr: 200, since: "7.148.0" },
|
|
610
621
|
},
|
|
611
622
|
},
|
|
612
623
|
leaderStopFace: {
|
|
@@ -806,6 +817,13 @@ export const SELF_MINTED_WIRE = {
|
|
|
806
817
|
thrownName: { attr: "present-iff the engine named what its row judge saw thrown (non-empty string)", since: "7.144.0" },
|
|
807
818
|
},
|
|
808
819
|
},
|
|
820
|
+
rowRefusalWayOut: {
|
|
821
|
+
at: "409 决断类续跑拒体(/decide · /plan_review · /resume;判官判那张卡续不了)wayOut",
|
|
822
|
+
members: {
|
|
823
|
+
cancel_run: { attr: "-", since: "7.149.0" },
|
|
824
|
+
newer_worker: { attr: "-", since: "7.149.0" },
|
|
825
|
+
},
|
|
826
|
+
},
|
|
809
827
|
permissionModeVerbBodyKey: {
|
|
810
828
|
at: "POST /v1/runs/:id/permission-mode 200 体(<键> → 在场律)",
|
|
811
829
|
members: {
|
|
@@ -928,13 +946,26 @@ export const SELF_MINTED_WIRE = {
|
|
|
928
946
|
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#settings.env 有成员不是帽内的串(新提交;只在采纳 env 的车道上:单用户 host / device,或采纳请求体 hooks 且请求带着 hooks;零 run;体 request.field_invalid + field settings.env,句子点名坐标、不回显值)": { attr: 400, since: "7.147.0" },
|
|
929
947
|
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#stored_unread_members(续跑将要跑的那一份体 —— 存量体,重述键在场时盖过重述之后 —— 里有本版读者读不出、而本部署本会采纳的成员:settings.hooks / settings.env / 其余 settings 延后键 / mcpServers[i].transport / a2aPeers[i].headers;认领之前,卡仍待决;体 resume_blocked_by_policy + blockedBy request.field_invalid + field + retriable)": { attr: 409, since: "7.147.0" },
|
|
930
948
|
"POST /v1/runs/:id/steer#stored_unread_members(run 已终态、铸唤醒卡之前;同一只判;不铸卡;体 resume_blocked_by_policy + blockedBy request.field_invalid + field,不带 retriable)": { attr: 409, since: "7.147.0" },
|
|
931
|
-
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review|/v1/runs/:id/steer|/v1/runs/:id/permission-mode#resume_context_read_failed(读这条会话的续跑上下文失败:库断连 / 拒连 / 超时、缺表 / 权限拒、认不出的库错;拒在任何状态改动之前,卡仍待决、终态 steer 不铸卡;体 state.resume_context_unreadable)": { attr: 503,
|
|
949
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review|/v1/runs/:id/steer|/v1/runs/:id/permission-mode#resume_context_read_failed(读这条会话的续跑上下文失败:库断连 / 拒连 / 超时、缺表 / 权限拒、认不出的库错;拒在任何状态改动之前,卡仍待决、终态 steer 不铸卡;体 state.resume_context_unreadable)": { attr: 503, since: "7.148.0" },
|
|
950
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#resume_claim_store_fault(认领之前那一次执行席读、认领那一笔 —— markResuming / wake 现建行的 createRun —— 或认领之后提交执行放置那一次店往返失败:库断连 / 拒连 / 超时、缺表 / 权限拒、认不出的库错;认领之后那一形续跑认领的停驻行回到认领之前的停驻词、认领留着,wake 现建的行删掉;卡仍待决;体 state.resume_context_unreadable)": { attr: 503, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
951
|
+
"POST /v1/runs/:id/cancel#parked_card_body_scope_differs(停驻 run 上的取消:这张卡行体里自带的属主格与店的属主格不一致 —— 取消只读店的属主格,结算这张卡、驱 run 终局;体 { taskId, status: failed, errorCode: cancelled, cancelRequested: false, note })": { attr: 202, revises: ["errorCode:conflict.approval_settled"], since: "7.149.0" },
|
|
952
|
+
"POST /v1/runs/:id/cancel#parked_card_body_unreadable(停驻 run 上的取消:这张卡的行体读不成检查点 —— 取消只读店的列,结算这张卡、驱 run 终局;体同上)": { attr: 202, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
932
953
|
"POST /v1/approvals/:sessionId/decide#parked_agent_definition_unavailable(停驻赎回;行上的代理类型不在赎回面委派工具的名册里:逐请求 `agents` 定义 / 停驻后被撤的部署定义 / 名叫 fork 的定义;approve 与 deny 同答;认领回滚、委派工具零调用、卡仍待决;体 decide.agent_definition_unavailable + taskId + rollback)": { attr: 409, since: "7.148.0" },
|
|
933
|
-
"POST /v1/runs
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
"POST /v1/
|
|
937
|
-
|
|
954
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#run_claim_store_fault(新提交:认领之前那一次执行席读,或认领这一段 —— 建行认领 createRun、执行放置、续跑输入的写、起跑之前的认领复核 —— 有一次店往返没答出来:库断连 / 拒连 / 超时、缺表 / 权限拒、认不出的库错;本请求铸的行已删掉 —— 认领与幂等键随行去,同一个自带 taskId 重发即新提交 —— 什么都没起跑;认领之后的流式腿 = 流的终帧;已绑设备的会话上认领之后那一次执行席读同答;体 state.run_store_unavailable)": { attr: 503, revises: ["errorCode:internal.error", "errorCode:device.not_bound"], since: "7.149.0" },
|
|
955
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#resume_pre_engine_store_fault(续跑腿提交放行之后、交给引擎之前那一段 —— 排空 workflow 完成的序号基址现读与落账、通告口落账 —— 店往返没答出来;续跑认领的停驻行回到停驻、认领留着,wake 现建的行删掉;卡仍待决;体 state.resume_context_unreadable)": { attr: 503, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
956
|
+
"POST /v1/approvals/:sessionId/decide#workflow_host_turn_claim_store_fault(workflow 决定在宿主会话上起的新一跑:建行认领 / 执行放置 / 续跑输入 / 决定落行 / 起跑之前的认领复核有一次店往返没答出来;决定落行那一笔在 wake 腿上同答;现建的行已删掉,子代的卡仍待决;体 state.resume_context_unreadable)": { attr: 503, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
957
|
+
"POST /v1/approvals/:sessionId/decide#workflow_decision_not_recorded(workflow 决定的投递那一跑在决定落行那一拍已不持宿主会话的认领 —— 心跳停满一窗被收割;决定没落、那一跑没起;与起跑之前认领复核答「没持有」同一只答复:认领在别的 run 上 ⇒ 409 conflict.session_active_run,宿主会话已删 ⇒ 404 resume.session_not_found,否则 409 conflict.claim_lost)": { attr: 409, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
958
|
+
"POST /v1/approvals/:sessionId/decide#parked_redeem_placement_store_fault(停驻子代赎回:认领之前那一次执行席读,或认领之后那一次执行放置的店往返没答出来;认领没有或已回滚,子代仍停着、卡仍待决;体 decide.store_unreachable + taskId)": { attr: 503, revises: ["errorCode:internal.error"], since: "7.149.0" },
|
|
959
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#placement_refused_after_claim(续跑家族、workflow 决定在宿主会话上起的新一跑、停驻子代赎回认领之后提交执行放置读出这条会话此刻不能在本处执行:已放在别的车道 / 写者在别处 / 设备拒;续跑认领的停驻行回到停驻、停驻赎回回滚,卡仍待决,wake 与宿主新一跑现建的行删掉;与认领之前同一只折法、同一只体;体 resume_blocked_by_policy + blockedBy 原码 + 原事实 forkPath / boundLane + retriable)": { attr: 409, revises: ["errorCode:execution_lane.tree_bound", "errorCode:conflict.session_mirror"], since: "7.149.0" },
|
|
960
|
+
"POST /v1/tasks#park_commit_ended(同步腿停在要批的门上,而停驻提交答出这条 run 没有停住、已收场 —— 停驻写之前已按下取消 / 被失联收割 / 别处终结;卡已作废;体 = 收场那一行的信封,与同键重放同一只:终局行的结果,取消那一形 terminal.code cancelled;行上无结果 ⇒ 回执三键)": { attr: 200, since: "7.149.0" },
|
|
961
|
+
"POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#resume_park_ended(续跑腿再停 / 重开时停驻提交答出这条 run 已收场;卡已作废;体 status / errorCode = 收场那一行的,不带 retriable)": { attr: 200, since: "7.149.0" },
|
|
962
|
+
"POST /v1/runs/:id/interrupt#body_with_fields(体带任何顶层键 —— 含早先版本受理的 text;非对象体同答;判在查 run 之前:任何 run 状态、属主、存在与否同一只体;体 request.body_shape + unknownKeys(键全在此)+ unsupportedKeys(恒空))": { attr: 400, since: "7.148.0" },
|
|
963
|
+
"GET /v1/tool-approvals/:id#row_unreadable(有行的问,按 id 读行那一拍店抛 / 超时;本副本自己铸的活卡与起服接管的登记同答;体 not_found.ask,与查无 / 不是你的逐字节同)": { attr: 404, revises: ["selfMinted.toolApprovalReadState:pending"], since: "7.149.0" },
|
|
964
|
+
"POST /v1/sessions/:id/sync/plan|POST /v1/sessions/:id/sync/import|PUT /v1/sessions/:id/sync/blobs/:hash#foreign_session_deleting(推送三口的门:id 上是别的主体正在删除的会话 —— 删除围栏已立、尚未删净;「被占着」读活行 ∪ 在删行,与对别人的活行同答;本人 / fleet 对自己在删的会话不变,拉取口仍只认活行;体 not_found.session,与对不存在 id 的拉取答复逐字节同)": { attr: 404, revises: ["errorCode:conflict"], since: "7.149.0" },
|
|
965
|
+
"POST /v1/sessions/:id/sync/import#idle_id_other_principal_in_flight(第一阶段:id 上还没有会话行,而另一个主体在这只 id 上的第一阶段正在飞;导入租约键 = 落点属主格 + 会话 id,空闲 id 上各占各的;体 = 第一阶段的暂存回执 stagingId;先提交者得,输的那一份在提交前复判答 404 not_found.session,与赢家的提交撞在同一刻时由店的属主 CAS 拒 409 conflict)": { attr: 200, revises: ["errorCodeFamily:import_in_flight"], since: "7.149.0" },
|
|
966
|
+
"POST /v1/tasks|/v1/tasks/stream|/v1/runs#a2aPeers_headers_reserved_member(新提交;a2aPeers[i].headers 的成员名是 constructor / prototype —— 与 mcpServers[i].transport.headers / .env 同一张保留成员名表、同一只读法,大小写敏感;体 request.field_invalid + field 成员级路径 a2aPeers[i].headers.<名>;存盘续跑体里同形 ⇒ 续跑家族既有一面 #stored_unread_members 409)": { attr: 400, since: "7.149.0" },
|
|
967
|
+
},
|
|
968
|
+
retired: {},
|
|
938
969
|
},
|
|
939
970
|
ruleImportReceiptKey: {
|
|
940
971
|
at: "POST /v1/rules/cc-import/redeem 200 回执顶层键(<键> → 在场律;与 POST /v1/rules/local-import/redeem 同形)",
|
|
@@ -1003,17 +1034,18 @@ export const SELF_MINTED_WIRE = {
|
|
|
1003
1034
|
ownerFaceAnswer: {
|
|
1004
1035
|
at: "属主门的逐口答复(<口>#<调用方 × 行> → 状态 errorCode;其余各口的码与句逐字不变)",
|
|
1005
1036
|
members: {
|
|
1006
|
-
"POST /v1/tasks · /v1/tasks/stream · /v1/runs (sessionId)#others-owned-session": { attr: "404 resume.session_not_found (requireExistingSession: session does not exist (resume.session_not_found)), same body as a missing session; was 403 auth.forbidden (named caller) / 401 auth.unauthorized (no principal)",
|
|
1037
|
+
"POST /v1/tasks · /v1/tasks/stream · /v1/runs (sessionId)#others-owned-session": { attr: "404 resume.session_not_found (requireExistingSession: session does not exist (resume.session_not_found)), same body as a missing session; was 403 auth.forbidden (named caller) / 401 auth.unauthorized (no principal)", since: "7.148.0" },
|
|
1007
1038
|
"POST /v1/tasks · /v1/tasks/stream · /v1/runs (sessionId)#ownerless-placed-session": { attr: "404 resume.session_not_found at the owner gate, same body as a missing session (assemblies without an execution seat too); not judged when the session's archive cannot be read", since: "7.148.0" },
|
|
1008
|
-
"POST /v1/assistant/tasks/:id/plan_review#direct-door-valid-proof-others-task": { attr: "401 principal_unverified (principal proof required), same body as a missing row; was 404 not_found.run (task not found)",
|
|
1009
|
-
"GET|PUT /v1/sessions/:id/policy#ownerless-placed-session-non-fleet-non-operator": { attr: "404 not_found.session (session not found), same body as a missing session; was 409 conflict.session_ownerless",
|
|
1010
|
-
"run / session read faces#deployment-service-credential-no-principal-users-rows": { attr: "200 on GET /v1/runs/:id · /v1/runs/:id/events · /v1/sessions/:id · /head · /events · /memory-status · /execution-placement (unless SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT=false); was 404, or 401 auth.principal_required where a principal is required",
|
|
1011
|
-
"GET /v1/runs/:id · /v1/runs/:id/events#dev-open-principal-header-not-owner": { attr: "
|
|
1012
|
-
"
|
|
1039
|
+
"POST /v1/assistant/tasks/:id/plan_review#direct-door-valid-proof-others-task": { attr: "401 principal_unverified (principal proof required), same body as a missing row; was 404 not_found.run (task not found)", since: "7.148.0" },
|
|
1040
|
+
"GET|PUT /v1/sessions/:id/policy#ownerless-placed-session-non-fleet-non-operator": { attr: "404 not_found.session (session not found), same body as a missing session; was 409 conflict.session_ownerless", since: "7.148.0" },
|
|
1041
|
+
"run / session read faces#deployment-service-credential-no-principal-users-rows": { attr: "200 on GET /v1/runs/:id · /v1/runs/:id/events · /v1/sessions/:id · /head · /events · /memory-status · /execution-placement (unless SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT=false); was 404, or 401 auth.principal_required where a principal is required", since: "7.148.0" },
|
|
1042
|
+
"GET /v1/runs/:id · /v1/runs/:id/events#dev-open-principal-header-not-owner": { attr: "404 not_found.run, same body as a missing run (a caller that names a principal is that principal on a deployment without an identity boundary too); was 200", since: "7.149.0" },
|
|
1043
|
+
"session faces · list faces · /metrics family#dev-open-principal-header-not-owner": { attr: "each face's missing-row answer, same body as a missing row (404 not_found.session on GET /v1/sessions/:id · /head · /events · /memory-status · /execution-placement · PATCH /v1/sessions/:id · fork · sync reads (manifest · entries · history blob) · memory/erase · background · background/stop · mcp/reconnect · policy · notify; approval exemptions 404 not_found.session (not found); DELETE /v1/sessions/:id 200 {deleted:false}; sync push family (plan · import · blob put) 404 on another owner's session, its existing create answer on a missing id); GET /v1/sessions · /v1/fleet/stream · /v1/agents/roster · /v1/tasks (trace list) · /v1/usage/* · /v1/sendfile-links pinned to the named caller; /metrics* and GET /v1/tasks/source-summary 401 auth.unauthorized (operator sentence; METRICS_TOKEN, when configured, still opens /metrics* and is judged first); a Bearer this deployment cannot verify does not count as naming no principal (no fleet); a caller naming no principal and presenting no unverifiable credential unchanged (fleet); was 200 / fleet-wide (the principal header read as a label)", revises: ["selfMinted.ownerFaceAnswer:GET /v1/runs/:id · /v1/runs/:id/events#dev-open-principal-header-not-owner"], since: "7.149.0" },
|
|
1044
|
+
"owner-only session ports#unreadable-archive-ownerless-session-fleet-or-operator": { attr: "answered as on a readable archive: background · background/stop · notify · mcp/reconnect · execution-placement · approval exemptions list / revoke (the gate skips the placement read only when both hypotheses admit the caller); was 500 corrupt_session", since: "7.148.0" },
|
|
1013
1045
|
"run faces#row-without-owner-cell-no-fleet-no-operator": { attr: "the face's missing-row answer for every caller without a fleet or operator qualification on that face; was: a caller without a principal passed on some faces (absent equals absent)", since: "7.148.0" },
|
|
1014
|
-
"POST /v1/tool-approvals/:id/respond#ask-not-visible-to-caller(查无 / 不是调用方的 / 行读不出 / 本 worker 没有问账)": { attr: "404 not_found.ask (no such approval ask (never existed, no longer kept, or not yours)), one body for every form, no state facts — the durable decision door's word; was 404 tool_approval.not_pending with cause unknown_or_other_replica (no cause on a worker without an ask ledger)",
|
|
1015
|
-
"GET /v1/tool-approvals/:id#ask-not-visible-to-caller(查无 / 不是调用方的 / 行读不出 / 本 worker 没有问账)": { attr: "404 not_found.ask, the same body as the respond door; was 404 tool_approval.not_pending with cause unknown_or_other_replica (no cause on a worker without an ask ledger)",
|
|
1016
|
-
"GET /v1/workflows/:id · /journal · /stream · POST /v1/workflows/:id/agents/:label/steer#session-assertion-mismatch": { attr: "404 not_found.workflow (workflow not found), same body as a missing workflow; was 404 not_found.run (workflow not found)",
|
|
1046
|
+
"POST /v1/tool-approvals/:id/respond#ask-not-visible-to-caller(查无 / 不是调用方的 / 行读不出 / 本 worker 没有问账)": { attr: "404 not_found.ask (no such approval ask (never existed, no longer kept, or not yours)), one body for every form, no state facts — the durable decision door's word; was 404 tool_approval.not_pending with cause unknown_or_other_replica (no cause on a worker without an ask ledger)", since: "7.148.0" },
|
|
1047
|
+
"GET /v1/tool-approvals/:id#ask-not-visible-to-caller(查无 / 不是调用方的 / 行读不出 / 本 worker 没有问账)": { attr: "404 not_found.ask, the same body as the respond door; was 404 tool_approval.not_pending with cause unknown_or_other_replica (no cause on a worker without an ask ledger)", since: "7.148.0" },
|
|
1048
|
+
"GET /v1/workflows/:id · /journal · /stream · POST /v1/workflows/:id/agents/:label/steer#session-assertion-mismatch": { attr: "404 not_found.workflow (workflow not found), same body as a missing workflow; was 404 not_found.run (workflow not found)", since: "7.148.0" },
|
|
1017
1049
|
},
|
|
1018
1050
|
},
|
|
1019
1051
|
sessionRewindFilesWire: {
|
|
@@ -1102,7 +1134,7 @@ export const SELF_MINTED_WIRE = {
|
|
|
1102
1134
|
members: {
|
|
1103
1135
|
"401 auth.unauthorized#operator(/metrics* · GET /v1/tasks/source-summary)": { attr: "… send the deployment's service token … without a principal header where this deployment lets its service token act for the deployment itself (GET /health reports it as auth.serviceTokenActsForDeployment; …), or a read-only token this endpoint accepts (…)", since: "7.146.0" },
|
|
1104
1136
|
"422 invalid_entries#row_contract(会话同步推送第二阶段;收编批量导入同句进逐元素 detail)": { attr: "malformed entry (id and parentId must be strings of 1-64 characters, type a string of 1-32 characters)", since: "7.146.0" },
|
|
1105
|
-
"404 not_found.run#a*/wa* id(compact · detach · 子代动词口;各 run 口的非属主臂)": { attr: "run not found — \"<id>\" looks like an agent handle (a*/wa* domain) … (the handle hint, same sentence as the missing-row arm)",
|
|
1137
|
+
"404 not_found.run#a*/wa* id(compact · detach · 子代动词口;各 run 口的非属主臂)": { attr: "run not found — \"<id>\" looks like an agent handle (a*/wa* domain) … (the handle hint, same sentence as the missing-row arm)", since: "7.148.0" },
|
|
1106
1138
|
"409 decide.row_unrevivable#no_root_anchor": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
|
|
1107
1139
|
"400 request.field_invalid#mcpServers.over_cap(受理口 · POST /v1/capabilities/mcp/probe 同句)": { attr: "head: <field> has <count> entries — at most <cap> are accepted", since: "7.136.0" },
|
|
1108
1140
|
"400 request.field_invalid#a2aPeers.over_cap": { attr: "tail: 声明列表拒绝骨架的句尾(与 mcpServers 共用 request-declaration-refusal)", since: "7.136.0" },
|
|
@@ -1113,7 +1145,7 @@ export const SELF_MINTED_WIRE = {
|
|
|
1113
1145
|
"connect_failed(run 失败终局)#snapshot_bucket_missing(k8s 车道读 latest 得 404 NoSuchBucket;连沙箱失败,一只 pod 都不建)": { attr: "workspace space pointer read failed (snapshot_bucket_missing): the workspace snapshot bucket <name> (WORKSPACE_SNAPSHOT_BUCKET; default workspaces) does not exist in the object store — refusing to start this run … Ways out: create the bucket, or set WORKSPACE_SNAPSHOT_BUCKET to one that exists, or set WORKSPACE_PERSIST=off …", since: "7.136.0" },
|
|
1114
1146
|
"400 request.field_invalid#images[i].url.credential": { attr: "<field> <规则句> — the URL is kept as written (a parked task's resume context, logs), while images[i] can carry the image bytes inline: send { data, mimeType } instead of a URL that holds the credential", since: "7.136.0" },
|
|
1115
1147
|
"400 request.field_invalid#images.not_array": { attr: "head: images is <shape>, not an array of image entries", since: "7.148.0" },
|
|
1116
|
-
"400 request.field_invalid#images[i].not_object": { attr: "head: images[i] is <shape>, not an image entry (an object)",
|
|
1148
|
+
"400 request.field_invalid#images[i].not_object": { attr: "head: images[i] is <shape>, not an image entry (an object)", since: "7.148.0" },
|
|
1117
1149
|
"400 request.field_invalid#images[i].<key>.unusable": { attr: "<field> is not a usable declaration — must be a string (…) — got <shape>. The request is refused rather than handing the engine an image it cannot read: … Fix the entry (an image is either { data, mimeType } or { url }).", since: "7.148.0" },
|
|
1118
1150
|
"400 request.body_shape#images[i].unknown_key": { attr: "body: unrecognized key(s) on an image entry — refused rather than dropped …; Accepted: <keys of the form>", since: "7.148.0" },
|
|
1119
1151
|
"400 request.field_invalid#settings.env.compose": { attr: "settings.env cannot be composed into a child process environment — <the engine's verdict, sanitized>. The request is refused rather than accepted into a task whose hooks and shell would fail to start: fix or remove the variable concerned", since: "7.148.0" },
|
|
@@ -5,7 +5,8 @@ import { DEFAULT_MODEL_REF, buildEnvModelIdNotServedNotice, mintCapabilityKeys,
|
|
|
5
5
|
import { applyAutoCompactWindow, buildModelCostKey, isRosterGateArmed, ownCredentialHitsInForce, parseAutonomy, unmatchableToolNamesRefusal } from "../config.js";
|
|
6
6
|
import { NAME_TABLE_BEHAVIOR, retiredLeftOutEntries } from "../namespaced-rule-name.js";
|
|
7
7
|
import { buildModelCompat, readModelCompat } from "../model-compat.js";
|
|
8
|
-
import {
|
|
8
|
+
import { resolveContextWindow } from "../model-context-window.js";
|
|
9
|
+
import { warnAssumedContextWindows } from "../context-window-notice.js";
|
|
9
10
|
import { buildModelHeadersKey } from "../model-entry-headers.js";
|
|
10
11
|
import { validateCommandRules } from "../runtime-governance.js";
|
|
11
12
|
import { stageLimits } from "./stage-limits.js";
|
|
@@ -27,7 +28,7 @@ function envDerivedModel(config) {
|
|
|
27
28
|
}
|
|
28
29
|
return m;
|
|
29
30
|
}
|
|
30
|
-
function toModel(m, envDefaults = {}, logger) {
|
|
31
|
+
function toModel(m, window, envDefaults = {}, logger) {
|
|
31
32
|
const thinkingDefault = envDefaults.defaultThinking;
|
|
32
33
|
const declared = readModelCompat(m.api, m.compat);
|
|
33
34
|
if (!declared.ok)
|
|
@@ -41,7 +42,7 @@ function toModel(m, envDefaults = {}, logger) {
|
|
|
41
42
|
api: m.api,
|
|
42
43
|
baseUrl: m.baseUrl ?? "",
|
|
43
44
|
...mintCapabilityKeys({ reasoning: m.reasoning, vision: m.vision }),
|
|
44
|
-
contextWindow:
|
|
45
|
+
contextWindow: window.window,
|
|
45
46
|
maxTokens: m.maxTokens ?? envDefaults.maxTokens ?? 4096,
|
|
46
47
|
...(m.charsPerToken !== undefined || envDefaults.charsPerToken !== undefined ? { charsPerToken: m.charsPerToken ?? envDefaults.charsPerToken } : {}),
|
|
47
48
|
...buildModelCostKey(m.cost),
|
|
@@ -96,6 +97,7 @@ function envModelPlaneOf(config) {
|
|
|
96
97
|
if (snap === undefined) {
|
|
97
98
|
snap = {
|
|
98
99
|
models: { ...config.models },
|
|
100
|
+
contextWindowSources: { ...config.contextWindowSources },
|
|
99
101
|
model: config.envModel,
|
|
100
102
|
modelApiKeyEnv: { ...config.modelApiKeyEnv },
|
|
101
103
|
modelApiKeys: { ...config.modelApiKeys },
|
|
@@ -192,6 +194,8 @@ export function applyEffective(config, eff, logger, opts) {
|
|
|
192
194
|
}
|
|
193
195
|
if (mp !== undefined)
|
|
194
196
|
warnDanglingEnvBindings(config, staged.modelPlaneGroup.envBindingsDangling ?? [], logger);
|
|
197
|
+
if (mp !== undefined)
|
|
198
|
+
warnAssumedContextWindows(config, logger, { envTableIsPlaceholder: isRosterGateArmed(config.webAdmin) });
|
|
195
199
|
if (staged.approvalGate.next !== undefined)
|
|
196
200
|
logger?.info("web_admin_runtime", { version: staged.version, approvalRequire: staged.approvalGate.next });
|
|
197
201
|
if (Object.keys(staged.hot.infoLine).length > 0)
|
|
@@ -217,9 +221,9 @@ function declareCandidateWithheldEnv(seats, modelApiKeyEnv, version) {
|
|
|
217
221
|
if (handedOn.length === 0)
|
|
218
222
|
return;
|
|
219
223
|
withdrawServerWithheldEnv();
|
|
220
|
-
throw new Error(`model catalog (effective v${version}): a model entry's apiKeyEnv
|
|
224
|
+
throw new Error(`model catalog (effective v${version}): a model entry's apiKeyEnv makes a variable a name-list env knob hands on one of this deployment's own credentials (by its name, or by its value under another name) — ` +
|
|
221
225
|
handedOn.map((h) => `env ${h.knob} hands on ${h.name}, which this candidate makes ${h.problem}`).join("; ") +
|
|
222
|
-
`; or point that entry's apiKeyEnv at a variable no name list hands on. The name lists are read at boot (changing one takes a restart); ` +
|
|
226
|
+
`; or point that entry's apiKeyEnv at a variable that no name list hands on and whose value no handed-on variable holds. The name lists are read at boot (changing one takes a restart); ` +
|
|
223
227
|
`the candidate is refused whole and the current generation keeps serving (entries: ${entries}).`);
|
|
224
228
|
}
|
|
225
229
|
function commitStaged(config, staged) {
|
|
@@ -231,6 +235,7 @@ function commitStaged(config, staged) {
|
|
|
231
235
|
config.droppedCatalogEntries = mp.droppedCatalogEntries;
|
|
232
236
|
mutateInPlace(config.modelQuotaWeights, mp.quotaWeights);
|
|
233
237
|
mutateInPlace(config.models, mp.models);
|
|
238
|
+
config.contextWindowSources = mp.contextWindowSources;
|
|
234
239
|
config.model = mp.model;
|
|
235
240
|
mutateInPlace(config.roles, mp.roles);
|
|
236
241
|
mutateInPlace(config.tiers, mp.activeTiers);
|
|
@@ -254,7 +259,7 @@ function commitStaged(config, staged) {
|
|
|
254
259
|
}
|
|
255
260
|
export const MODEL_PLANE_DOMAINS = ["models"];
|
|
256
261
|
const MODEL_PLANE_SURFACES = {
|
|
257
|
-
models: ["models", "model", "modelRefusals", "droppedCatalogEntries", "modelApiKeyEnv", "modelApiKeys", "modelQuotaWeights", "roles", "tiers", "atMention"],
|
|
262
|
+
models: ["models", "contextWindowSources", "model", "modelRefusals", "droppedCatalogEntries", "modelApiKeyEnv", "modelApiKeys", "modelQuotaWeights", "roles", "tiers", "atMention"],
|
|
258
263
|
};
|
|
259
264
|
const MODEL_PLANE_GROUP_KEYS = MODEL_PLANE_DOMAINS.flatMap((d) => MODEL_PLANE_SURFACES[d]);
|
|
260
265
|
export function withModelPlaneOf(target, source) {
|
|
@@ -351,6 +356,7 @@ function stageEnvModelPlane(config) {
|
|
|
351
356
|
stages: {
|
|
352
357
|
models: {
|
|
353
358
|
...snap,
|
|
359
|
+
contextWindowSources: { ...snap.contextWindowSources },
|
|
354
360
|
modelApiKeyEnv: { ...snap.modelApiKeyEnv },
|
|
355
361
|
modelApiKeys: { ...snap.modelApiKeys },
|
|
356
362
|
modelRefusals: { ...snap.modelRefusals },
|
|
@@ -392,14 +398,18 @@ function stageModelPlane(config, eff, source, logger, sealedKeys) {
|
|
|
392
398
|
return refuse(REFUSED_NAME_MINTED_CODE, malformedDroppedCarrierRefusal(verdict.malformed), { entries: [...verdict.malformed] });
|
|
393
399
|
const usable = verdict.usable;
|
|
394
400
|
const models = {};
|
|
401
|
+
const contextWindowSources = {};
|
|
395
402
|
const modelApiKeyEnv = {};
|
|
396
403
|
const modelApiKeys = {};
|
|
397
404
|
const envModel = envDerivedModel(config);
|
|
398
|
-
const envDefaults = { maxTokens: envModel.maxTokens,
|
|
405
|
+
const envDefaults = { maxTokens: envModel.maxTokens, charsPerToken: envModel.charsPerToken, defaultThinking: envModel.defaultThinking, api: envModel.api, compat: envModel.compat };
|
|
406
|
+
const envWindow = { window: envModel.contextWindow, source: config.envModelContextWindowSource };
|
|
399
407
|
for (const m of usable) {
|
|
400
408
|
if (m.baseUrl)
|
|
401
409
|
logger?.warn("web_admin_model_base_url", { model: m.name, baseUrl: buildDisplaySafeUrl(m.baseUrl), hint: "registry-directed gateway override — this model's key authenticates AGAINST THIS URL" });
|
|
402
|
-
|
|
410
|
+
const window = resolveContextWindow(m.contextWindow, envWindow);
|
|
411
|
+
models[m.name] = toModel(m, window, envDefaults, logger);
|
|
412
|
+
contextWindowSources[m.name] = window.source;
|
|
403
413
|
if (m.sealedApiKey) {
|
|
404
414
|
const s = m.sealedApiKey;
|
|
405
415
|
if (!sealedKeys) {
|
|
@@ -482,8 +492,10 @@ function stageModelPlane(config, eff, source, logger, sealedKeys) {
|
|
|
482
492
|
throw new Error(`catalog default: unknown kind ${JSON.stringify(unhandled)}`);
|
|
483
493
|
}
|
|
484
494
|
}
|
|
485
|
-
if (picked !== undefined)
|
|
495
|
+
if (picked !== undefined) {
|
|
486
496
|
models.default = models[picked.name];
|
|
497
|
+
contextWindowSources.default = contextWindowSources[picked.name];
|
|
498
|
+
}
|
|
487
499
|
}
|
|
488
500
|
const nextView = { ...config, models, tiers: activeTiers, modelRefusals: verdict.refused };
|
|
489
501
|
const noDefault = crossInvariant("default-model-resolvable").check({ live: config, next: nextView });
|
|
@@ -507,6 +519,7 @@ function stageModelPlane(config, eff, source, logger, sealedKeys) {
|
|
|
507
519
|
const envBindingsDangling = danglingEnvBindingsOf(envPlane.roles, centerRoles, envModelTableOf(config), expandTiers(models, activeTiers) ?? models);
|
|
508
520
|
const plane = {
|
|
509
521
|
models,
|
|
522
|
+
contextWindowSources,
|
|
510
523
|
model: defaultModel,
|
|
511
524
|
modelApiKeyEnv,
|
|
512
525
|
modelApiKeys,
|