Skip to content

feat(telegram): add agent mode overrides and shortcuts#208

Open
jemeraldo wants to merge 3 commits intobanteg:masterfrom
jemeraldo:feat/modes
Open

feat(telegram): add agent mode overrides and shortcuts#208
jemeraldo wants to merge 3 commits intobanteg:masterfrom
jemeraldo:feat/modes

Conversation

@jemeraldo
Copy link

@jemeraldo jemeraldo commented Feb 13, 2026

Summary

  • add /mode command for engine mode overrides with chat/topic persistence and clear/show flows
  • add dynamic Telegram mode shortcuts (e.g. /plan, /build, plus discovered custom modes) with collision-safe registration
  • propagate mode overrides to runners via --agent, show discovered modes in startup message, and make mode discovery timeout configurable (transports.telegram.mode_discovery_timeout_s, default 8.0)

Testing

  • uv run --group dev pytest tests/test_runner_run_options.py tests/test_telegram_engine_overrides.py tests/test_telegram_backend.py tests/test_telegram_mode_commands.py tests/test_telegram_agent_modes.py tests/test_telegram_bridge.py --no-cov -q
  • uv run --group dev pytest tests/test_telegram_agent_trigger_commands.py tests/test_telegram_trigger_mode.py --no-cov -q

UPD

  • refactored mode discovery to a universal runtime/backend capability layer so Telegram no longer probes engine CLIs directly
  • added optional EngineBackend.discover_agent_modes + AgentModeCapabilities for plugin-friendly engine support
  • wired OpenCode mode listing through backend capabilities, preserved soft-fail startup behavior, and refresh mode capabilities on config reload
  • updated docs (commands-and-directives, telegram transport, plugin-api, write-a-plugin, opencode runner, module-map)
  • re-ran checks in Linux environment (ruff, ty, pytest -q: 562 passed)

Add /mode with per-topic/chat persistence and dynamic /<mode> shortcuts from OpenCode discovery while avoiding command collisions. Propagate mode overrides to supported runners and surface available modes in Telegram startup output with soft-fail discovery.
Raise the default agent mode discovery timeout to 8 seconds and expose it as transports.telegram.mode_discovery_timeout_s. Wire the setting through backend discovery and document the new knob for slow startup environments.
Add a generic agent-mode capability layer on engine backends and TransportRuntime so Telegram no longer probes engine CLIs directly. Wire OpenCode mode discovery through backend hooks, refresh capabilities on config reload, and update plugin/docs/test coverage to match the architecture and specification guidance.
@jemeraldo jemeraldo changed the title feat(telegram): add agent mode overrides and shortcuts feat(telegram): add agent mode overrides and universal discovery Feb 15, 2026
@jemeraldo jemeraldo changed the title feat(telegram): add agent mode overrides and universal discovery feat(telegram): add agent mode overrides and shortcuts Feb 15, 2026
@banteg banteg added the enhancement New feature or request label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants