refactor: strip Gemini from the platform, and level up the architecture_mapper

Two things.

1. The architecture_mapper proposal, applied AND made durable.

The GLM proposal (019fddd9) was accepted in full: the agent's system_prompt now
carries the Mermaid-first constraint and its brain was rewritten. Both verified
against the live row and the .h5 file.

But `apply_identity` writes `UPDATE agents SET system_prompt` and
`apply_brain_consolidation` writes that agent's brain — neither touches the team
TEMPLATE. That agent is mission-scoped, so the improvement would have died with
the mission. The model's actual insight was sharp and worth keeping: "Mermaid
diagrams beat prose" lived in the brain SEED and not in the system PROMPT, so it
only applied when the agent happened to consult its brain. That constraint is
now in templates/teams/codebase_research.toml, where every future Codebase
Research team inherits it.

(The proposal's second item mostly restated anti-patterns the seed already
lists, so the seed is unchanged. Applying an LLM's suggestion is not the same as
agreeing with all of it.)

2. Gemini is gone.

Removed: the `gemini.default` provider alias and its `is_exact_provider_match`
prefix, GEMINI_API_KEY forwarding to agent containers, the evaluator's
gemini->gemini family row, the model selectors in claws/teams/planner and in
TeamWizard + AgentComputer, and the commented provider block in the runtime
config example (whose ZEROCLAW_AGENT_MAP example still mapped a worker_gemini
that no longer existed).

`provider_alias_for("gemini")` now returns claude_cli.default via the
unrecognised-model branch, which LOGS. A stray gemini binding degrades visibly
rather than resolving to a provider row we no longer ship. A test pins that, and
another pins that GEMINI_API_KEY is forwarded in NEITHER auth mode, so adding it
back to the list is a visible change rather than an accident.

Avatar generation is DELETED, not disabled — it called Gemini's image model, and
there is no alternative: Claude and Kimi are text-only, and z.ai answers
"Unknown Model" for cogview-3-flash and cogview-4 on our plan (measured, not
assumed). AvatarModal keeps UPLOAD, which never needed a provider; only the
prompt-generation half is gone.

240 backend lib tests, 89 frontend tests, clean tsc + eslint, build succeeds.
This commit is contained in:
Omar Sobh
2026-08-07 14:15:53 -07:00
parent f6c3ddbf81
commit 87f188ae73
13 changed files with 51 additions and 142 deletions
+10 -9
View File
@@ -32,8 +32,11 @@ pub fn claw_alias(claw_id: Uuid) -> String {
/// Putting both on one credential would mean a single limit blinds the
/// verifier at exactly the moment there is most to verify.
///
/// Non-Claude families are unchanged: `groq.default`, `gemini.default`, and
/// the GLM/Kimi substitution below.
/// Non-Claude families are unchanged: `groq.default` and the GLM/Kimi
/// substitution below. Gemini was removed entirely — a `gemini*` model now
/// falls through to the unrecognised branch, which LOGS and defaults to
/// `claude_cli.default` rather than silently routing to a provider we no
/// longer configure.
pub fn provider_alias_for(model: &str) -> &'static str {
let m = model.trim().to_ascii_lowercase();
// Prefix families first (covers claude-sonnet-5, claude-opus-4-8,
@@ -43,9 +46,6 @@ pub fn provider_alias_for(model: &str) -> &'static str {
if m.starts_with("claude") {
return "claude_cli.default";
}
if m.starts_with("gemini") {
return "gemini.default";
}
return "groq.default";
}
match m.as_str() {
@@ -88,7 +88,6 @@ pub fn provider_alias_for(model: &str) -> &'static str {
pub fn is_exact_provider_match(model: &str) -> bool {
let m = model.trim().to_ascii_lowercase();
m.starts_with("claude")
|| m.starts_with("gemini")
|| m.starts_with("llama")
|| m.starts_with("groq")
}
@@ -363,7 +362,6 @@ mod tests {
}
for m in [
"claude-sonnet-5",
"gemini-2.5-flash",
"groq-llama",
"llama3",
] {
@@ -402,8 +400,11 @@ mod tests {
#[test]
fn provider_alias_mapping() {
assert_eq!(provider_alias_for("gemini"), "gemini.default");
assert_eq!(provider_alias_for("gemini-2.0-flash"), "gemini.default");
// Gemini is gone: no provider row, so it must land on the logged
// default rather than a family alias that resolves to nothing.
assert_eq!(provider_alias_for("gemini"), "claude_cli.default");
assert_eq!(provider_alias_for("gemini-2.0-flash"), "claude_cli.default");
assert!(!is_exact_provider_match("gemini-2.5-flash"));
// glm/kimi families fall back to Claude until their own provider
// tables are configured in the runtime template.
assert_eq!(provider_alias_for("GLM-4.7"), "claude_cli.default");