Skip to content

[BUG] [v0.0.7] cortex agent show --model <bad> accepts any string without validation — inconsistent with cortex agent generate --model` which validates and bails #48570

@FredAmalasuintha311

Description

@FredAmalasuintha311

Project

cortex

Description

run_show includes the --model override in JSON/text output without calling validate_model_name. run_generate calls validate_model_name(model_arg)? and bails on invalid formats. A user running cortex agent show my-agent --model 'not/a/model' receives output with the invalid model name embedded, giving the impression the override is valid. The same string would cause an immediate error in agent generate.

Error Message

None for `agent show`; for `agent generate`: `Error: invalid model name 'not/a/model'`.

Debug Logs

System Information

- OS: Windows 11
- Cortex version: `cortex 0.0.7 (7954d02 2026-03-30)`

Screenshots

20260406_094346_50_8.mp4

Steps to Reproduce

  1. Run cortex agent show my-agent --model 'totally@invalid!'.
  2. Observe: output shows Model: totally@invalid! (override via --model) — no error.
  3. Run cortex agent generate "test" --model 'totally@invalid!' — fails with validation error.

Expected Behavior

agent show --model should validate the model name format the same way agent generate --model does.

Actual Behavior

agent show --model should validate the model name format the same way agent generate --model does.

Additional Context

Code Evidence

  • Path: src/cortex-cli/src/agent_cmd/handlers/show.rs
  • Permalink: src/cortex-cli/src/agent_cmd/handlers/show.rs#L37-L43
  • Symbols: run_showmodel_override.clone() inserted directly with no validation; compare generate.rs L69-L76 which calls validate_model_name(model_arg)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions