Some changes add commands.
Some changes add features.
And some changes quietly rearrange the foundations of the castle so the next ten rooms do not collapse into the dungeons. ๐๏ธโก๏ธ๐ฐ
MB699 belongs to the third category.
Until now, Mediabotโs OpenAI and Anthropic integrations had grown through two different historical paths.
Both worked.
Both had proved useful.
But each provider still carried parts of its own request building, HTTP handling, asynchronous execution, error parsing and runtime glue.
That was becoming increasingly difficult to justify.
So MB699 introduces something much more important than another AI command:
a single provider-neutral AI architecture for Mediabot.
The Sorting Hat can now choose the house without rebuilding Hogwarts every time. ๐ฉ๐งญ
MB699 introduces a dedicated AI layer:
Mediabot::AI
Mediabot::AI::Request
Mediabot::AI::Transport
Mediabot::AI::Provider::Anthropic
Mediabot::AI::Provider::OpenAI
Mediabot::AI::Client
The central piece is:
Mediabot::AI::Client
Callers no longer need to understand the provider-specific transport details.
Instead, the flow becomes:
caller
โ
AI::Request
โ
AI::Client
โ
provider adapter
โ
AI::Transport
โ
worker / HTTP
And on the way back:
normalized result
โ
caller-owned history / cache / IRC delivery
One corridor.
One map.
Far fewer moving staircases. ๐บ๏ธ๐ช
Both historical AI entry points have been migrated.
!aiClaude now delegates its AI execution to Mediabot::AI::Client.
But all the things that genuinely belong to the caller remain there:
The provider-neutral layer handles the AI mechanics.
The IRC layer still handles IRC.
A surprisingly effective spell called separation of concerns. ๐งน๐
tellmeThe historical OpenAI path has also moved behind the same client.
The visible command behavior stays intact, but the implementation now shares the common AI infrastructure.
OpenAI also runs asynchronously rather than blocking the IRC event loop during network calls.
So while an API request is travelling through the Floo Network, the rest of Mediabot can keep doing its job. ๐ฅ๐
MB699 deliberately avoids magical provider switching behind the userโs back.
If a request explicitly asks for:
anthropic
it remains Anthropic.
If it asks for:
openai
it remains OpenAI.
Cross-provider fallback is reserved for the explicit future:
auto
policy.
In other words:
no Polyjuice Potion unless somebody actually asked for Polyjuice Potion. ๐งช๐ซ
OpenAI model fallback can still happen inside the OpenAI provider policy before any future cross-provider fallback is considered.
Both providers now rely on a shared transport layer.
It handles:
The providers still own their protocol-specific details:
But they no longer reinvent the machinery around them.
That distinction matters.
The cauldron belongs to the transport layer.
The potion recipe belongs to the provider. โ๏ธ๐
Once both real callers had been proven behind AI::Client, MB699 removed the obsolete duplicate transport paths.
Among the retired helpers:
_chatgpt_http_request
_chatgpt_decode_worker_content
_chatgpt_fallback_worthy
_chatgpt_transport_request
_chatgpt_accept_transport_result
_chatgpt_send_and_parse
_chatgpt_send_and_parse_async
_claude_build_payload
_claude_http_request
_claude_extract_answer
_claude_accept_http_result
External::Claude also no longer directly owns Mediabot::AsyncWorker.
And Anthropic credentials, endpoints and API-version information are no longer unnecessarily copied into the callerโs transient request state.
Less duplication.
Less credential propagation.
Less code pretending it still owns something it no longer owns. ๐งน๐๏ธ
Two Claude wrappers remain:
_claude_send_and_parse
_claude_send_and_parse_async
That is intentional.
They are no longer independent Anthropic transports.
They are compatibility wrappers backed by:
Mediabot::AI::Client
So yes, the portraits are still hanging in the corridor.
They just stopped secretly governing the Ministry. ๐ผ๏ธ๐๏ธ
The tracked cleanup ended with:
520 insertions
1423 deletions
That is one of the parts I like most about MB699.
The new architecture did not merely pile another abstraction layer on top of the old one.
It allowed us to delete the obsolete architecture underneath it.
Net result:
fewer duplicated paths, clearer ownership, smaller maintenance surface.
A rare Defence Against the Dark Arts lesson where the monster genuinely disappears afterward. ๐โจ
Before removing the legacy transport paths, the new architecture was validated with:
Targeted : 752/752 PASS
Fast : 6254/6254 PASS
Full : 16365/16365 PASS
And both providers were exercised against their real APIs.
Not mocks.
Not optimistic assumptions.
Actual providers. ๐งซ๐ญ
Once the old transport code had been removed:
Ownership sentinel : 86/86 PASS
Targeted : 711/711 PASS
Fast : 6205/6205 PASS
Full : 16238/16238 PASS
Final repository hygiene:
RC_DIFF=0
The development bot was restarted with the cleaned architecture loaded:
ActiveState=active
SubState=running
ExecMainStatus=0
NRestarts=0
Startup integrity:
88 cross-module methods resolved OK
No Horcrux left unresolved. ๐ชฆ๐
The last gate was deliberately simple.
Ask the real providers a deterministic question through the real IRC commands.
<Te[u]K> m ai Rรฉponds uniquement : MB699 J CLAUDE OK
<mediabotv3> MB699 J CLAUDE OK
Result:
CLAUDE_POST_CLEANUP_LIVE=PASS
<Te[u]K> m tellme Rรฉponds uniquement : MB699 J OPENAI OK
<mediabotv3> MB699 J OPENAI OK
Result:
OPENAI_POST_CLEANUP_LIVE=PASS
And together:
MB699_RUNTIME_GATE=PASS
No Felix Felicis.
Just tests. ๐๐ซ
Because this work touches real AI credentials, the final candidate received a dedicated pre-commit audit.
Exactly 32 files belonged to MB699.
The audit verified:
.env;commit.sh still local and ignored;Gitleaks result:
no leaks found
RC_GITLEAKS=0
Final audit:
FAIL_COUNT=0
MB699_PRECOMMIT_AUDIT=PASS
The Marauderโs Map shows code.
Not secrets. ๐บ๏ธ๐
+WitMB699 deliberately does not implement the future +Wit feature.
That comes next.
But it changes what +Wit can be built on.
The upcoming conversational layer will be able to use:
anthropic
openai
auto
without becoming intrinsically tied to one company or one API implementation.
The intended direction remains:
NO_REPLY;In other words, the goal is not to unleash Peeves with an API key. ๐ป๐
The goal is something closer to a clever portrait in the common room:
sometimes useful,
sometimes funny,
and smart enough to know when to stay quiet. ๐ผ๏ธ๐ฌ๐
๐งฌ Provider-neutral AI foundation PASS
๐ฆ Anthropic adapter PASS
๐ OpenAI adapter PASS
๐ Shared asynchronous transport PASS
๐งญ Provider-neutral AI client PASS
๐จ tellme migration PASS
๐ชถ Claude / !ai migration PASS
๐งน Legacy transport cleanup PASS
๐งช Targeted validation PASS
โก Fast validation PASS
๐ฐ Full regression suite PASS
๐ Real Anthropic runtime PASS
๐ฐ๏ธ Real OpenAI runtime PASS
๐ Secret audit PASS
๐ฉบ Development service PASS
MB699 leaves Mediabot with one AI architecture instead of two historical tunnels.
The castle is cleaner.
The staircases finally lead somewhere predictable.
And somewhere behind the next door, +Wit is already knocking. ๐ชโจ๐ช
You must be logged in to reply.