With one container per platform a second tab re-claims the same container, so the container alone cannot tell a tab its own launch-ready from the claim that replaced it.
The room URL only ever existed in the launch-ready push, so a socket that
dropped while the game was coming up left the tab loading forever over a
session that was running, with no way out but a release.
The session now records the room the launch answered with, the status poll
reports it along with the container it was found on, and a loading tab enters
the stream on that answer.
endpoints/streaming.py had grown to 3778 lines, but only about a third of
that was routes. The rest was a second copy of the layer handler/streaming
already exists to hold: broker verbs, webstation protocol translation,
state and save and memory-card transfer, session teardown.
Split it along those seams rather than by route, and give claim_session
the same treatment: its 406 lines are now four named phases.
Cross-module calls go through the module (states.pull_state_to_library,
commands.stop) instead of imported names, so one definition site is what
tests patch and what every caller reads.
No route path, scope or response model changed, so the OpenAPI schema is
untouched.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>