Skip to content

[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

@FredAmalasuintha311

Description

@FredAmalasuintha311

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

  1. Corrupt .cortex/config.toml by adding invalid TOML (e.g. key = [unbalanced).
  2. Run cortex workspace show.
  3. Observe: output shows "Config: .cortex/config.toml (present)" but no settings — no error message about the corrupt file.
  4. Compare: cortex config get any-key with 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_showtoml::from_str(&content).ok() discards parse error; returns None on both "parse failure" and "no config"

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