Skip to content

[BUG] [v0.0.7] cortex compact config --json --log-retention-days 30 early-returns with default JSON and discards the flag — --log-retention-days is excluded from the early-return guard condition #48576

@Kuka53

Description

@Kuka53

Project

cortex

Description

run_config has an early-return path for pure display: if args.json && !args.enable && !args.disable && args.interval_hours.is_none(). This guard does not check args.log_retention_days. So cortex compact config --json --log-retention-days 30 satisfies all four conditions (json=true, enable=false, disable=false, interval_hours=None), triggers the early return, and prints the default config JSON without applying or acknowledging the --log-retention-days 30 value. The flag is silently discarded.

Error Message

None (silent ignore with misleading JSON showing default values).

Debug Logs

System Information

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

Screenshots

20260406_104052.mp4

Steps to Reproduce

  1. Run cortex compact config --json --log-retention-days 30.
  2. Observe: JSON output shows the default log_retention_days value, not 30.
  3. No confirmation that the flag was received or rejected.
  4. Compare: cortex compact config --log-retention-days 30 (without --json) enters the human-readable path and at least reaches the "not yet implemented" message, acknowledging the flag.

Expected Behavior

The early-return guard should also check args.log_retention_days.is_none(). When --log-retention-days is supplied, the early-return should be skipped so the flag can be processed (or the user should receive an error/acknowledgement).

Actual Behavior

args.log_retention_days is not included in the guard condition at line 655; the early-return fires and prints default JSON, making the flag a no-op in JSON mode.

Additional Context

Code Evidence

  • Path: src/cortex-cli/src/compact_cmd.rs
  • Permalink: src/cortex-cli/src/compact_cmd.rs#L655-L668
  • Symbols: run_config — guard if args.json && !args.enable && !args.disable && args.interval_hours.is_none() missing && args.log_retention_days.is_none() check; early return prints default config JSON without processing --log-retention-days

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