Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bridge/spawner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('AgentSpawner', () => {
expect(execAsyncMock).toHaveBeenNthCalledWith(1, `tmux has-session -t ${session} 2>/dev/null`);
expect(execAsyncMock).toHaveBeenNthCalledWith(2, `tmux new-window -t ${session} -n Dev1 -c "${projectRoot}"`);
expect(execAsyncMock).toHaveBeenNthCalledWith(3, 'which agent-relay'); // Find full path
expect(execAsyncMock).toHaveBeenNthCalledWith(4, `tmux send-keys -t ${session}:Dev1 'unset TMUX && /usr/local/bin/agent-relay -n Dev1 claude --dangerously-skip-permissions' Enter`);
expect(execAsyncMock).toHaveBeenNthCalledWith(4, `tmux send-keys -t ${session}:Dev1 'unset TMUX && /usr/local/bin/agent-relay -n Dev1 -- claude --dangerously-skip-permissions' Enter`);
expect(execAsyncMock).toHaveBeenNthCalledWith(5, `tmux send-keys -t ${session}:Dev1 -l "escaped:Finish the report"`);
expect(execAsyncMock).toHaveBeenNthCalledWith(6, `tmux send-keys -t ${session}:Dev1 Enter`);
expect(sleepMock).toHaveBeenCalledWith(100);
Expand All @@ -124,7 +124,7 @@ describe('AgentSpawner', () => {
// Check that the command includes --dangerously-skip-permissions for claude:opus
expect(execAsyncMock).toHaveBeenNthCalledWith(
4,
`tmux send-keys -t ${session}:Opus1 'unset TMUX && /usr/local/bin/agent-relay -n Opus1 claude:opus --dangerously-skip-permissions' Enter`
`tmux send-keys -t ${session}:Opus1 'unset TMUX && /usr/local/bin/agent-relay -n Opus1 -- claude:opus --dangerously-skip-permissions' Enter`
);
});

Expand All @@ -144,7 +144,7 @@ describe('AgentSpawner', () => {
// Check that the command does NOT include --dangerously-skip-permissions for codex
expect(execAsyncMock).toHaveBeenNthCalledWith(
4,
`tmux send-keys -t ${session}:Codex1 'unset TMUX && /usr/local/bin/agent-relay -n Codex1 codex' Enter`
`tmux send-keys -t ${session}:Codex1 'unset TMUX && /usr/local/bin/agent-relay -n Codex1 -- codex' Enter`
);
});

Expand Down
9 changes: 6 additions & 3 deletions src/dashboard/needs-attention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ export function computeNeedsAttention(messages: AttentionMessage[]): Set<string>
const ts = Date.parse(message.timestamp);
if (Number.isNaN(ts)) continue;

// Detect broadcasts: either explicit isBroadcast flag or to === '*'
const isBroadcast = message.isBroadcast || message.to === '*';

// Inbound: messages directed to a specific agent (ignore broadcasts)
// Note: isBroadcast indicates the message was originally a broadcast, even though
// the 'to' field is set to the individual recipient for storage purposes
if (message.to && !message.isBroadcast) {
if (message.to && !isBroadcast) {
const inboundKey = message.thread ? `thread:${message.thread}` : `sender:${message.from}`;
updateLatest(latestInbound, message.to, inboundKey, ts);
}
Expand All @@ -59,7 +62,7 @@ export function computeNeedsAttention(messages: AttentionMessage[]): Set<string>
if (message.from) {
const outboundKey = message.thread
? `thread:${message.thread}`
: (message.to && !message.isBroadcast)
: (message.to && !isBroadcast)
? `sender:${message.to}`
: null;

Expand All @@ -69,7 +72,7 @@ export function computeNeedsAttention(messages: AttentionMessage[]): Set<string>

// Broadcasts clear attention: agent is actively participating
// Track as a "catch-all" outbound timestamp for this agent
if (message.isBroadcast) {
if (isBroadcast) {
updateLatest(latestOutbound, message.from, '__broadcast__', ts);
}
}
Expand Down
Loading