fix(whatsapp): stop hardcoding the push name to "Moltis" - #1218
Conversation
|
Heads up for whoever merges: this and #1219 both insert a field into the same spot in |
Greptile SummaryThe PR now resolves the WhatsApp push name from the account override, then the configured agent identity, and finally
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/whatsapp/src/connection.rs | Implements the documented push-name precedence and blank-value fallback before constructing the WhatsApp client. |
| crates/whatsapp/src/config.rs | Adds the optional account-level push_name configuration with a backward-compatible default. |
| crates/whatsapp/src/plugin.rs | Carries the optional agent identity name from plugin construction into connection startup. |
| crates/gateway/src/server/init_channels.rs | Supplies the configured identity name when initializing the WhatsApp plugin. |
| crates/config/src/template.rs | Adds a valid WhatsApp account example that documents push_name and its fallback order. |
| docs/src/whatsapp.md | Documents the account-level setting, its user-visible effect, and fallback behavior. |
| crates/config/src/loader/tests/core.rs | Protects discoverability by asserting that generated configuration includes the new setting. |
Reviews (3): Last reviewed commit: "docs(config): add WhatsApp push name to ..." | Re-trigger Greptile
The WhatsApp client asserted a hardcoded push name. That name rides the
presence stanza, so it is what shows to anyone who does not have the number
saved as a contact: a bot configured as "Ada" appears in group chats as
"Moltis".
The builder hook it used is not meant for this. Its own doc comment says the
value exists so a mock server can assign phone numbers deterministically
during multi-device testing.
Resolution order is now account override, then agent identity, then the old
constant:
[identity]
name = "Ada"
[channels.whatsapp.support]
push_name = "Support" # optional, overrides identity for this account
The account level exists because one instance can run several numbers.
Falling back to [identity] name means a configured bot is not called
something else on WhatsApp without anyone asking for it, and an instance
that sets neither is unchanged.
Blank values fall through rather than being honoured. An empty push name
makes send_presence refuse to send at all, so a stray name = "" would
otherwise disable presence silently.
Only the name this client sends changes. The account profile is untouched:
Client::set_push_name would rewrite it server side, and on a number paired
from a personal phone that would rename the owner's real WhatsApp profile.
with_os("Moltis") is left alone. That is the Linked Devices entry, where
naming the client software is correct.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Thanks, the documentation half of this is right and is now fixed: The One clarification on the change itself, since the description could be read as promising more than it delivers: the resolved name is best-effort rather than sticky. |
be87987 to
ca165e0
Compare
|
Updating the earlier merge-order note: this and #1219 now overlap in two files rather than one. Both insert a field after |
|
@greptileai review |
Expose the new account-level push_name setting in the generated configuration template and cover it with the existing template generation test.
|
@greptileai review |
The WhatsApp client asserted a hardcoded push name. That name rides the
presence stanza, so it is what shows to anyone who does not have the number
saved as a contact: a bot configured as "Ada" appears in group chats as
"Moltis".
The builder hook it used is not meant for this. Its own doc comment says the
value exists so a mock server can assign phone numbers deterministically
during multi-device testing.
Resolution order is now account override, then agent identity, then the old
constant:
[identity]
name = "Ada"
[channels.whatsapp.support]
push_name = "Support" # optional, overrides identity for this account
The account level exists because one instance can run several numbers.
Falling back to [identity] name means a configured bot is not called
something else on WhatsApp without anyone asking for it, and an instance
that sets neither is unchanged.
Blank values fall through rather than being honoured. An empty push name
makes send_presence refuse to send at all, so a stray name = "" would
otherwise disable presence silently.
Only the name this client sends changes. The account profile is untouched:
Client::set_push_name would rewrite it server side, and on a number paired
from a personal phone that would rename the owner's real WhatsApp profile.
with_os("Moltis") is left alone. That is the Linked Devices entry, where
naming the client software is correct.
🤖 Generated with Claude Code