fix: deduplicate CI watchers and remove task ID from watcher prompts

Prevent duplicate CI completion notifications in paired rooms by checking
for existing active watchers with the same channel+provider+metadata before
creating a new one. Remove Task ID from watcher prompt construction to
avoid router secret redaction (task- IDs contain sk- pattern), passing
EJCLAW_RUNTIME_TASK_ID via env var instead and making cancel_task
auto-resolve when task_id is omitted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eyejoker
2026-03-26 20:57:59 +09:00
parent b6dc500daf
commit 7b63ba859d
12 changed files with 74 additions and 71 deletions

View File

@@ -326,9 +326,6 @@ describe('task scheduler', () => {
Watch target:
GitHub Actions run 123456
Task ID:
task-watch-group
Check instructions:
Check the run.
`.trim(),
@@ -890,9 +887,6 @@ Check the run.
Watch target:
GitHub Actions run 654321
Task ID:
task-watch-immediate
Check instructions:
Check the run.
`.trim(),
@@ -928,9 +922,6 @@ Check the run.
Watch target:
GitHub Actions run 123456
Task ID:
task-watch-runtime
Check instructions:
Check the run.
`.trim(),
@@ -1004,9 +995,6 @@ Check the run.
Watch target:
GitHub Actions run 123456
Task ID:
task-github-running
Check instructions:
Managed by host-driven watcher.
`.trim(),
@@ -1082,9 +1070,6 @@ Managed by host-driven watcher.
Watch target:
GitHub Actions run 654321
Task ID:
task-github-complete
Check instructions:
Managed by host-driven watcher.
`.trim(),
@@ -1149,9 +1134,6 @@ Managed by host-driven watcher.
Watch target:
GitHub Actions run 222222
Task ID:
task-github-backoff
Check instructions:
Managed by host-driven watcher.
`.trim(),
@@ -1220,9 +1202,6 @@ Managed by host-driven watcher.
Watch target:
GitHub Actions run 333333
Task ID:
task-github-pause
Check instructions:
Managed by host-driven watcher.
`.trim(),
@@ -1284,9 +1263,6 @@ Managed by host-driven watcher.
Watch target:
GitHub Actions run 999999
Task ID:
task-watch-expired
Check instructions:
Check the run.
`.trim(),
@@ -1389,9 +1365,6 @@ Check the run.
Watch target:
GitHub Actions run 123456
Task ID:
task-123
Check instructions:
Check the run.
`.trim();
@@ -1428,9 +1401,6 @@ Check the run.
Watch target:
GitHub Actions run 123456
Task ID:
task-123
Check instructions:
Check the run.
`.trim();
@@ -1463,9 +1433,6 @@ Check the run.
Watch target:
GitHub Actions run 123456
Task ID:
task-watch-status
Check instructions:
Check the run.
`.trim(),
@@ -1527,9 +1494,6 @@ Check the run.
Watch target:
PR #77 checks
Task ID:
task-watch-status-edit-fail
Check instructions:
Check the run.
`.trim(),