feat(chat): tag user-identity message sends with edition clawType for the "Send from AI" indicator#450
Open
PeterGuy326 wants to merge 1 commit into
Open
feat(chat): tag user-identity message sends with edition clawType for the "Send from AI" indicator#450PeterGuy326 wants to merge 1 commit into
PeterGuy326 wants to merge 1 commit into
Conversation
Attach the clawType tool argument to every user-identity send path
(send_personal_message text/rich-media/reply and
send_direct_message_as_user) so the IM server can render the
"Send from AI" indicator on delivered messages. The value comes from a
new edition hook (Hooks.ClawTypeValue, exposed via edition.ClawType())
that falls back to DefaultOSSClawType ("openClaw"); overlays such as
wukong set their own identity to get their branded indicator.
Also fixes the reply command, which hardcoded clawType="wukong" and
made open-source replies carry the Wukong AI identity.
Bot sends intentionally stay untouched: they already render as bot
messages and must not carry the user-identity claw tag.
PeterGuy326
pushed a commit
to PeterGuy326/dingtalk-workspace-cli
that referenced
this pull request
Jun 10, 2026
- attendance: address the server by its exact registry ID 'attendance' (the 'attendance-wukong' alias only resolved via prefix fallback) - chat: send clawType as edition.DefaultOSSClawType instead of a hardcoded internal edition value (aligns with upstream PR DingTalk-Real-AI#450 intent) - Makefile: open tree builds the open edition only; drop the edition knob - neutralize internal-edition wording in new-file comments (editions, products/output, helpers/drive, doc jsonml, endpoints_open) Remaining 'wukong' tokens are either the cross-repo build-tag contract (//go:build !wukong) or comments that already exist verbatim on upstream main. Regression: attendance 119/119, chat 159/159, 0 CLI errors.
Collaborator
Author
|
End-to-end verification on production: the 通过AI发送 (Send from AI) indicator now renders under messages sent by this branch's build. Repro: |
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.

Summary
The IM server renders a per-edition "Send from AI" indicator (通过AI发送 / Send from AI / 悟空AI发送 …, localized server-side) on messages based on the
clawTypeargument of the send tools. Today onlychat message replycarries it — and it hardcodes"wukong", so open-source replies are mislabeled with the Wukong AI identity, while plain sends carry no identity at all.This PR makes every user-identity send path carry the correct edition claw identity:
pkg/edition: newHooks.ClawTypeValuefield +edition.ClawType()accessor. Empty value falls back toDefaultOSSClawType("openClaw"); overlays (e.g. wukong) set their own.chat message send: attachesclawTypeon all four argument shapes — group markdown, openDingTalkId direct,--userdirect (send_direct_message_as_user), and rich-media (image/file).chat message reply: replaces the hardcoded"wukong"withedition.ClawType()(bug fix for the open-source build).Testing
go build ./.../go vetclean.TestChatMessageSendCarriesClawType— all 5 user-identity paths assertclawType == DefaultOSSClawType.TestChatMessageSendByBotOmitsClawType— bot path stays clean.pkg/editiontests for default fallback and overlay override.--dry-runshows"clawType": "openClaw"in the JSON-RPC arguments.send_personal_message(conversation id) send →success: true,openTaskIdreturned.send_direct_message_as_user(--user) send →errorCode: 0, ok— the server accepts the new argument on this tool as well.test/cli_compataitable failures are pre-existing onmain(missingtestdata/empty_catalog.jsonfixture), verified on a cleanorigin/mainworktree; unrelated to this change.Notes
Whether the indicator text actually renders depends on the server-side rollout of the localized labels (通用: 通过AI发送 / Send from AI; wukong: 悟空AI发送 / Send from Wukong AI). The CLI-side contract — truthful
clawTypeon every user-identity send — is complete with this PR.