Skip to content

v0.2.10 Image Vision, Ollama Cloud by Default, and Production Hardening πŸ‘οΈ

Latest

Choose a tag to compare

@johndotpub johndotpub released this 29 Nov 00:46
cd766b8

πŸŽ‰ DiscordianAI v0.2.10 Release Notes

Provider adapters, vision, a hardened message pipeline, aiohttp health endpoints, and a DRY/KISS cleanup across the whole bot πŸ›‘οΈ
Released: 2026-11-28


⚠️ Upgrade Notes (read first)

  • Default chat provider is now Ollama Cloud (https://ollama.com/v1/, model deepseek-v4.1-flash:1017). OpenAI still works: set OPENAI_API_URL, GPT_MODEL and your key. REASONING_EFFORT (default high) is now actually sent, and requests use max_tokens.
  • Reinstall requirements (pip install -r requirements.txt): starlette, uvicorn and beautifulsoup4 are gone; aiohttp, cachetools, tree-sitter, tree-sitter-markdown and the discord.py[voice] extra are added.
  • The local web scraper is removed, along with MAX_URLS_PER_MESSAGE, MAX_TOTAL_SCRAPED_CHARS and SCRAPE_DEADLINE_SECONDS. Web access is provider-side only.
  • Logs go to stderr; LOG_FILE is parsed but ignored.
  • 0.4.0 was never published: its changes are folded into this release.

πŸ”Œ New: Provider Adapters & Routing

One provider protocol, two adapters (OpenAI-compatible chat and Perplexity Agent API) behind a single registry. The orchestrator is the only place that routes, falls back and records the conversation turn.

  • Deterministic routing gate replaces the old regex chain; optional Clef decision model via ROUTER_MODE=clef
  • Web access for both providers, provider-native search and fetch, bounded and treated as untrusted
  • Perplexity answers are now cached (5-minute TTL), scoped per conversation
  • One history writer: each turn is recorded once, per conversation, never per user

πŸ–ΌοΈ New: Vision

Image attachments (PNG, JPEG, GIF, WebP): up to 4 images, 5 MB each, magic-byte verified. Image messages always take the local path, and history keeps only [image: name] captions. VISION_ENABLED=false restores the old behaviour.

πŸ›‘οΈ Hardened: Message Delivery

  • One delivery helper owns replies, allowed-mentions and reference policy: an answer can never ping @everyone or a role
  • One code parser (tree-sitter) decides what is code; every chunk is re-sanitised after splitting
  • Link safety fails closed: multi-scheme autolinks, look-alike hosts and unicode tricks are neutralised
  • Long answers arrive whole (the old splitter cut off at about 19,000 characters)
  • Typed errors: failures are classified by type and status; provider text never reaches logs or health probes

πŸ₯ Rebuilt: Health & Operations

  • /health, /health/live, /health/ready on aiohttp, bound before Discord login; an idle bot is no longer reported degraded
  • SIGTERM/SIGINT now shut down cleanly (they were previously handled as user input)
  • One instance per config in the launcher; supervisor-owned logging with no duplicate lines
  • Voice extra installed, so the voice warnings are gone

πŸ”§ Fixed

  • A cached answer could be served to a different person or channel; keys are now scoped to the conversation
  • The published package could not start (No module named 'src'); the wheel now ships correctly
  • Perplexity Agent API calls failed on max_steps; it now travels in extra_body
  • The OpenAI key-shape check is removed (it rejected valid Ollama Cloud keys)
  • Retries and breaker accounting: one logical call counts as one failure
  • ALLOWED_CHANNELS names resolve in every guild; a busy health port no longer kills the bot
  • Perplexity attribution header X-Pplx-Integration: discordian-ai is sent to the official host only (thanks @qirh)

πŸ§ͺ Tests, CI & Docs

  • Coverage 92.31% (floor 84%); the mutation checker kills 22 of 22 mutations
  • Golden delivery fixtures freeze output format; docs-truth tests keep docs and code in step
  • New CI: minimum-versions job, shellcheck, wheel smoke test, a pip-audit script, and a Docker publish gate
  • GitHub Actions dependencies updated (checkout 7, setup-python 7, cache 6, codecov 7, qemu 4, dependency-review 5.0.1)
  • CodeQL: the clear-text-logging and cyclic-import alerts are fixed

πŸ“Š By the Numbers

Metric Before (0.2.9.9) After (0.2.10)
Tests 587 1,859
Test files 34 118
Coverage β€” 92.31%
Mutation checker β€” 22/22 killed
Source modules 28 48
Docs pages 17 20
Runtime dependencies 10 9
Commits β€” 372 since 0.2.9.9

πŸ™Œ New Contributors

  • @qirh made their first contribution in #256

Full Changelog: v0.2.9.9...v0.2.10