Skip to content

config: broken config silently loads as defaults with HTTP 200 — expose load_errors on AppConfig #128

Open

Description

@falbany

Problem

ConfigReader.load() catches every parse exception, logs, and returns a defaults-filled AppConfig (src/profiles/core/config/reader.py:142-154). The server cannot distinguish a clean load from fallback, so:

  • POST /api/config/load of an invalid file responds 200 and silently wipes the session config to defaults (routes/config.py:178-184).
  • Same for POST /save with force=True (documented as "it will load as defaults until fixed").

The user's typo'd file appears to load fine — misleading success, violating Fail Fast / Informative Errors.

Suggested fix

Add a non-optional load_errors: tuple[str, ...] = () field to AppConfig (typed, never-None per AGENTS.md), populate it on the fallback paths, and surface it in _config_response + a session notification so the UI can toast "config loaded with N problems".

Activity

  1. added
    bug
    code-quality
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcode-quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions