refactor: remove PAPERCLIP_DEV_API_KEY runtime hack throughout

Cancel poll now uses ctx.authToken exclusively. Remove forwarding of
PAPERCLIP_DEV_API_KEY into job pods and all associated tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 07:24:14 -04:00
parent 570fdae9c4
commit 2d057f085d
5 changed files with 4 additions and 51 deletions
+1 -3
View File
@@ -569,9 +569,7 @@ async function streamAndAwaitJob(
await new Promise<void>((resolve) => setTimeout(resolve, KEEPALIVE_INTERVAL_MS));
if (logStopSignal.stopped || cancelSignal.cancelled) break;
try {
// Prefer PAPERCLIP_DEV_API_KEY if set (dev override), otherwise use
// the per-run authToken issued by Paperclip for this execution.
const apiKey = process.env.PAPERCLIP_DEV_API_KEY ?? ctx.authToken ?? "";
const apiKey = ctx.authToken ?? "";
const resp = await fetch(`${apiUrl}/api/issues/${issueId}`, {
headers: { Authorization: `Bearer ${apiKey}` },
});