Skip to content

P1: Do not override configured target mode with CLI default session #3

@vamgan

Description

@vamgan

Problem

The run command registers --target-mode with Commander default "session".

Relevant code:

  • src/index.ts:83
  • src/index.ts:212-214

Because Commander always supplies the default, runtime profile/default config target mode is ignored:

mode: options.targetMode ?? runtimeProfile?.target?.mode ?? config.defaults?.targetMode ?? "session"

A runtime profile with target.mode: "runtime" silently dispatches as session.

Suggested fix

Remove the Commander default:

.option("--target-mode <mode>", "Target mode")

Keep the fallback in createDispatchRequest().

Acceptance criteria

  • Test where runtime profile has target.mode: "runtime" and no CLI --target-mode; request uses runtime.
  • Explicit CLI --target-mode session still overrides config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions