fix(cli): load extra headers from settings (#1041)

* test: reproduce issue #786

* fix: load extra headers from settings (closes #786)

* test: cover extra header precedence and redaction

* fix: redact persisted extra headers in diagnostics

* test: cover runner extra header identity

* fix: restart runner when extra headers change
This commit is contained in:
SSU-WEI HUANG
2026-07-16 12:27:50 +08:00
committed by GitHub
parent e87e875d72
commit c87720ab4d
14 changed files with 356 additions and 25 deletions
+3 -1
View File
@@ -25,7 +25,7 @@ import { validateWorkspaceDirectory } from './validateWorkspaceDirectory';
import { join } from 'path';
import { buildMachineMetadata } from '@/agent/sessionFactory';
import { resolveWorkspaceRoots } from '@/utils/workspaceRoot';
import { hashRunnerCliApiToken } from './runnerIdentity';
import { hashRunnerCliApiToken, hashRunnerExtraHeaders } from './runnerIdentity';
import { scheduleCursorModelsPrewarm } from '@/modules/common/cursorModelsPrewarm';
export async function startRunner(options: { workspaceRoots?: string[] } = {}): Promise<void> {
@@ -744,6 +744,7 @@ export async function startRunner(options: { workspaceRoots?: string[] } = {}):
startedWithApiUrl: configuration.apiUrl,
startedWithMachineId: machineId,
startedWithCliApiTokenHash: hashRunnerCliApiToken(configuration.cliApiToken),
startedWithExtraHeadersHash: hashRunnerExtraHeaders(configuration.extraHeaders),
startedWithArgv,
startedWithVersionHandoffDisabled,
runnerLogPath: logger.logFilePath
@@ -1021,6 +1022,7 @@ export async function startRunner(options: { workspaceRoots?: string[] } = {}):
startedWithApiUrl: fileState.startedWithApiUrl,
startedWithMachineId: fileState.startedWithMachineId,
startedWithCliApiTokenHash: fileState.startedWithCliApiTokenHash,
startedWithExtraHeadersHash: fileState.startedWithExtraHeadersHash,
startedWithArgv,
startedWithVersionHandoffDisabled,
lastHeartbeat: new Date().toLocaleString(),