refactor(probe): decide what sessions may do through a session policy
The messaging core decides what a session may do on its own through one seam, SessionPolicy on Plugins.session_policy, asked in messaging terms. It knows nothing of uploads, sharing modes or installs.
| Messaging decision | SessionPolicy method |
|---|---|
Discovery's automatic join (relay::admission::admit) | admitted(core, targets): which sessions may join the relay by themselves |
The SessionStart join prompt (setup/policy.rs) | may_ask_to_join(): whether a chat not on the relay may be asked to join, or None when the policy cannot say |
| Activity publication | publishes_activity(targets): which sessions may say what they are doing |
A core without a session policy lets every session join by itself, asks none to join and publishes no activity, as a core without an uploader did.
What leaves the core's control
AccountPluginno longer hands out the uploader:uploader(),shared_uploads()andlooked_for_install()are gone.- The core's watchers no longer start session-history work.
relay_uploads::refresh_snapshots(core, uploader)(the background status refresh) andsession_naming::watch(core, uploader)(naming agents from their prompts) take the uploader, for the build that owns it to start. Admissionandadmitlive in the messaging modulerelay::admission.relay_uploads::UploaderPolicy { uploader, uploads }is the policy the uploader's sharing makes: it admits what the install uploads, asks to join only underselectedsharing (the attached install first, then the uploader's last status), and publishes the sessions shared with the workspace.TestAccountholds no uploader.
This is the first step toward a messaging-only core. Every remaining tie to session history is now code the desktop drives (the uploader, relay_uploads, session naming), so that code can move to relay-desktop's desktop-core and the history feature can leave crates/probe.
relay-desktop's desktop-core needs a matching change when it moves its pin: set plugins.session_policy to an UploaderPolicy, start refresh_snapshots and session_naming::watch with its uploader, and drop the three removed AccountPlugin methods.
Tested: cargo test --locked (default features) and --no-default-features --features production-binaries, plus --no-default-features --features history builds.
🤖 Generated with Claude Code
Agent Relay sessions
claudesessionb881bd94· opened viagh pr create· last active 2026-11-03