From 00fcca75b47bf98bffb641508d5141a38521f481 Mon Sep 17 00:00:00 2001 From: Zbigniew Sobiecki Date: Wed, 15 Apr 2026 21:58:19 +0000 Subject: [PATCH] fix(linear): pass projectId to extractProjectIdFromJob for linear jobs Linear jobs were not handled by extractProjectIdFromJob, so the router returned null and skipped credential resolution. Workers spawned with no credentials, then fell back to the DB and died with "Credential is encrypted but CREDENTIAL_MASTER_KEY is not set" because workers intentionally don't receive the master key. Linear jobs already carry projectId on their payload (set by LinearRouterAdapter.buildJob), so the fix is a single branch in the projectId extractor. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/router/worker-env.ts | 2 +- tests/unit/router/container-manager.test.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/router/worker-env.ts b/src/router/worker-env.ts index d7b7f055..182bea74 100644 --- a/src/router/worker-env.ts +++ b/src/router/worker-env.ts @@ -23,7 +23,7 @@ export async function extractProjectIdFromJob(data: CascadeJob): Promise { expect(await extractProjectIdFromJob(job)).toBe('proj-jira'); }); + it('returns projectId for linear jobs', async () => { + const job = { type: 'linear', projectId: 'proj-linear' } as unknown as CascadeJob; + expect(await extractProjectIdFromJob(job)).toBe('proj-linear'); + }); + it('returns projectId resolved from repo for github jobs', async () => { const job = { type: 'github', repoFullName: 'owner/repo' } as CascadeJob; mockFindProjectByRepo.mockResolvedValue({ id: 'proj-gh' } as never);