CONTRIBUTING.md:194-206 specifies as const enum objects should be SCREAMING_SNAKE_CASE with keys identical to values, type sharing the object's name. The codebase doesn't fully follow this.
Current state
| Name |
Object |
Values |
Type |
Notes |
ACTOR_PRICING_MODEL |
SNAKE |
identical |
— |
✓ |
TELEMETRY_ENV |
SNAKE |
identical |
— |
✓ |
TOOL_STATUS |
SNAKE |
identical |
ToolStatus |
✓ ish |
FAILURE_CATEGORY |
SNAKE |
identical |
FailureCategory |
✓ ish |
ACTOR_LOAD_ERROR_KIND |
SNAKE |
kebab-case |
ActorLoadErrorKind |
kebab for wire |
ServerMode |
Pascal |
lowercase |
ServerMode |
outlier |
(TOOL_TYPE fixed in #923.)
Proposed work
Tier 1 — safe, low-risk:
- Rename
ServerMode → SERVER_MODE (keep wire values 'default'/'apps' for now). Add separate PascalCase type alias.
- Amend CONTRIBUTING.md to match actual practice: object SNAKE, values may differ from keys when serialized, type is PascalCase and may have a different name.
Tier 2 — stretch, requires per-value verification:
3. Normalize values to match keys where feasible. Each case needs an audit:
ServerMode: lowercase values come from ?ui= URL and env. Could uppercase with a normalizer (the 'openai' → 'apps' alias in parseServerMode is the existing pattern to copy).
ActorLoadErrorKind: kebab values — verify whether .kind is exposed to clients or purely internal.
TOOL_STATUS: verify telemetry/Segment event consumers.
Tier 1 is the clear win. Tier 2 is opt-in if anyone has appetite — separate PRs per constant.
CONTRIBUTING.md:194-206 specifies
as constenum objects should beSCREAMING_SNAKE_CASEwith keys identical to values, type sharing the object's name. The codebase doesn't fully follow this.Current state
ACTOR_PRICING_MODELTELEMETRY_ENVTOOL_STATUSToolStatusFAILURE_CATEGORYFailureCategoryACTOR_LOAD_ERROR_KINDActorLoadErrorKindServerModeServerMode(
TOOL_TYPEfixed in #923.)Proposed work
Tier 1 — safe, low-risk:
ServerMode→SERVER_MODE(keep wire values'default'/'apps'for now). Add separate PascalCase type alias.Tier 2 — stretch, requires per-value verification:
3. Normalize values to match keys where feasible. Each case needs an audit:
ServerMode: lowercase values come from?ui=URL and env. Could uppercase with a normalizer (the'openai'→'apps'alias inparseServerModeis the existing pattern to copy).ActorLoadErrorKind: kebab values — verify whether.kindis exposed to clients or purely internal.TOOL_STATUS: verify telemetry/Segment event consumers.Tier 1 is the clear win. Tier 2 is opt-in if anyone has appetite — separate PRs per constant.