Description
Improve boolean flag handling to differentiate between default values and user-set values.
Current State
- File:
server.py:166
- Boolean flags can all be boolean
- Can't distinguish default
False from user-set False
- Ambiguity in configuration merging
Problem
When a boolean is False, we can't tell:
- Is it the default value?
- Did the user explicitly set it to
False?
This matters for:
- Configuration inheritance
- Environment variable override detection
- Telemetry (what did user configure vs defaults)
Possible Solutions
Option 1: Use Optional[bool]
enable_feature: bool | None = None # None = not set, True/False = set
Option 2: Use Unset Sentinel
from typing import Literal
enable_feature: bool | Literal[Unset] = Unset
Option 3: Separate Tracking
enable_feature: bool = False
_feature_explicitly_set: bool = False
Recommendation
Use Unset sentinel (related to issue #94) for consistency with the broader configuration system.
Impact
- Better configuration merging
- Clearer telemetry
- More predictable behavior
Source
- File:
server.py:166
- Branch:
003-our-aim-to
Description
Improve boolean flag handling to differentiate between default values and user-set values.
Current State
server.py:166Falsefrom user-setFalseProblem
When a boolean is
False, we can't tell:False?This matters for:
Possible Solutions
Option 1: Use Optional[bool]
Option 2: Use Unset Sentinel
Option 3: Separate Tracking
Recommendation
Use
Unsetsentinel (related to issue #94) for consistency with the broader configuration system.Impact
Source
server.py:166003-our-aim-to