Skip to content

Commit ee26409

Browse files
committed
Merge remote-tracking branch 'origin/dev' into fix/7423-update-teardown-handover
2 parents 6418cc8 + 852bf9d commit ee26409

32 files changed

Lines changed: 899 additions & 77 deletions

‎docs-site/src/content/docs/getting-started/installation.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ Recent npm versions may block bun's postinstall script (`npm warn
3838
install-scripts ... blocked because they are not covered by allowScripts`),
3939
which leaves the bundled Bun runtime unprepared. After trying permitted bundled-runtime
4040
recovery, the launcher can use an executable Bun from an absolute PATH directory if its
41-
stable version has the pinned major and a minor at least the pinned minor. With the current
42-
1.4.4 dependency, that means 1.4.0 or newer within major 1. Bounded version-policy and identity
41+
stable version has the pinned major and a version at least the pinned version. With the current
42+
1.4.4 dependency, that means 1.4.4 or newer within major 1. Bounded version-policy and identity
4343
checks require `bun --version` to match `bun -e`'s `Bun.version`. On POSIX, the launcher checks
4444
the whole candidate path, including ancestor directories and components reached through
4545
symlinks. Each traversed directory and symlink, and the resolved executable, must be owned by

‎docs-site/src/content/docs/guides/combos.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,3 +1029,31 @@ validation message.
10291029

10301030
The error was terminal rather than target-specific. Fix invalid input, reduce an oversized context,
10311031
handle a policy refusal, or correct the rejected request origin. Combos do not hop for those cases.
1032+
1033+
## Retry all-cooled targets (opt-in)
1034+
1035+
Combo cooldown recovery is opt-in and disabled by default. To allow one new
1036+
failover pass when every otherwise eligible target has a saved combo cooldown:
1037+
1038+
```sh
1039+
ocx combo set review --cooldown-reprobe on --cooldown-reprobe-interval 300000
1040+
ocx combo set review --cooldown-reprobe off
1041+
```
1042+
1043+
The corresponding per-combo configuration is:
1044+
1045+
```json
1046+
{ "cooldownReprobe": { "enabled": true, "intervalMs": 300000 } }
1047+
```
1048+
1049+
The default interval is five minutes; accepted values are integer milliseconds
1050+
from 1000 to 86400000. Setting the interval alone does not enable recovery.
1051+
Recovery is demand-driven: the first eligible request can reserve a pass immediately,
1052+
and later passes are separated by at least the configured interval. There is no timer
1053+
or background traffic. Each target can be attempted once in the request's existing
1054+
failover budget; failures record fresh cooldowns. Account quota checks, disabled
1055+
providers, request compatibility, metered-spend permissions and cancellation remain
1056+
enforced. Explicit provider Retry-After values may therefore be retried early only
1057+
when the operator enables this option. Preview/list operations never clear cooldowns.
1058+
The interval is tracked per combo in memory and resets on proxy restart or combo
1059+
selection-state reset. Existing cooldown-wait behavior is unchanged when disabled.

‎docs-site/src/content/docs/ko/getting-started/installation.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ npm install -g @bitkyc08/opencodex
2626
install-scripts ... blocked because they are not covered by allowScripts`).
2727
이 경우 번들 Bun 런타임이 준비되지 않을 수 있습니다. 런처는 허용된 번들 복구를
2828
시도한 다음, 절대 경로 PATH 디렉터리의 실행 가능한 Bun을 검증합니다. 정식 버전의
29-
major가 패키지 pin과 같고 minor가 pin 이상이면 사용할 수 있습니다. 현재 의존성
30-
1.4.4에서는 1.4.0 이상, 2.0.0 미만입니다. 제한 시간 안에 버전 정책과 identity를 확인하며,
29+
major가 패키지 pin과 같고 버전이 pin 이상이면 사용할 수 있습니다. 현재 의존성
30+
1.4.4에서는 1.4.4 이상, 2.0.0 미만입니다. 제한 시간 안에 버전 정책과 identity를 확인하며,
3131
`bun --version` 출력이 `bun -e`로 확인한 `Bun.version`과 같아야 합니다. POSIX에서는 런처가
3232
상위 디렉터리와 심볼릭 링크를 따라 도달하는 구성 요소를 포함한 후보 경로 전체를 검사합니다.
3333
검사하는 각 디렉터리와 심볼릭 링크, 최종 실행 파일은 root 또는 런처의 유효 사용자 소유여야 합니다.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"combo-cooldown-reprobe.test.ts": "codex-integration"
3+
}

‎scripts/test-layout/layout.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 1,
33
"root": "tests",
4-
"explicitShards": ["layout-clients.json", "layout-codex-collision.json", "layout-agent-assertion.json", "layout-chat.json", "layout-replay.json", "layout-adapters.json", "layout-jev.json", "layout-workbuddy.json"],
4+
"explicitShards": ["layout-clients.json", "layout-codex-collision.json", "layout-agent-assertion.json", "layout-chat.json", "layout-replay.json", "layout-adapters.json", "layout-jev.json", "layout-workbuddy.json", "layout-combos.json"],
55
"explicit": { "combo-description.test.ts": "routing", "combo-description-catalog.test.ts": "codex-integration", "codex-provider-routing.test.ts": "codex-integration", "config-native-reasoning-retention.test.ts": "config", "server-native-reasoning-retention-merge.test.ts": "server", "server-native-reasoning-retention.test.ts": "server", "responses-retained-reasoning-stream-recovery.test.ts": "responses", "openai-native-hosted-search-history.test.ts": "adapters/openai", "responses-native-compact-search-history.test.ts": "responses", "config-hosted-search-projection.test.ts": "config", "gcp-credential-boundary.test.ts": "adapters/google", "gcp-sa-marker.test.ts": "adapters/google", "gcp-sa-adapter.test.ts": "adapters/google", "management-gcp-credential-input.test.ts": "server", "codex-preserve-signed-in.test.ts": "codex-integration", "cli-account-preservation.test.ts": "cli", "cli-provider-list-active.test.ts": "cli", "service-state-isolation.test.ts": "service", "compaction-history-framing.test.ts": "responses", "catalog-native-max-context.test.ts": "codex-integration", "protocol-argon-thought-boundary.test.ts": "responses", "service-log.test.ts": "service", "messages-native-empty-inline.test.ts": "claude-integration", "catalog-auto-review-override.test.ts": "codex-integration", "management-auto-review-settings.test.ts": "server", "management-auto-review-auth.test.ts": "server", "prefer-model-alias-ids.test.ts": "server", "responses-mimo-envelope.test.ts": "responses", "responses-call-id-linkage.test.ts": "responses", "bridge-terminal-refusal.test.ts": "adapters", "loop-terminal-refusal.test.ts": "images", "web-search-terminal-refusal.test.ts": "web-search", "combo-terminal-refusal.test.ts": "routing", "server-terminal-refusal-wiring.test.ts": "server", "incomplete-reason-normalization.test.ts": "responses", "advisor-retention.test.ts": "advisor", "responses-native-key-cooldown.test.ts": "responses", "responses-run-turn-key-readmission.test.ts": "responses", "qoder-spawn-readmission.test.ts": "adapters", "api-key-selection-cooldown.test.ts": "providers", "api-key-auto-pause-distribution.test.ts": "providers", "explicit-key-pause-oauth-boundary.test.ts": "providers", "server-chat-native-key-selection.test.ts": "server", "compact-key-selection.test.ts": "responses", "messages-native-key-selection.test.ts": "claude-integration", "coding-agent-windows-dispatch.test.ts": "adapters", "coding-agent-native-empty-argv.test.ts": "windows",
66
"service-proxy-env.test.ts": "service", "openai-chat-standalone-bare-block.test.ts": "adapters/openai",
77
"owner-registry-isolation.test.ts": "config",

‎skills/ocx/references/01_surface_agents-routing.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ State-changing: no. JSON mode: `payload`.
958958

959959
### `ocx combo set`
960960

961-
Usage: `ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--json]`
961+
Usage: `ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--cooldown-reprobe <on|off>] [--cooldown-reprobe-interval <ms>] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--json]`
962962

963963
Create, update or rename a combo.
964964

@@ -975,6 +975,8 @@ State-changing: yes. JSON mode: `payload`.
975975
| `--targets` | string | Ordered provider/model[:weight] list; required for creation. |
976976
| `--strategy` | string | Routing strategy. |
977977
| `--sticky` | string | Round-robin limit 1-100; - resets. |
978+
| `--cooldown-reprobe` | string | Opt into one recovery pass when all eligible targets cool; off by default. |
979+
| `--cooldown-reprobe-interval` | string | Minimum interval between recovery passes in ms (1000..86400000); default 300000. |
978980
| `--effort` | string | Default effort; - clears. |
979981
| `--effort-mode` | string | fallback or force; - resets to fallback. |
980982
| `--alias` | string | Alias; - clears. |

‎src/cli/capabilities-agents-routing.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ export const AGENT_ROUTING_CAPABILITIES: readonly Capability[] = [
385385
},
386386
{
387387
command: ["combo","set"],
388-
usage: "ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--json]",
388+
usage: "ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->] [--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->] [--cooldown-reprobe <on|off>] [--cooldown-reprobe-interval <ms>] [--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->] [--alias <name|->] [--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->] [--description <text|->] [--decision-provider <provider|-> | --decision-model <route|->] [--decision-timeout <ms|->] [--decision-quota-signals <on|off|->] [--decision-quota-tiers <JSON|->] [--session-pin <duration|->] [--rename-from <id>] [--image-input <auto|disabled>] [--reasoning-effort-mode <strict|adaptive>] [--json]",
389389
summary: "Create, update or rename a combo.",
390390
routes: [{"method":"GET","path":"/api/combos"},{"method":"PUT","path":"/api/combos"}],
391-
flags: [{"name":"--allow-metered-targets","value":"string","summary":"on grants operator consent to metered targets only on a loopback-only proxy; off clears it."},{"name":"--targets","value":"string","summary":"Ordered provider/model[:weight] list; required for creation."},{"name":"--strategy","value":"string","summary":"Routing strategy."},{"name":"--sticky","value":"string","summary":"Round-robin limit 1-100; - resets."},{"name":"--effort","value":"string","summary":"Default effort; - clears."},{"name":"--effort-mode","value":"string","summary":"fallback or force; - resets to fallback."},{"name":"--alias","value":"string","summary":"Alias; - clears."},{"name":"--display-name","value":"string","summary":"Label; - clears."},{"name":"--description","value":"string","summary":"Catalog row description; - clears."},{"name":"--decision-provider","value":"string","summary":"JEV provider; - clears."},{"name":"--decision-model","value":"string","summary":"JEV route; - clears; exclusive with provider."},{"name":"--decision-timeout","value":"string","summary":"JEV deadline 1000-120000 ms; - clears."},{"name":"--decision-quota-signals","value":"string","summary":"JEV advisory quota on/off; - clears."},{"name":"--decision-quota-tiers","value":"string","summary":"Partial JSON thresholds; - clears."},{"name":"--session-pin","value":"string","summary":"JEV session pin idle window 1m-24h (90s, 20m, 1h); - clears."},{"name":"--rename-from","value":"string","summary":"Existing combo ID to rename."},{"name":"--json","value":"boolean","summary":"Emit structured JSON."},{"name":"--native-alias","value":"string","summary":"Bare legacy flag means on; explicit on/off preserves presence, including false."},{"name":"--targets-file","value":"string","summary":"Bounded ordered target JSON array, exclusive with --targets; preserves effort/profile/last-resort metadata."},{"name":"--image-input","value":"string","summary":"auto or disabled; explicit auto clears the previous disabled choice."},{"name":"--reasoning-effort-mode","value":"string","summary":"strict or adaptive, distinct from --effort-mode fallback/force."}],
391+
flags: [{"name":"--allow-metered-targets","value":"string","summary":"on grants operator consent to metered targets only on a loopback-only proxy; off clears it."},{"name":"--targets","value":"string","summary":"Ordered provider/model[:weight] list; required for creation."},{"name":"--strategy","value":"string","summary":"Routing strategy."},{"name":"--sticky","value":"string","summary":"Round-robin limit 1-100; - resets."},{"name":"--cooldown-reprobe","value":"string","summary":"Opt into one recovery pass when all eligible targets cool; off by default."},{"name":"--cooldown-reprobe-interval","value":"string","summary":"Minimum interval between recovery passes in ms (1000..86400000); default 300000."},{"name":"--effort","value":"string","summary":"Default effort; - clears."},{"name":"--effort-mode","value":"string","summary":"fallback or force; - resets to fallback."},{"name":"--alias","value":"string","summary":"Alias; - clears."},{"name":"--display-name","value":"string","summary":"Label; - clears."},{"name":"--description","value":"string","summary":"Catalog row description; - clears."},{"name":"--decision-provider","value":"string","summary":"JEV provider; - clears."},{"name":"--decision-model","value":"string","summary":"JEV route; - clears; exclusive with provider."},{"name":"--decision-timeout","value":"string","summary":"JEV deadline 1000-120000 ms; - clears."},{"name":"--decision-quota-signals","value":"string","summary":"JEV advisory quota on/off; - clears."},{"name":"--decision-quota-tiers","value":"string","summary":"Partial JSON thresholds; - clears."},{"name":"--session-pin","value":"string","summary":"JEV session pin idle window 1m-24h (90s, 20m, 1h); - clears."},{"name":"--rename-from","value":"string","summary":"Existing combo ID to rename."},{"name":"--json","value":"boolean","summary":"Emit structured JSON."},{"name":"--native-alias","value":"string","summary":"Bare legacy flag means on; explicit on/off preserves presence, including false."},{"name":"--targets-file","value":"string","summary":"Bounded ordered target JSON array, exclusive with --targets; preserves effort/profile/last-resort metadata."},{"name":"--image-input","value":"string","summary":"auto or disabled; explicit auto clears the previous disabled choice."},{"name":"--reasoning-effort-mode","value":"string","summary":"strict or adaptive, distinct from --effort-mode fallback/force."}],
392392
mutates: true,
393393
json: "payload",
394394
details: ["create and update are aliases of set. Existing fields are read before writing; --targets replaces targets. Without --strategy an existing combo keeps its stored strategy and JEV policy; a new combo defaults to failover.","force overrides valid client effort and may increase cost and latency.","Only the implemented target grammar is supported; full GUI target metadata and routing-profile writes are separate tasks.","New file/flag conflicts refuse before transport. Partial edits preserve target metadata; explicit false/default values override server carry. Turning a native alias off may also require clearing its incompatible alias.","Read/merge/write uses one target and remains an upsert without revision CAS. Saved-but-incomplete catalog outcomes return nonzero with their receipt."],

‎src/cli/combo-result.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ function publicCombo(value: unknown): Record<string, unknown> {
4040
if (!tiers) invalid();
4141
result[key] = tiers;
4242
continue;
43+
} else if (key === "cooldownReprobe") {
44+
if (!record(child) || typeof child.enabled !== "boolean"
45+
|| Object.keys(child).some(field => field !== "enabled" && field !== "intervalMs")) invalid();
46+
if (child.intervalMs !== undefined && (typeof child.intervalMs !== "number"
47+
|| !Number.isSafeInteger(child.intervalMs) || child.intervalMs < 1000 || child.intervalMs > 86_400_000)) invalid();
48+
result[key] = { enabled: child.enabled, ...(child.intervalMs !== undefined ? { intervalMs: child.intervalMs } : {}) };
49+
continue;
4350
} else if (key === "sessionPin") {
4451
const pin = normalizeJevSessionPin(child);
4552
if (!pin) invalid();

‎src/cli/combo.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const USAGE = `Usage:
2424
ocx combo show <id> [--json]
2525
ocx combo set <id> [--targets <provider/model[:weight],...> | --targets-file <FILE|->]
2626
[--strategy <failover|round-robin|random|least-used|reset-window|jev>] [--sticky <1-100|->]
27+
[--cooldown-reprobe <on|off>] [--cooldown-reprobe-interval <ms>]
2728
[--effort <low|medium|high|xhigh|max|ultra|->] [--effort-mode <fallback|force|->]
2829
(force overrides valid client effort and can increase cost/latency) [--alias <name|->]
2930
[--native-alias [on|off]] [--allow-metered-targets <on|off>] [--display-name <label|->]
@@ -114,6 +115,16 @@ async function set(argv: string[], deps: RuntimeApiDeps): Promise<number> {
114115
throw new CliUsageError("--sticky must be an integer from 1 to 100, or -", USAGE);
115116
}
116117
if (stickyLimit !== undefined && stickyLimit > 100) throw new CliUsageError("--sticky must be <= 100", USAGE);
118+
const reprobe = takeOption(args, "--cooldown-reprobe");
119+
const reprobeInterval = takeOption(args, "--cooldown-reprobe-interval");
120+
if (reprobe !== undefined && reprobe !== "on" && reprobe !== "off") {
121+
throw new CliUsageError("--cooldown-reprobe must be on or off", USAGE);
122+
}
123+
const reprobeIntervalMs = reprobeInterval === undefined ? undefined : Number(reprobeInterval);
124+
if (reprobeIntervalMs !== undefined && (!Number.isSafeInteger(reprobeIntervalMs)
125+
|| reprobeIntervalMs < 1000 || reprobeIntervalMs > 86_400_000)) {
126+
throw new CliUsageError("--cooldown-reprobe-interval must be an integer from 1000 to 86400000 ms", USAGE);
127+
}
117128
const effort = takeOption(args, "--effort");
118129
const effortMode = takeOption(args, "--effort-mode");
119130
if (effortMode !== undefined && effortMode !== "fallback" && effortMode !== "force" && effortMode !== "-") {
@@ -180,6 +191,13 @@ async function set(argv: string[], deps: RuntimeApiDeps): Promise<number> {
180191
const combo: Record<string, unknown> = existing
181192
? Object.fromEntries(Object.entries(existing).filter(([, value]) => value !== null))
182193
: { strategy, stickyLimit: stickyLimit ?? 1 };
194+
if (reprobe !== undefined || reprobeIntervalMs !== undefined) {
195+
const previous = (combo.cooldownReprobe ?? {}) as { enabled?: boolean; intervalMs?: number };
196+
combo.cooldownReprobe = { ...previous,
197+
enabled: reprobe === undefined ? previous.enabled === true : reprobe === "on",
198+
...(reprobeIntervalMs !== undefined ? { intervalMs: reprobeIntervalMs } : {}),
199+
};
200+
}
183201
delete combo.id;
184202
delete combo.model;
185203
if (replacingTargets) combo.targets = additional.targets ?? parsedTargets;

0 commit comments

Comments
 (0)