Forum teuk.org

MB737 — Teaching Every AI Owl to Speak IRC 🦉📜✨

in Mediabot · started by TeuK · 3d ago

TeuK · 3d ago

Mediabot has long been able to ask several large language models for help, but their answers still arrived dressed for the Web: Markdown headings, lists, tables, fenced code and paragraphs that could spill across four IRC lines. MB737 gives OpenAI, Claude and Gemini one shared presentation boundary built specifically for IRC.

One spell for every provider

Successful interactive answers from all three integrations now pass through the same provider-neutral renderer:

  • !tellme and its new !chatgpt alias use OpenAI;
  • !ai and its new !claude alias use Claude;
  • !gemini continues to use Google Gemini.

The aliases do not bypass existing policy. The independent +chatGPT, +Claude and +Gemini channel gates remain unchanged, and the private !claude alias mirrors the already available private !ai command.

Markdown folded into native IRC

The new Mediabot::AI::IRCOutput boundary turns provider-oriented formatting into compact IRC text. Paragraphs, headings, block quotes, lists, tables, links and fenced code are flattened without throwing away their useful content. Emphasis is translated into the three styles requested by IRC users: bold, italic and underline.

Incoming IRC colour and control sequences are stripped before trusted formatting is generated. Each emitted line closes any active style and the next line reopens it when necessary, preventing a truncated answer from leaking formatting into later channel traffic.

Two lines, with the whole line available

Interactive answers are now limited to at most two PRIVMSG lines and 400 UTF-8 bytes per line. This matches Mediabot’s real downstream wire budget, so accented text and emoji are measured safely and are not unexpectedly split a second time.

When an answer is longer, the renderer uses the available width before adding a bounded ellipsis. Existing installations that still contain the former four-line or 450-byte values are clamped at runtime; no configuration migration is required and smaller configured limits still work.

The providers also receive a concise IRC-oriented system instruction so they naturally produce shorter answers. The renderer remains the authoritative final boundary when a model ignores that request.

Consistent answers without collateral damage

Cached Claude answers now use exactly the same presentation path as fresh answers. Authenticated Partyline callbacks deliberately remain plain text, because IRC wire controls do not belong on the operator interface.

MB737 also stops writing complete OpenAI answers into DEBUG5 logs. Diagnostics retain useful answer-length and delivery metadata without duplicating user-visible model content in application logs.

Validation

The final development gate completed successfully:

  • targeted MB737 validation: 276 assertions passed;
  • fast validation lane: 7,148 assertions passed;
  • complete pre-commit suite: 943 test files and 19,271 assertions passed;
  • whitespace, syntax and synchronization checks passed;
  • no database schema change and no mandatory configuration change.

MB737 was published as commit 4b2d2dcdadd4920302de1f073bed714206b48b21 with version 3.6dev-20260915_191304.

The result is quieter, wider and much easier to read: every AI owl can still bring a detailed answer, but it now folds the parchment before flying into the channel. 🪄

You must be logged in to reply.