Skip to content

chore: align enum-like const objects with CONTRIBUTING.md naming #924

@jirispilka

Description

@jirispilka

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:

  1. Rename ServerModeSERVER_MODE (keep wire values 'default'/'apps' for now). Add separate PascalCase type alias.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    t-aiIssues owned by the AI team.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions