v0.6.8: chat_handle schema + auto-mint nicknames + unknown-handle UX (F180-F184)#147
Merged
Conversation
…handle UX F180: AgentSpec.chat_handle Option<String> workflow.yaml additive field. F181: BotRegistration.chat_handle + chat_register_bot MCP optional input; when omitted, daemon auto-mints from agent_naming::pick_nickname() across currently-registered bots. F182: build_handle_map uses chat_handle.unwrap_or(role); cross-slug collisions resolve to <handle>@<slug> for the second claimant. F183: ccteam-creator SKILL Phase 5.5/5.6 documents auto-mint behavior; implementation lives in the MCP handler so the skill body has no version-coupled logic. F184: router unknown-handle reply lists per-chat available bots; @ccteam list bots admin keyword (6th in nl_admin's set). chore: TODO(V0.7-chat-handle) anchor cleared from daemon.rs; no_silent_todo_test count 6 -> 5; dev-coupling-audit chat_handle row moved to V0.6.8-closed. Closes V0.6.8 F180/F181/F182/F183/F184.
The original `<handle>@<slug>` suffix was unreachable via chat: `router::parse_first_mention` accepts `[a-zA-Z0-9_-]` for handle chars and stops at any other byte, so typing `@curie@beta` parses as handle "curiebeta" and routes to UnknownHandle — strictly worse UX than the silent drop it replaced (listed-but-unreachable). Switch the separator to `__` (double underscore). The suffixed token stays inside the IM handle charset so users can type `@curie__beta` and it routes end-to-end. New `router::collision_suffix` is the single source of truth; `build_handle_map_from_bots` + `available_handles_for_chat` both call it. Add `route_resolves_collision_suffix_handle_end_to_end` regression test driving the real parse path. Also bump `build_handle_map_from_bots` to `pub` so the test (and any future integration test) can probe the collision path without reaching for `pub(crate)`. Update doc-comments (AgentSpec, BotRegistration, SKILL.md Phase 5.6, dev-coupling-audit closed-anchor row) to reflect the new suffix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes the SKILL ↔ code mismatch where
ccteam-creatordocumented scientist-nickname handles (@curieetc.) butbuild_handle_mapactually used the barerolefield. Users following the doc would@curiein a Telegram group and get silent drops.Also adds the unknown-handle reply UX so typos return a helpful list instead of vanishing, and a 6th admin keyword (
@ccteam list bots/bots/who) for per-chat bot lookup.AgentSpec.chat_handle: Option<String>workflow.yaml additive field (backward-compatible; omitted = role).BotRegistration.chat_handlepersisted viachat_register_botMCP; daemon auto-mints fromagent_naming::pick_unused_bot_name()when omitted (returns the minted handle in the MCP reply).build_handle_mapuseschat_handle.unwrap_or(role); cross-slug collisions resolve to<handle>__<slug>(double underscore) for the second claimant in deterministic(slug, role)sort order. The separator stays insiderouter::parse_first_mention's[a-zA-Z0-9_-]charset so users can type@curie__betaand it routes end-to-end — an@separator would silently truncate at the second sigil and break the very UX this PR fixes.ccteam-creatorPhase 5.5/5.6 updated; auto-mint behavior implemented MCP-side so the skill body stays version-agnostic.Unknown handle '@xxx'. Available bots in this chat: @alice @bob; new admin keyword family@ccteam list bots/@ccteam bots/@ccteam whofor the per-chat scoped view. Bare@ccteam list/lskeeps the V0.6.x global registry dump.TODO(V0.7-chat-handle)anchor removed fromdaemon.rs;no_silent_todo_testcount 6 → 5 (test renamedf168_v07_deferred_tag_count_is_six→_is_five); dev-coupling-audit chat_handle row moved to a V0.6.8-closed table.Breaking-behavior note
@ccteam list botspreviously aliased to the globallistdump; in V0.6.8 it returns the per-chat scoped list (same format the unknown-handle reply renders). Bare@ccteam list/lskeeps the original global semantics for ops use. Pre-v1.0 + CLAUDE.md §五 #4 allows this; calling it out so operators don't get surprised.Test plan
cargo test --workspace --locked --no-fail-fast: 1649 pass / 4 fail (vs V0.6.7 baseline 1639/1). The +10 passes are the newhandle_resolution_test(10 cases). 1 of the 4 failures is the documentedworkflow_summary_reflects_agent_spawn_and_done_eventsV0.6.7 baseline flake. The other 3 (daemon_dm_no_at_mention_auto_routes_to_single_bot,daemon_wires_mock_channel_to_supervisor_inbox,trigger_file_shutdown_exits_cleanly_and_cleans_pidfile) are env-race transients on this host — each passes in isolation; behaviour matches CLAUDE.md §六inotify-busy 宿主可见 watcher/SSE 类 transient. CI re-run should report clean.cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warnings.cargo fmt --all -- --check: 0 drift.chat_handle: foodeserializes; absent →None; serde round-trip withskip_serializing_if = "Option::is_none".BotRegistrationJSON round-tripschat_handle(omitted vs explicit).chat_handle→ role fallback; withchat_handle→ wins; cross-slug collision →<handle>__<slug>; deterministic across input order;available_handles_for_chatfilters by(channel, chat_id).router::route("@curie__beta payload", &map, 0)returnsRoute::Bot { slug: "beta", role: "lead" }when(alpha, lead, curie)+(beta, lead, curie)both registered. Bare@curiestill routes toalpha.unknown_handle_inbound_replies_with_available_bots_in_chat: typing@ghost helloin a chat withhelper-bot/mainregistered produces a channel reply containing@ghostand the available@mainhandle.@ccteam list bots,@ccteam bots,@ccteam whoall return the per-chat scoped list; with 0 bots →No bots registered in this chat.chat_register_botwithoutchat_handlereturnschat_handle: "Euclid"(first unused inSCIENTIST_NAMES); a second register on a separate slug returnsArchimedes; caller-supplied handle overrides the mint.Acceptance
After merge:
mcp__ccteam__chat_register_botwithoutchat_handle→ bot defaults to@Euclid/@Archimedes/ etc.@unknownhandle helloin a registered group → group receivesUnknown handle '@unknownhandle'. Available bots in this chat: @<bot>....@ccteam list bots→ per-chat list;@ccteam list→ global list.