TelegramConfig gains a bws-capable Token (SecretRef), not just TokenEnv #1254

Closed
opened 2026-10-27 13:39:39 +00:00 by sam · 0 comments
Owner

internal/config/config.go's TelegramConfig only has TokenEnv (a plain OS env var name); it never resolves through secret.Registry the way Forge.Token and Provider.APIKey do (secret.SecretRef{engine,key}), per ARCHITECTURE.md:220-224's own note that TelegramConfig.TokenEnv is one of the older env-only fields kept for backwards compatibility. internal/app/archied/telegram_setup.go:75 does a bare os.Getenv(cfg.Chat.Telegram.TokenEnv), bypassing the secret registry entirely.

This means a bws-stored Telegram token cannot be referenced directly in config.toml the way [providers.openai].api_key or [forge.token] already can -- the operator has to bridge it into a real process env var by hand (bws secret get ... | export ARCHIE_TELEGRAM_TOKEN=...) instead of writing [chat.telegram.token] = { engine = "bws", key = "..." }.

Fix: add a Token secret.SecretRef field to TelegramConfig, mirroring Forge.Token's shape and resolution path. Keep TokenEnv working as a fallback/legacy path (same pattern documented for Provider.APIKeyEnv vs APIKey) rather than a breaking config change -- resolve Token first if set, fall back to TokenEnv. Update config.example.toml and docs/architecture identity/config docs to show the SecretRef form as the preferred one.


Imported from beads archie-core-c0y4 · GitHub #690 · type feature · priority P2 · created 2026-09-02 · closed 2026-09-05

internal/config/config.go's TelegramConfig only has TokenEnv (a plain OS env var name); it never resolves through secret.Registry the way Forge.Token and Provider.APIKey do (secret.SecretRef{engine,key}), per ARCHITECTURE.md:220-224's own note that TelegramConfig.TokenEnv is one of the older env-only fields kept for backwards compatibility. internal/app/archied/telegram_setup.go:75 does a bare os.Getenv(cfg.Chat.Telegram.TokenEnv), bypassing the secret registry entirely. This means a bws-stored Telegram token cannot be referenced directly in config.toml the way [providers.openai].api_key or [forge.token] already can -- the operator has to bridge it into a real process env var by hand (bws secret get ... | export ARCHIE_TELEGRAM_TOKEN=...) instead of writing [chat.telegram.token] = { engine = "bws", key = "..." }. Fix: add a Token secret.SecretRef field to TelegramConfig, mirroring Forge.Token's shape and resolution path. Keep TokenEnv working as a fallback/legacy path (same pattern documented for Provider.APIKeyEnv vs APIKey) rather than a breaking config change -- resolve Token first if set, fall back to TokenEnv. Update config.example.toml and docs/architecture identity/config docs to show the SecretRef form as the preferred one. --- _Imported from beads `archie-core-c0y4` · GitHub #690 · type feature · priority P2 · created 2026-09-02 · closed 2026-09-05_
sam added the mediumfeature labels 2026-10-27 13:39:39 +00:00
sam self-assigned this 2026-10-27 13:39:39 +00:00
sam closed this issue 2026-10-27 13:39:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1254