-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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
- Database (user-set via
/settings) - users.yaml (admin-set baseline:
max_budgetceiling) - Env file (global defaults)
Constraints
- Budget set via
/settingscannot exceedmax_budgetfrom 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
/modelcurrently sets model for the current session only. After this change,/settings modelsets the persistent default, and/modelcontinues to work as a per-session override (taking precedence until session restart)./budgetcurrently exists as a per-session command. Same pattern:/settings budgetis 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).