From 13fe0f2e56db3498a49eea16b079775119697ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Fri, 10 Jul 2026 22:30:20 +0700 Subject: [PATCH 1/6] Update index.ts --- src/config/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index b1b9ea3..17fa577 100755 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -516,7 +516,7 @@ class ConfigManager { constructor() { this.config = new Conf({ - projectName: 't3mp3st', + projectName: 'T3MP3ST', defaults: DEFAULT_SETTINGS, }); @@ -533,7 +533,7 @@ class ConfigManager { // operators often run T3MP3ST inside target repos, and importing that repo's // secrets would contaminate this process with unrelated credentials. const envPaths = [ - join(homedir(), '.t3mp3st', '.env'), + join(homedir(), 'T3MP3ST', '.env'), join(homedir(), '.env'), ]; From 971a452eac974cf0c4812efbc1f2ff40b8de6be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Fri, 10 Jul 2026 22:56:13 +0700 Subject: [PATCH 2/6] Update index.ts --- src/config/index.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/config/index.ts b/src/config/index.ts index 17fa577..b50df32 100755 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -537,6 +537,8 @@ class ConfigManager { join(homedir(), '.env'), ]; + let envProvider: string | undefined; + for (const envPath of envPaths) { if (existsSync(envPath)) { const envContent = readFileSync(envPath, 'utf-8'); @@ -553,9 +555,18 @@ class ConfigManager { // empty OPENROUTER_API_KEY= — the .env file no longer clobbers it. if (key && value && process.env[key] === undefined) { process.env[key] = value; + + // Track LLM_PROVIDER for default provider + if (key === 'LLM_PROVIDER') { + envProvider = value; + } } } } + // Set TEMPEST_DEFAULT_PROVIDER if LLM_PROVIDER found + if (envProvider && !process.env.TEMPEST_DEFAULT_PROVIDER) { + process.env.TEMPEST_DEFAULT_PROVIDER = envProvider; + } break; } } @@ -674,7 +685,16 @@ class ConfigManager { * Get the LLM configuration for the default or specified provider */ getLLMConfig(provider?: LLMProvider, model?: string): LLMConfig { - const actualProvider = provider || this.config.get('defaultProvider'); + let actualProvider = provider; + + if (!actualProvider) { + const envProvider = process.env.TEMPEST_DEFAULT_PROVIDER?.trim(); + if (envProvider) { + actualProvider = envProvider as LLMProvider; + } else { + actualProvider = this.config.get('defaultProvider'); + } + } let apiKey: string | undefined; let baseUrl: string | undefined; From e1dda33bc403852ea2827c4c03bf29e31732f654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Fri, 10 Jul 2026 23:06:49 +0700 Subject: [PATCH 3/6] Update setup-api.sh --- scripts/setup-api.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-api.sh b/scripts/setup-api.sh index bd5c043..7dfae64 100755 --- a/scripts/setup-api.sh +++ b/scripts/setup-api.sh @@ -10,7 +10,7 @@ echo "║ T3MP3ST API KEY CONFIGURATION ║" echo "╚═══════════════════════════════════════════════════════════╝" echo "" -ENV_FILE="$HOME/.t3mp3st/.env" +ENV_FILE="$HOME/T3MP3ST/.env" mkdir -p "$(dirname "$ENV_FILE")" if [ -f "$ENV_FILE" ]; then From 788e90e0ee8aa327e4a8995b4213e8d0f1a03af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Sat, 11 Jul 2026 05:48:06 +0700 Subject: [PATCH 4/6] Update index.ts --- src/config/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index b50df32..80417c8 100755 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -516,7 +516,7 @@ class ConfigManager { constructor() { this.config = new Conf({ - projectName: 'T3MP3ST', + projectName: 't3mp3st', defaults: DEFAULT_SETTINGS, }); @@ -533,7 +533,7 @@ class ConfigManager { // operators often run T3MP3ST inside target repos, and importing that repo's // secrets would contaminate this process with unrelated credentials. const envPaths = [ - join(homedir(), 'T3MP3ST', '.env'), + join(homedir(), '.t3mp3st', '.env'), join(homedir(), '.env'), ]; @@ -544,6 +544,9 @@ class ConfigManager { const envContent = readFileSync(envPath, 'utf-8'); const lines = envContent.split('\n'); + // Validation variables added + const VALID_PROVIDERS = ['openrouter', 'venice', 'anthropic', 'openai', 'xai', 'gemini', 'local']; + for (const line of lines) { const trimmed = line.trim(); if (trimmed && !trimmed.startsWith('#')) { @@ -557,8 +560,8 @@ class ConfigManager { process.env[key] = value; // Track LLM_PROVIDER for default provider - if (key === 'LLM_PROVIDER') { - envProvider = value; + if (key === 'LLM_PROVIDER' && VALID_PROVIDERS.includes(value.toLowerCase())) { + envProvider = value.toLowerCase(); } } } From 7e946ec92e37aaddd8384ce40e5009d4f6043032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Sat, 11 Jul 2026 05:49:00 +0700 Subject: [PATCH 5/6] Update setup-api.sh --- scripts/setup-api.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-api.sh b/scripts/setup-api.sh index 7dfae64..bd5c043 100755 --- a/scripts/setup-api.sh +++ b/scripts/setup-api.sh @@ -10,7 +10,7 @@ echo "║ T3MP3ST API KEY CONFIGURATION ║" echo "╚═══════════════════════════════════════════════════════════╝" echo "" -ENV_FILE="$HOME/T3MP3ST/.env" +ENV_FILE="$HOME/.t3mp3st/.env" mkdir -p "$(dirname "$ENV_FILE")" if [ -f "$ENV_FILE" ]; then From 64efcf63731d4e7eed8cc75b3c39b4f9465fedb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AB=E3=82=B8=E3=83=BC=F0=9F=90=A7?= Date: Sat, 11 Jul 2026 06:04:11 +0700 Subject: [PATCH 6/6] Update index.ts --- src/config/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config/index.ts b/src/config/index.ts index 80417c8..60e3efa 100755 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -538,15 +538,14 @@ class ConfigManager { ]; let envProvider: string | undefined; - + for (const envPath of envPaths) { if (existsSync(envPath)) { const envContent = readFileSync(envPath, 'utf-8'); const lines = envContent.split('\n'); - // Validation variables added const VALID_PROVIDERS = ['openrouter', 'venice', 'anthropic', 'openai', 'xai', 'gemini', 'local']; - + for (const line of lines) { const trimmed = line.trim(); if (trimmed && !trimmed.startsWith('#')) { @@ -689,7 +688,7 @@ class ConfigManager { */ getLLMConfig(provider?: LLMProvider, model?: string): LLMConfig { let actualProvider = provider; - + if (!actualProvider) { const envProvider = process.env.TEMPEST_DEFAULT_PROVIDER?.trim(); if (envProvider) {