Skip to content

Database settings override .env values inconsistently #217

@GitHappens2Me

Description

@GitHappens2Me

Since commit 1471884, settings in the database take precedence over .env values. Only if the DB stores empty values (None, "", []) does .env get used.

Commit a8b7554 changed it so that 0 and False are now also treated as "empty" and ignored.

The code in question is:

merged_dict: dict[str, Any] = dict(env_resolved.dict())
merged_dict.update(
       {k: v for k, v in db_json.items() if v not in (None, "", []) and v}
)

This results in inconsistent behaviour for the operator:
If the DB contains "fixed_pricing": true changing .env to: FIXED_PRICING=False does not actually change the setting. There is also no indication that FIXED_PRICING is still active. The same applies for numerical settings, for example FIXED_PER_1K_INPUT_TOKENS.

Also, to my knowledge there is no UI to change most of the settings yet (including FIXED_PRICING), which makes changing settings with non-empty values in the database impossible without modyfing the database directly.

Is this behaviour intentional? If so, what is the intention behind it and what is the intended way to change the settings stored in the database?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions