diff --git a/packages/mosaic/src/commands/comms.spec.ts b/packages/mosaic/src/commands/comms.spec.ts index a20a85aa..633ede7c 100644 --- a/packages/mosaic/src/commands/comms.spec.ts +++ b/packages/mosaic/src/commands/comms.spec.ts @@ -15,6 +15,17 @@ import { afterEach, describe, expect, it } from 'vitest'; import { fleetCommsSendArgs, registerCommsCommand, tmuxSendArgs } from './comms.js'; describe('arg translation', () => { + // B2 (2026-08-29): when --socket is omitted, the CLI forwards NO -L and + // agent-send.sh's own resolution governs (explicit -L > MOSAIC_TMUX_SOCKET + // > unique hit > ambiguity refusal). Forwarding a guessed default here + // would defeat that resolution and reintroduce the stale-twin defect. + it('omits -L entirely when --socket is not given (tool-owned resolution)', () => { + const args = tmuxSendArgs('orch-01', 'hello', {}); + expect(args).toEqual(['-s', 'orch-01', '-m', 'hello']); + expect(args).not.toContain('-L'); + expect(args.join(' ')).not.toContain('-L'); + }); + it('tmux path: -s/-C/-L/-f/-m per agent-send.sh getopts', () => { expect(tmuxSendArgs('orch-01', 'hello', {})).toEqual(['-s', 'orch-01', '-m', 'hello']); expect( diff --git a/packages/mosaic/src/commands/comms.ts b/packages/mosaic/src/commands/comms.ts index cb6cada7..eaa8474d 100644 --- a/packages/mosaic/src/commands/comms.ts +++ b/packages/mosaic/src/commands/comms.ts @@ -62,7 +62,10 @@ export function registerCommsCommand(program: Command): void { .description('send [message...] — same-host tmux unless --site is given') .option('--class ', 'terminal-log | actionable | human | reaction | digest') .option('--file ', 'message body from file (same-host path only)') - .option('--socket ', 'tmux socket for the same-host send (e.g. mosaic-fleet)') + .option( + '--socket ', + 'tmux socket for the same-host send (e.g. mosaic-fleet). OMIT it to let agent-send.sh resolve the socket (explicit -L > MOSAIC_TMUX_SOCKET > unique hit; ambiguity refuses with its exit 4).', + ) .option('--site ', 'route via fleet-comms to /') .option('--comms-repo ', 'fleet-comms checkout', defaultCommsRepo()) .argument('', 'destination seat (session name)')