-
Notifications
You must be signed in to change notification settings - Fork 30
[BUG] [v0.0.7] cortex workspace show silently treats a corrupt config.toml as if no config exists — parse errors are swallowed via .ok()` #48569
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingideIssues related to IDEIssues related to IDEvalidValid issueValid issue
Description
Project
cortex
Description
run_show reads the config file with toml::from_str(&content).ok(). A failed parse returns None, which the code treats identically to "config file not present". The output shows the config file path as "present" but displays no settings section — with no indication that the file could not be parsed. A user with a corrupt config sees an incomplete workspace info display rather than a clear diagnostic.
Error Message
None — user sees workspace info with no "Settings" section and no parse error.Debug Logs
System Information
- OS: Windows 11
- Cortex version: `cortex 0.0.7 (7954d02 2026-03-30)`Screenshots
20260406_095922_50_17.mp4
Steps to Reproduce
- Corrupt
.cortex/config.tomlby adding invalid TOML (e.g.key = [unbalanced). - Run
cortex workspace show. - Observe: output shows
"Config: .cortex/config.toml (present)"but no settings — no error message about the corrupt file. - Compare:
cortex config get any-keywith the same corrupt file → explicit TOML parse error.
Expected Behavior
workspace show should surface a TOML parse error when the config file is present but cannot be parsed.
Actual Behavior
Parse failure is swallowed via .ok(); corrupt config is silently treated as "no settings".
Additional Context
Code Evidence
- Path:
src/cortex-cli/src/workspace_cmd.rs - Permalink:
src/cortex-cli/src/workspace_cmd.rs#L153-L160 - Symbols:
run_show—toml::from_str(&content).ok()discards parse error; returnsNoneon both "parse failure" and "no config"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingideIssues related to IDEIssues related to IDEvalidValid issueValid issue