Skip to content

[Feature]: ocx combo set --targets without --strategy should keep an existing JEV Combo and its policy #7579

Closed

Description

@lidge-jun

Area

CLI

What are you trying to accomplish?

Replace the target list of an existing JEV Combo from the CLI while keeping the Combo a JEV Combo, with its decision method, quota policy and session pin intact:

ocx combo set jev-auto --targets sol/gpt-5.6-sol,luna/gpt-5.6-luna --json

What prevents this today?

When --targets is given and --strategy is omitted, ocx combo set does not read the existing Combo. It sends a fresh body with strategy: "failover" (src/cli/combo.ts: the existing row is fetched only when targetsRaw === undefined, and the strategy falls back to "failover"). The server stores that body, so the Combo silently stops being a JEV Combo, and every JEV-only field is dropped: decisionProvider, decisionModel, decisionTimeoutMs, decisionQuotaSignals, decisionQuotaTiers and sessionPin.

This is currently documented (docs-site/src/content/docs/reference/cli/agents.md: "--targets alone keeps the existing failover default"). It still surprises in practice, because the help text says existing fields are read before writing, and --targets-file, --targets together with --strategy jev, and rename all preserve the policy. CodeRabbit flagged it as Major on #7567 (review). I left it out of that PR because it changes an existing CLI contract.

What should OpenCodex do?

When --strategy is omitted and the Combo already exists, ocx combo set --targets ... should start from the stored row, exactly as the no---targets path and --targets-file already do. It should replace only the targets and keep the stored strategy and all strategy-specific fields. Creating a new Combo would still default to failover. An explicit --strategy keeps its current meaning, including dropping JEV-only fields when switching away from jev.

Example usage or interface

# existing: { "strategy": "jev", "decisionQuotaSignals": true, "sessionPin": { "ttlMs": 1200000 }, ... }
ocx combo set jev-auto --targets sol/gpt-5.6-sol,luna/gpt-5.6-luna --json
# expected: strategy stays "jev"; decisionQuotaSignals and sessionPin unchanged; only targets replaced

Alternatives or workarounds

Pass --strategy jev together with --targets, or use --targets-file; both preserve the stored JEV policy today.

Additional context

Regression coverage would sit beside tests/routing/jev-quota-config.test.ts and tests/cli/cli-combo-session-pin.test.ts. The docs sentence in reference/cli/agents.md and the matching guide text would need to change with the behavior.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

  1. lidge-jun commented on Oct 23, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #7601: ocx combo set <id> --targets ... without --strategy now keeps the stored strategy and, for a JEV combo, its decision method, quota policy and session pin. When the new targets don't fit the JEV policy, PUT /api/combos answers 400 with an additive field and the CLI explains that the JEV combo was kept. Closing manually because GitHub only auto-closes from main; it ships in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliCLI, config inject, packaging flagsenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions