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
+2
View File
@@ -13,6 +13,7 @@ import chalk from 'chalk'
import { configuration } from '@/configuration'
import { readSettings, updateSettings } from '@/persistence'
import { initializeApiUrl } from '@/ui/apiUrlInit'
import { initializeExtraHeaders } from '@/ui/extraHeadersInit'
/**
* Initialize CLI API token
@@ -21,6 +22,7 @@ import { initializeApiUrl } from '@/ui/apiUrlInit'
export async function initializeToken(): Promise<void> {
// Initialize API URL first (env > settings.json > default)
await initializeApiUrl()
await initializeExtraHeaders()
// 1. Environment variable has highest priority (allows temporary override)
if (configuration.cliApiToken) {