mx_set_displayname: client-level profile rename with relogin#11
Open
user9208212 wants to merge 1 commit into
Open
mx_set_displayname: client-level profile rename with relogin#11user9208212 wants to merge 1 commit into
user9208212 wants to merge 1 commit into
Conversation
Client-level wrapper over mx.api::mx_set_displayname(): builds the session from the client config and retries once through mx_with_relogin() on a rejected token, so long-running bots can rename themselves without hand-rolling session or relogin plumbing. Extracted from corteza's Matrix model badge (corteza#155) per review: the badge policy stays in corteza, the reusable Matrix primitive lives here. Bump version to 0.1.1.1.
user9208212
added a commit
to cornball-ai/corteza
that referenced
this pull request
Jul 12, 2026
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).
user9208212
added a commit
to cornball-ai/corteza
that referenced
this pull request
Jul 12, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
mx_set_displayname(client, name, save = TRUE)— the display-name client helper discussed for corteza#155: wrapsmx.api::mx_set_displayname(), builds the session from the client config, and goes throughmx_with_relogin()so a rotated token gets one refresh-and-retry instead of a silent failure. Validatesnameas a single non-empty string; returns TRUE invisibly.Lives in a new
R/profile.R(first of the profile endpoints at the client level). Tests followtest_relogin.R's pattern (signature + validation; the relogin path itself is already covered by themx_with_relogintests). Verified live against the cornball.ai homeserver.Naming
Kept
mx_set_displayname(your first suggestion) — it does shadowmx.api::mx_set_displaynamewhen both are attached, though all package code calls via::. Happy to rename tomx_profile_set_displaynameif you'd rather avoid the collision.Context
Extracted from corteza#155 per your review: corteza keeps the badge policy ("should this session wear a model badge?") and reply stamping, and calls this for the profile update. corteza#155 gets reworked on top of this once it lands.
🤖 Generated with Claude Code