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.

test(canvas): strip comments before matching instead of a nested-quantifier regex

review8927bd9c766b
diff --git a/src/renderer/canvas/claude-subagent-wiring.source.test.ts b/src/renderer/canvas/claude-subagent-wiring.source.test.ts
index 28d70d677..b11675c8e 100644
--- a/src/renderer/canvas/claude-subagent-wiring.source.test.ts
+++ b/src/renderer/canvas/claude-subagent-wiring.source.test.ts
@@ -17,8 +17,9 @@ function between(from: string, to: string): string {
describe('Canvas agent-status listener — Claude native subagents', () => {
it('a start that supersedes a tool-drawn card hands the old key to the store (one card, not two)', () => {
- const branch = between("case 'subagent-start':", "case 'subagent-end':")
- expect(branch).toMatch(/an\.start\(\s*e\.toolUseId,[\s\S]*?\},(\s*\/\/[^\n]*)*\s*e\.supersedes\s*\)/)
+ // Comments stripped first, so one between the arguments does not hide (or fake) the argument.
+ const branch = between("case 'subagent-start':", "case 'subagent-end':").replace(/\/\/[^\n]*/g, '')
+ expect(branch).toMatch(/an\.start\(\s*e\.toolUseId,[\s\S]*?\},\s*e\.supersedes\s*\)/)
})
it("a Stop that reports live background tasks stamps the node's background-task guard", () => {