feat: 1.33.0 — m1 ship: peerRole rename + client_ack wired + version bump
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

Resolves the merge of m1-broker-drain-race-and-presence-role and
m1-cli-lifecycle-and-role-peer-list into main:

* Rename wire-level role classification field `role` → `peerRole`
  to avoid collision with 1.31.5's top-level `role` lift of
  `profile.role` (user-supplied string consumed by the agent-vibes
  claudemesh skill). `peerRole` is the broker presence taxonomy
  (control-plane/session/service); top-level `role` keeps its 1.31.5
  semantics.
  - apps/broker/src/broker.ts (listPeersInMesh return)
  - apps/broker/src/index.ts (peers_list response)
  - apps/broker/src/types.ts (WSPeersListMessage)
  - apps/cli/src/commands/peers.ts (PeerRecord + filter + lift)

* Wire CLI client_ack emission: handleBrokerPush gains
  ackClientMessage callback; daemon-WS and session-WS each got a
  sendClientAck() method that frames {type:"client_ack",
  clientMessageId, brokerMessageId?} and forwards via the lifecycle
  helper. Run.ts wires the callback into both onPush paths.
  Receiver dedupes against existing inbox row first then acks
  unconditionally — broker needs the ack regardless of dedupe to
  release its claim lease.
  - apps/cli/src/daemon/inbound.ts (ackClientMessage in InboundContext)
  - apps/cli/src/daemon/broker.ts + session-broker.ts (sendClientAck)
  - apps/cli/src/daemon/run.ts (wire-up)

* Version bump 1.32.1 → 1.33.0; CHANGELOG entry replaces "Unreleased"
  with full m1 description.

Verification: tsc clean across cli + broker; CLI 83/83 unit tests
pass; broker 50 unit tests pass (5 integration test files require a
live Postgres and were skipped — pre-existing infra gap, not a
regression). CLI bundle rebuilt; version 1.33.0 baked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-05-04 18:17:45 +01:00
parent c036f759c3
commit 706e681d6e
10 changed files with 180 additions and 30 deletions

View File

@@ -444,8 +444,10 @@ export async function listPeersInMesh(
cwd: string;
connectedAt: Date;
/** v2 agentic-comms (M1): connection role. CLI uses this to hide
* control-plane daemons from user-facing lists. */
role: PresenceRole;
* control-plane daemons from user-facing lists. Wire-level field
* is `peerRole` to avoid collision with 1.31.5's top-level `role`
* lift of profile.role (user-supplied string like "lead"). */
peerRole: PresenceRole;
}>
> {
const rows = await db
@@ -460,7 +462,7 @@ export async function listPeersInMesh(
sessionId: presence.sessionId,
cwd: presence.cwd,
connectedAt: presence.connectedAt,
role: presence.role,
peerRole: presence.role,
})
.from(presence)
.innerJoin(memberTable, eq(presence.memberId, memberTable.id))
@@ -485,7 +487,7 @@ export async function listPeersInMesh(
sessionId: r.sessionId,
cwd: r.cwd,
connectedAt: r.connectedAt,
role: (r.role ?? "session") as PresenceRole,
peerRole: (r.peerRole ?? "session") as PresenceRole,
}));
}

View File

@@ -2652,7 +2652,9 @@ function handleConnection(ws: WebSocket): void {
// v2 agentic-comms (M1): typed connection role. CLI uses
// this to hide control-plane daemons from user-facing
// peer lists (filter swap from peerType happens CLI-side).
role: p.role,
// Wire field is `peerRole` to avoid collision with the
// 1.31.5 top-level `role` lift of profile.role.
peerRole: p.peerRole,
...(pc?.hostname ? { hostname: pc.hostname } : {}),
...(pc?.peerType ? { peerType: pc.peerType } : {}),
...(pc?.channel ? { channel: pc.channel } : {}),

View File

@@ -549,8 +549,11 @@ export interface WSPeersListMessage {
cwd?: string;
/** v2 agentic-comms (M1): typed connection role. CLI uses this to
* filter control-plane daemons out of user-facing peer lists.
* Optional for clients talking to a pre-M1 broker. */
role?: "control-plane" | "session" | "service";
* Optional for clients talking to a pre-M1 broker. Wire field is
* `peerRole` to avoid collision with 1.31.5's top-level `role`
* (which is a lift of `profile.role`, the user-supplied string
* like "lead" / "reviewer" / "human"). */
peerRole?: "control-plane" | "session" | "service";
hostname?: string;
peerType?: "ai" | "human" | "connector";
channel?: string;