Repository navigation
v2.0.0
v2.0.0 — OpenCode-Only Architecture & Chat Flow Overhaul
This is a major release that streamlines Relay to a single backend (OpenCode) and delivers a comprehensive overhaul of the chat flow for reliability, formatting, and concurrency.
Breaking Changes
- Removed Claude Code and OpenAI Codex providers — OpenCode is now the sole backend. If you were using
provider: "claude"orprovider: "codex", switch toprovider: "opencode". The@anthropic-ai/claude-codeand@openai/codexdependencies have been removed. - Config fields
claudeModel,claudePermissionMode,claudeCwd,codexModel,codexCwdare no longer recognized. - The
logLevelconfig field has been removed — logging runs atinfolevel with full structured output.
New Features
- Reply-to-message context — reply to any bot message to include it as context in your next prompt
- Edited message support — edit a sent message to re-prompt the AI with the corrected text
- Reasoning / thinking display — AI reasoning is shown in Telegram's expandable blockquotes, separate from the answer
- Sarvam AI STT — new speech-to-text provider with Indian language support (Hindi, Tamil, Telugu, etc.)
- Sarvam translate mode — transcribe non-English voice messages and translate to English in one step (
sttProvider: "sarvam-translate")
Reliability Improvements
- Prompt queue — serializes concurrent messages to prevent SSE stream interleaving when multiple messages arrive simultaneously
- Streaming stall detection — 60-second per-chunk inactivity timeout detects and recovers from stalled streams
- Auto-close code fences — unclosed ``` blocks are automatically closed during intermediate streaming edits
- Null file_path guards — all media handlers check for null
file_pathbefore downloading, preventing crashes on Telegram API edge cases
Formatting & Display
- HTML-aware message chunker — tracks open HTML tags across chunk boundaries, closing at end and re-opening at start of next chunk. Never breaks mid-tag.
- Markdown to HTML converter — new utility handles bold, italic, strikethrough, code, links, blockquotes. Guards against false-positive italic on math expressions (e.g.,
2 * 3 * 4) - Shared
sendReply()utility — unified response sender handles reasoning blockquotes, markdown conversion, chunking, plain-text fallback, and large response (>20K chars) file attachment - Tail-end streaming display — long responses during streaming show the most recent content instead of truncating from the start
- Rate limit countdown — rate limit messages now show exact seconds until cooldown expires
Logging
- Structured logging overhaul — full visibility into provider interactions, SSE events, and prompt lifecycle via pino JSON logging
- Removed dead
logLevelconfig field
Documentation
- Updated all docs (README, CLAUDE.md, commands, configuration, features, providers, troubleshooting) to reflect OpenCode-only architecture
- Added STT provider documentation with setup details for Groq, Sarvam AI, AssemblyAI, and OpenAI
- Added Sarvam translate documentation
- Added OpenCode AI providers table with environment variables
Migration from v1.x
- Update your
.relay/config.json: set"provider": "opencode"(remove anyclaude/codexreferences) - Remove unused config fields:
claudeModel,claudePermissionMode,claudeCwd,codexModel,codexCwd,logLevel - Ensure your AI provider API keys are set as environment variables (e.g.,
ANTHROPIC_API_KEY,OPENAI_API_KEY) - Run
relay updateornpm install -g @4via6/relay@latest