Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(relay): classify agent:remote-control; let the parity pin allow more tail options

review5dbfe451c7b1
diff --git a/src/core/agents/hook-verified-parity.test.ts b/src/core/agents/hook-verified-parity.test.ts
index bbe99ea1c..aa8f96815 100644
--- a/src/core/agents/hook-verified-parity.test.ts
+++ b/src/core/agents/hook-verified-parity.test.ts
@@ -225,7 +225,7 @@ describe('both shells register a 4-arg raw listener', () => {
for (const rel of ['src/main/index.ts', 'src/server/agent-status.ts']) {
const src = code(rel)
expect(src, `${rel}: the claude context tail is not given onTurnInterrupted`).toMatch(
- /createContextTail\(pushContextUpdate, \{ onTaskNotification, onToolResult, onTurnInterrupted \}\)/
+ /createContextTail\(pushContextUpdate, \{ onTaskNotification, onToolResult, onTurnInterrupted(?:, \w+)* \}\)/
)
// The event must go through the shell's ONE hook-event path (mirror + every tap), not be
// broadcast on the side.
@@ -237,7 +237,7 @@ describe('both shells register a 4-arg raw listener', () => {
)
}
expect(code('src/main/index.ts'), 'the desktop remote (SSH) tail is not given onTurnInterrupted').toMatch(
- /createRemoteContextTail\(win, remoteFile, \{ onTaskNotification, onToolResult, onTurnInterrupted \}\)/
+ /createRemoteContextTail\(win, remoteFile, \{ onTaskNotification, onToolResult, onTurnInterrupted(?:, \w+)* \}\)/
)
})
diff --git a/src/core/relay/access-policy.test.ts b/src/core/relay/access-policy.test.ts
index fd0f0754e..db04a5f5f 100644
--- a/src/core/relay/access-policy.test.ts
+++ b/src/core/relay/access-policy.test.ts
@@ -379,6 +379,12 @@ describe('outbound filter: deny by default for non-editors', () => {
expect(filterOutboundEvent(ev(IPC.agentUnreadClear, 'n2'), ctx('viewer'))).toBe(false)
})
+ it('a Remote Control update reaches a non-editor only for a shared node, like agent:status', () => {
+ expect(filterOutboundEvent(ev(IPC.agentRemoteControl, { nodeId: 'n1', sessionId: 's', on: true }), ctx('viewer'))).toBe(true)
+ expect(filterOutboundEvent(ev(IPC.agentRemoteControl, { nodeId: 'n2', sessionId: 's', on: true }), ctx('viewer'))).toBe(false)
+ expect(filterOutboundEvent(ev(IPC.agentRemoteControl, { sessionId: 's', on: true }), ctx('commenter'))).toBe(false)
+ })
+
it('an unattributable message is dropped for a non-editor, never guessed', () => {
expect(filterOutboundEvent('not json', ctx('viewer'))).toBe(false)
expect(filterOutboundEvent(JSON.stringify({ t: 'ev', args: [] }), ctx('viewer'))).toBe(false)
diff --git a/src/core/relay/access-policy.ts b/src/core/relay/access-policy.ts
index 44d511f95..da568c84d 100644
--- a/src/core/relay/access-policy.ts
+++ b/src/core/relay/access-policy.ts
@@ -506,6 +506,7 @@ export const EDITOR_ONLY: ReadonlySet<string> = new Set<string>([
IPC.agentStatus,
IPC.agentUnreadClear,
IPC.agentSubagentActivity,
+ IPC.agentRemoteControl,
IPC.presenceSync,
IPC.presencePeer
])
@@ -564,6 +565,8 @@ export const VIEW_EVENTS: Readonly<Record<string, EventCheck>> = Object.freeze({
return typeof toolUseId === 'string' && sharedNode(owners?.get(toolUseId), ctx)
},
[IPC.agentUnreadClear]: (a, ctx) => sharedNode(a[0], ctx),
+ // Claude Remote Control on/off for one node (core/remote-control-scan.ts), judged by its node.
+ [IPC.agentRemoteControl]: (a, ctx) => sharedNode(field(a[0], 'nodeId'), ctx),
// Both carry a whole Project document.
[IPC.workspaceExternalChange]: (a, ctx) => sharedProject(field(a[0], 'id'), ctx),
[IPC.workspaceServerChange]: (a, ctx) => sharedProject(field(a[0], 'id'), ctx),
diff --git a/src/core/relay/scoped-guest-policy.ts b/src/core/relay/scoped-guest-policy.ts
index 3d3522167..041d591ca 100644
--- a/src/core/relay/scoped-guest-policy.ts
+++ b/src/core/relay/scoped-guest-policy.ts
@@ -579,6 +579,7 @@ export const SCOPED_REFUSED: ReadonlySet<string> = new Set<string>([
IPC.agentStatus,
IPC.agentUnreadClear,
IPC.agentSubagentActivity,
+ IPC.agentRemoteControl,
IPC.presenceSync,
IPC.presencePeer,
// Hosted-team verbs: answered by the Server Edition's hosted service only, never on Team Access.