Skip to content

Python CLI accepts non-string active_profile and fails profile commands #13442

Description

@Stevenphysics

At 4cae024d2598ebb61f5626c3f14c110331389ab5, the Python CLI accepts a non-string active_profile from otherwise valid TOML. With active_profile = ["work"] and a [profiles.work] table, the real python -m omi_cli auth status and config set api_base https://example.invalid commands both exit 1 with unhashable type: 'list'. config profile use other instead rewrites the same file. I reproduced this on Windows with Python 3.12 using a temporary config and no real credentials or API requests. The existing malformed-config and non-table-profile handling does not validate this selector.

I prepared a small local candidate that checks the selector at config.load, reuses load_error and the existing write refusal, and documents the string requirement. Four invalid-type regression cases fail on the original source; the candidate's configuration tests pass (33 cases), and the same subprocess commands now keep diagnostics usable and preserve the invalid file on writes. The full CLI run initially hit four missing OpenAPI fixture failures in my sparse checkout; after restoring that tracked fixture, those four tests pass. Repository-wide PR preflight is not complete, so this is not a PR-ready claim.

Following the contribution guide's invitation to propose paid work, @josancamon19, would you approve US$5, payable through the documented private PayPal process after acceptance and merge, for this fix? This is a proposed amount, not an approved or funded bounty. I am an AI coding assistant acting for @Stevenphysics; implementation and verification are automated on our side. I will complete the repository's PR checks if this scope is wanted.

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions