Skip to content

v2.0.0

Choose a tag to compare

@Harsh-2002 Harsh-2002 released this 01 Mar 09:20
· 79 commits to main since this release

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" or provider: "codex", switch to provider: "opencode". The @anthropic-ai/claude-code and @openai/codex dependencies have been removed.
  • Config fields claudeModel, claudePermissionMode, claudeCwd, codexModel, codexCwd are no longer recognized.
  • The logLevel config field has been removed — logging runs at info level 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_path before 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 logLevel config 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

  1. Update your .relay/config.json: set "provider": "opencode" (remove any claude/codex references)
  2. Remove unused config fields: claudeModel, claudePermissionMode, claudeCwd, codexModel, codexCwd, logLevel
  3. Ensure your AI provider API keys are set as environment variables (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY)
  4. Run relay update or npm install -g @4via6/relay@latest