Skip to content

Fragile: _selectors_interactive() keys UI readiness off a status-string prefix #29

Description

@laceyp99

Where

arena/app.py_selectors_interactive() (line ~596), MODEL_CATALOG_STATUS, _load_model_catalog() in arena/core/models.py.

Problem

Whether the entire Arena UI is interactive (model dropdowns, Send button, reasoning controls) is decided by string-parsing a human-readable status message:

def _selectors_interactive() -> bool:
    return not MODEL_CATALOG_STATUS.lower().startswith("warning:")

_load_model_catalog() encodes readiness by prefixing its message with "Warning: ...". This is a stringly-typed sentinel: any future rewording of a status message (or a localized/reworded warning that drops the prefix) silently flips the app into "ready" mode without an API key, and conversely a success message that happens to start with "warning" would lock the UI. Nothing type-checks or tests the coupling between the message text in models.py and the parser in app.py — they live in different modules.

Suggested fix

Have _load_model_catalog() return an explicit readiness flag, e.g. (catalog, status_message, api_key, ready: bool) or a small dataclass/NamedTuple (CatalogState), and store that flag in the module state. _selectors_interactive() then returns the flag directly, and the status text becomes purely presentational. This also simplifies _openrouter_status_banner(), which currently piggybacks on the same string check.

Activity

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

    enhancementNew feature or requestpriority:mediumImportant but not urgentvalidationValidation, environment, or tooling follow-up

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions