refactor(cli): drop CLAUDEMESH_SESSION_PRESENCE flag
per-session presence is small and uncomplicated enough that a rollback flag isn't load-bearing. backwards compat is already covered at the protocol layer — older brokers reply unknown_message_type to session_hello and the SessionBrokerClient marks itself closed for that mesh, which is the same outcome the flag would have given. removing the flag, the helper, and the conditional from the registry hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,9 +31,12 @@ access shape).
|
|||||||
`parent_attestation`). Older payloads continue to work.
|
`parent_attestation`). Older payloads continue to work.
|
||||||
- **`claudemesh launch`** — generates an ed25519 session keypair and a
|
- **`claudemesh launch`** — generates an ed25519 session keypair and a
|
||||||
12 h parent attestation per launch (mesh secret key signs it),
|
12 h parent attestation per launch (mesh secret key signs it),
|
||||||
forwards both to the daemon under `body.presence`. The flag
|
forwards both to the daemon under `body.presence`. Per-session
|
||||||
`CLAUDEMESH_SESSION_PRESENCE` defaults to ON; set `=0` to roll back
|
presence is always on; older brokers that don't recognize
|
||||||
if a broker on a given mesh is misbehaving.
|
`session_hello` reply `unknown_message_type` and the daemon quietly
|
||||||
|
drops the per-session WS for that mesh — the regular member-keyed
|
||||||
|
WS still covers all functionality, the only loss is sibling-session
|
||||||
|
visibility on that mesh.
|
||||||
- **latent 1.29.0 bug fix** — `claudemesh launch` referenced
|
- **latent 1.29.0 bug fix** — `claudemesh launch` referenced
|
||||||
`claudeSessionId` before its `const` declaration further down the
|
`claudeSessionId` before its `const` declaration further down the
|
||||||
file, hitting the temporal dead zone → `ReferenceError` silently
|
file, hitting the temporal dead zone → `ReferenceError` silently
|
||||||
@@ -44,10 +47,9 @@ access shape).
|
|||||||
|
|
||||||
### Sequencing
|
### Sequencing
|
||||||
|
|
||||||
The broker side ships first and bakes for ~24 h. Only then does the
|
The broker side ships first and bakes for ~24 h. Older CLIs continue
|
||||||
flag default flip on the CLI side. Older CLIs continue working
|
working unchanged (no per-session WS), and the protocol is purely
|
||||||
unchanged (no per-session WS), and the protocol is purely additive on
|
additive on the wire.
|
||||||
the wire.
|
|
||||||
|
|
||||||
### Verification (smoke)
|
### Verification (smoke)
|
||||||
|
|
||||||
|
|||||||
@@ -680,9 +680,8 @@ export async function runLaunch(flags: LaunchFlags, rawArgs: string[]): Promise<
|
|||||||
sessionTokenForCleanup = minted.token;
|
sessionTokenForCleanup = minted.token;
|
||||||
|
|
||||||
// Per-session ephemeral keypair + parent attestation (1.30.0+).
|
// Per-session ephemeral keypair + parent attestation (1.30.0+).
|
||||||
// Behind CLAUDEMESH_SESSION_PRESENCE: the daemon ignores the
|
// Older daemons ignore unknown body fields, so sending presence
|
||||||
// presence material when the flag is off, so sending it always is
|
// material always is forward-compatible.
|
||||||
// forward-compatible.
|
|
||||||
let presencePayload: {
|
let presencePayload: {
|
||||||
session_pubkey: string;
|
session_pubkey: string;
|
||||||
session_secret_key: string;
|
session_secret_key: string;
|
||||||
|
|||||||
@@ -28,18 +28,6 @@ export interface RunDaemonOptions {
|
|||||||
clonePolicy?: ClonePolicy;
|
clonePolicy?: ClonePolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 1.30.0 feature flag. Default ON — the daemon opens a long-lived WS per
|
|
||||||
* registered session so siblings see each other in `peer list`. Set
|
|
||||||
* CLAUDEMESH_SESSION_PRESENCE=0 (or "false"/"off") to disable for
|
|
||||||
* rollback if the broker side is misbehaving on a given mesh.
|
|
||||||
*/
|
|
||||||
function isSessionPresenceEnabled(): boolean {
|
|
||||||
const v = process.env.CLAUDEMESH_SESSION_PRESENCE;
|
|
||||||
if (v === undefined || v === "") return true;
|
|
||||||
return v !== "0" && v.toLowerCase() !== "false" && v.toLowerCase() !== "off";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Detect a few common container environments to pick UDS-only by default. */
|
/** Detect a few common container environments to pick UDS-only by default. */
|
||||||
function detectContainer(): boolean {
|
function detectContainer(): boolean {
|
||||||
if (process.env.KUBERNETES_SERVICE_HOST) return true;
|
if (process.env.KUBERNETES_SERVICE_HOST) return true;
|
||||||
@@ -167,14 +155,13 @@ export async function runDaemon(opts: RunDaemonOptions = {}): Promise<number> {
|
|||||||
let drain: DrainHandle | null = null;
|
let drain: DrainHandle | null = null;
|
||||||
drain = startDrainWorker({ db: outboxDb, brokers });
|
drain = startDrainWorker({ db: outboxDb, brokers });
|
||||||
|
|
||||||
// 1.30.0 — per-session broker presence. Default OFF for one release
|
// 1.30.0 — per-session broker presence. Always on. Older CLIs that
|
||||||
// cycle so the broker side bakes before the flag flips. Opt-in via
|
// don't include `presence` material in the register body just won't
|
||||||
// CLAUDEMESH_SESSION_PRESENCE=1; flips to default-on in 1.30.0 GA.
|
// get a session WS; the daemon's own member-keyed broker still
|
||||||
const sessionPresenceEnabled = isSessionPresenceEnabled();
|
// covers them.
|
||||||
const sessionBrokers = new Map<string, SessionBrokerClient>();
|
const sessionBrokers = new Map<string, SessionBrokerClient>();
|
||||||
setRegistryHooks({
|
setRegistryHooks({
|
||||||
onRegister: (info) => {
|
onRegister: (info) => {
|
||||||
if (!sessionPresenceEnabled) return;
|
|
||||||
if (!info.presence) return;
|
if (!info.presence) return;
|
||||||
const meshConfig = meshConfigs.get(info.mesh);
|
const meshConfig = meshConfigs.get(info.mesh);
|
||||||
if (!meshConfig) {
|
if (!meshConfig) {
|
||||||
|
|||||||
@@ -277,8 +277,7 @@ identity (deferred for security review).
|
|||||||
signature checks; daemon adds a slim `SessionBrokerClient` and
|
signature checks; daemon adds a slim `SessionBrokerClient` and
|
||||||
registry lifecycle hooks. Also fixes a latent 1.29.0 TDZ bug where
|
registry lifecycle hooks. Also fixes a latent 1.29.0 TDZ bug where
|
||||||
`claudemesh launch`'s IPC session-token registration was silently
|
`claudemesh launch`'s IPC session-token registration was silently
|
||||||
failing every run. Flag-gated for one cycle, default ON in this
|
failing every run. Spec at
|
||||||
release; set `CLAUDEMESH_SESSION_PRESENCE=0` for rollback. Spec at
|
|
||||||
`.artifacts/specs/2026-05-04-per-session-presence.md`.
|
`.artifacts/specs/2026-05-04-per-session-presence.md`.
|
||||||
|
|
||||||
What's left for true v2.0.0 (next sessions):
|
What's left for true v2.0.0 (next sessions):
|
||||||
|
|||||||
Reference in New Issue
Block a user