Skip to content

Per-user settings via Telegram (/settings command) #197

@dcellison

Description

@dcellison

Parent: #196

Problem

Per-user defaults for model, budget, and timeout are global env vars (CLAUDE_MODEL, CLAUDE_MAX_BUDGET_USD, CLAUDE_TIMEOUT_SECONDS). In a multi-user setup, all users share the same defaults with no way to customize without SSH access.

The /model command already exists for per-session model switching, but the preference doesn't persist across session restarts. Budget and timeout have no Telegram interface at all.

Proposal

Add a /settings command for users to manage their own persistent defaults:

/settings                    - show current settings
/settings model <name>       - set default model (haiku/sonnet/opus)
/settings budget <n>         - set working budget in USD
/settings timeout <n>        - set timeout in seconds
/settings reset              - clear all overrides
/settings reset <field>      - clear a single field

Precedence

  1. Database (user-set via /settings)
  2. users.yaml (admin-set baseline: max_budget ceiling)
  3. Env file (global defaults)

Constraints

  • Budget set via /settings cannot exceed max_budget from users.yaml (admin ceiling)
  • Model validation against available models
  • Timeout must be positive integer

Storage

Settings table with keys like user_config:{chat_id}:{field}.

Relationship to existing commands

  • /model currently sets model for the current session only. After this change, /settings model sets the persistent default, and /model continues to work as a per-session override (taking precedence until session restart).
  • /budget currently exists as a per-session command. Same pattern: /settings budget is the persistent default.

users.yaml schema extension

Add optional fields to UserConfig:

users:
  - telegram_id: 123456789
    name: alice
    role: admin
    model: opus          # default model (new)
    timeout: 300         # default timeout (new)
    max_budget: 20.0     # budget ceiling (existing)

The existing max_budget field acts as a ceiling. A new model field and timeout field provide admin-set defaults that users can override via Telegram (within the ceiling for budget).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions