Skip to content

mx_set_displayname: client-level profile rename with relogin#11

Open
user9208212 wants to merge 1 commit into
mainfrom
feat/set-displayname
Open

mx_set_displayname: client-level profile rename with relogin#11
user9208212 wants to merge 1 commit into
mainfrom
feat/set-displayname

Conversation

@user9208212

Copy link
Copy Markdown
Collaborator

What

mx_set_displayname(client, name, save = TRUE) — the display-name client helper discussed for corteza#155: wraps mx.api::mx_set_displayname(), builds the session from the client config, and goes through mx_with_relogin() so a rotated token gets one refresh-and-retry instead of a silent failure. Validates name as 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 follow test_relogin.R's pattern (signature + validation; the relogin path itself is already covered by the mx_with_relogin tests). Verified live against the cornball.ai homeserver.

Naming

Kept mx_set_displayname (your first suggestion) — it does shadow mx.api::mx_set_displayname when both are attached, though all package code calls via ::. Happy to rename to mx_profile_set_displayname if 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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant