You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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
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).
Run cortex compact config --json --log-retention-days 30.
Observe: JSON output shows the defaultlog_retention_days value, not 30.
No confirmation that the flag was received or rejected.
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.
Project
cortex
Description
run_confighas an early-return path for pure display:if args.json && !args.enable && !args.disable && args.interval_hours.is_none(). This guard does not checkargs.log_retention_days. Socortex compact config --json --log-retention-days 30satisfies 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 30value. The flag is silently discarded.Error Message
Debug Logs
System Information
- OS: Windows 11 - Cortex version: `cortex 0.0.7 (7954d02 2026-03-30)`Screenshots
20260406_104052.mp4
Steps to Reproduce
cortex compact config --json --log-retention-days 30.log_retention_daysvalue, not30.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-daysis 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_daysis 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
src/cortex-cli/src/compact_cmd.rssrc/cortex-cli/src/compact_cmd.rs#L655-L668run_config— guardif 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