Repository navigation
Opt-in Matrix model badge: replies and sender line name the model - #155
Conversation
New matrix_configure(model_badge =) key: "never" (default, unchanged behavior), "non_default", or "always". When a badge applies, deterministic post-turn code — not the model — prepends a "<bolt> <model> (<provider>)" first line to each reply and renames the bot to "<name> <bolt> <model>", so a room session that /model-switched to a paid provider is visible on every message and in the sender line. In non_default mode silence means the configured default: the badge appears only while a switch is live and disappears on /clear or a process restart (both reset the profile name). Sessions stamp their creation-time model/provider as the comparison baseline. display_name optionally sets the base name (default: user-id localpart). Bump version to 0.7.0.5.
Per review: keep the badge policy (mode, session-vs-default comparison, reply stamping) in corteza, but do the profile update through mx.client's new client-level mx_set_displayname() instead of calling mx.api directly. That routes the rename through mx_with_relogin(), so a rotated token gets refreshed and retried instead of silently failing the rename on a long-running bot. matrix_update_displayname no longer needs the mx_sess argument. Requires mx.client >= 0.1.1.1 (cornball-ai/mx.client#11).
|
Reworked per review (15c3892): badge policy and reply stamping stay here; the profile update now goes through mx.client's new client-level |
CRAN has mx.client 0.1.1, so the Suggests floor added for mx_set_displayname() is unsatisfiable there; install from GitHub like llm.api until the next mx.client CRAN release. CI on this PR stays red until cornball-ai/mx.client#11 lands on main.
|
Re the red CI on the last push: two separate things. (1) The macOS leg died at the known llm.api GitHub-install problem ( |
Rescues the badge after 12 commits of drift. 0.7.0.5 renumbers to 0.7.1.2 on top of the rewire. Semantic resolutions, not just textual: - matrix_apply_model_command() gained a cfg argument on main; kept main's call and the branch's post-switch displayname update. - /clear was rewritten on main to record the event in the transcript ledger; kept main's version with the branch's displayname reset prepended, so a badge rename is still undone on /clear. - The test files had diverged too far for a hunk merge (one 512-line conflict), so main's file is taken wholesale and the three badge blocks appended. - Dropped the branch's Remotes: field; CRAN does not accept it and main had already removed it. - mx.client bound moves to >= 0.2.0, the version carrying mx_set_displayname(). 2663 tests pass, up from 2648: the badge tests run green against the rewired chat_send() path, which was the risk a textual merge could not settle.
What
New
matrix_configure(model_badge =)key:"never"(default — zero behavior change unless opted in),"non_default", or"always". When a badge applies:⚡ claude-sonnet-4-6 (anthropic_claude)r2j2 ⚡ claude-sonnet-4-6(viamx.api::mx_set_displayname), so the sender line above every message wears the model, and the rename event itself marks the switch in the timelineBoth are stamped after the turn by the poll loop, not by the LLM, so no model can forget or restyle its own badge.
Why
A
/modelswitch to a paid provider is easy to forget from a phone; in"non_default"mode silence means the configured default and a badge means a switch is live (and probably spending money). The badge disappears exactly when the switch does:/clearand process restart both revert to the default session and reset the profile name.Mechanics
default_model/default_provider) as the comparison baseline — no cfg guessing, works whenmatrix_runopts override the config.display_nameoptionally sets the base name the rename builds on (default: user-id localpart).matrix_model_badge,matrix_badge_displayname,matrix_session_is_default) tested with 16 asserts, no network.Bumps version to 0.7.0.5 — assumes the sibling
/modelmenu PR (#154, 0.7.0.4) merges first; happy to renumber if the order flips.🤖 Generated with Claude Code