Repository navigation
fix(tutorial): tag and recognise the Getting started page with the identity on the room's own connection - #6045
Merged
Merged
Conversation
…connection On a two-connection install, `publish` routed the room call to the room's server (#5980) but tagged and recognised pages with the primary channel's AGENT_MXID. A page the agent made on the other server was then not its own, and a plain publish created a second Getting started page. connections.room_agent_mxid (exposed as channel_credentials.room_agent_mxid beside room_env) names the identity on the row connection_for_room picks: the row's recorded agent_mxid, else AGENT_MXID in that row's channel env file, kept only when it names that server. getting_started.main() uses it (after --agent-mxid), and refuses when the routed connection names none rather than use another server's identity. Closes #6044 Stand: Blue (@chi-chi-air-blue.agent:s.space) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is still this agent's Pages the unrouted code made carry the primary channel's identity in their tag while listed by the room's own identity; with the routed identity alone they still read as not this agent's, and a plain publish would create a second page. owned() also accepts this agent's other-connection id as the tag, still only when the lister is this agent (or unnamed). Refs #6044 Stand: Blue (@chi-chi-air-blue.agent:s.space) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
…nnot be read _launch_file_value and _channel_dir_value still answer '' (fail closed), and now log the exception type at debug level; the test pins both lines. Refs #6044 Stand: Blue (@chi-chi-air-blue.agent:s.space) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@cla-assistant check |
qingyun-wu
approved these changes
Oct 30, 2026
qingyun-wu
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 0549b31.
Verified:
connections.room_agent_mxiduses the sameconnection_for_roomrow asroom_credential. It returns None on a one-connection install, somain()falls back toagent_mxid()with no aliases, which is unchanged. It returns an identity only when that identity names the row's own server, and returns '' otherwise.main()refuses that case with exit 4 rather than tag a page with another server's id.owned()still checks the lister first, so the alias only widens the accepted tag for a page this agent listed or one with no lister.test_another_agents_page_is_never_taken_for_an_aliaspins this.- I ran tutorial-getting-started (114 OK), gateway-clients-room-routing (35 OK) and connections-room-routing (25 OK) locally at head.
- CI: the two red shards are not this diff.
pool-restart-deliveries.test.pyalso fails on a recent main run.whatsapp-guided-connect.test.pyfailed with an auth/session error and imports none of the touched modules.tsc + tests (clean install)is only the aggregate of those two shards.
Non-blocking:
room_agent_mxidresolves the channel dir and env file in its own way: env var, then launch file, thenchannel_dir_for, read throughdevice_envandcandidates.connection_credentialuses onlychannel_dir_forandresolve_channel_env. The server check stops a wrong-server identity, but the two resolvers can still read different files for the same row. A shared helper would keep them from drifting.- Worst case: on a multi-connection install whose routed row records no
agent_mxidand whose channel env file has none,/tutorialnow refuses where it used to publish, with the wrong tag. That is the intended fail-closed behaviour. The refusal text names--agent-mxid, but it may be worth a line in the tutorial skill docs.
Contributor
Coverage Gate✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 94%. Diff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
|
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.
Priority
Level: medium
Reason: on a two-connection install,
/tutorialor first contact can add a second Getting started page to a room that already has one.Closes
Closes #6044
Summary
#5980 routes the tutorial's room call to the room's own server, but the identity used for the ownership tag and the ownership check still came from the primary channel's
AGENT_MXID. A page the agent made on the other server is listedbythat server's identity, soowned()was false, and a plainpublishcreated a second page.connections.room_agent_mxid(exposed aschannel_credentials.room_agent_mxid, besideroom_env) names the identity on the rowconnection_for_roompicks:agent_mxid, elseAGENT_MXIDin that row's channel env file;Noneon a one-connection install, so behaviour there is unchanged.getting_started.main()uses it, after--agent-mxid. When the routed connection names no identity, it refuses (exit 4) rather than use another server's.owned()now also accepts this agent's other-connection id as the tag. The lister check is unchanged and comes first inowned():if by and by != agent: return False.byanyone else is never this agent's, under any tag.byfalls through to the marker test, where either this agent's routed id or its alias counts. That keeps main's behaviour for a lister-less page and widens only the accepted tag.test_another_agents_page_is_never_taken_for_an_aliaspins three cases: another lister is refused, no lister plus the alias tag is accepted, and no lister without the alias is refused._launch_file_valueand_channel_dir_valuestill answer''on any error (fail closed). They now log the exception type at debug level, and the test pins both lines.This is on
main's script. #6042 (the feature list) rewrites the same file. Whichever lands second carries this into it, and #6042 links #6044.Commits
4e0dcfb4: route the identity.739f97ba: recognise pages already tagged with the primary identity.0549b319: debug log naming the error when a channel env file cannot be read.Before / after evidence
These are the new tests with
main'sgetting_started.py,connections.pyandchannel_credentials.py. The first test is the live symptom: a second pagehtml-p2.At head
0549b319:I ran the touched test files under a line tracer that, like the coverage gate, follows only the main thread. Every changed line is covered:
connections.py22/22,channel_credentials.py1/1,getting_started.py9/9.Checklist
main's code--if-newerrun on feat(tutorial): the Getting started tour renders from a per-release feature list and rebuilds when the list is newer #6042 shows the room's state.(agent-assisted, Blue for Chi's seat)
🤖 Generated with Claude Code