fix: namespace user IDs by channel-type prefix, not bare colon#2591
Open
mmahmed wants to merge 2 commits into
Open
fix: namespace user IDs by channel-type prefix, not bare colon#2591mmahmed wants to merge 2 commits into
mmahmed wants to merge 2 commits into
Conversation
- Teams Bot Framework user IDs natively contain a colon (`29:1abc...`),
so `rawHandle.includes(':')` treated them as already-namespaced and
skipped the channel-type prefix
- Owner rows keyed `teams:29:...` never matched the resolved `29:...`,
so Teams DMs dropped as unknown_sender and approval clicks were
rejected as unauthorized
- Match by `<channelType>:` prefix instead, in both the host
permissions module (sender resolver + approval click handlers) and
the container-side formatter
- Update sender-approval test fixture: the previous `senderId:
'tg:stranger'` passed under the broken behavior because the colon
bypassed namespacing; switch to a colonless id so the test
exercises the actual code path
Contributor
Author
|
Hi @gavrielc @gabi-simons - please review this change. teams integration is broken without this change as teams user ids have colon in them. |
mmahmed
added a commit
to mmahmed/nanoclaw
that referenced
this pull request
May 25, 2026
- Records what's stacked on top of origin/main (PRs nanocoai#2591, nanocoai#2617, multi-bot Teams, bootstrap) - Documents how to refresh when upstream consumes a PR, how to add a new carry, how to bump deps - Captures the non-standard remote convention (origin = upstream, fork = our fork)
mmahmed
added a commit
to mmahmed/nanoclaw
that referenced
this pull request
May 25, 2026
- Records what's stacked on top of origin/main (PRs nanocoai#2591, nanocoai#2617, multi-bot Teams, bootstrap) - Documents how to refresh when upstream consumes a PR, how to add a new carry, how to bump deps - Captures the non-standard remote convention (origin = upstream, fork = our fork)
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.
Type of Change
.claude/skills/<name>/, no source changes)Description
What
Detect already-namespaced user IDs by checking for the
<channelType>:prefix instead of any bare colon.Why
Teams Bot Framework user IDs natively look like
29:1abc.... The previousrawHandle.includes(':')check treated those as already namespaced and skipped the channel-type prefix, so the resolver returned29:1abc...while the owner row created byinit-first-agent.tswas keyedteams:29:1abc.... The IDs never matched, so:MESSAGE DROPPED — unknown sender (approval requested)withaccessReason="not_member"unauthorized clicker(the click handler had the same broken namespacing)usersrow was being created on every inbound (one prefixed, one not), keeping the auth check permanently out of syncNet effect: Teams users were locked out of their own agents immediately after
/init-first-agentsucceeded.How
src/modules/permissions/index.ts— fix the sender resolver and both approval click handlerscontainer/agent-runner/src/formatter.ts— fix the matching agent-side resolversrc/modules/permissions/sender-approval.test.ts— the existing fixture (senderId: 'tg:stranger') was passing under the broken behavior because the colon bypassed namespacing; switch to a colonless raw id so the test actually exercises the namespacing pathHow it was tested
pnpm test: 328/328 host tests pass (after fixing the fixture)bun testincontainer/agent-runner: 89/89 passFor Skills