mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
Fix: Correctly detect agent platform for locks
- Updated `src/utils.mjs` to detect 'claude' platform via `CLAUDE_API_KEY`, `ANTHROPIC_API_KEY`, or `CLAUDE_SESSION_ID`. - Updated `scripts/agent/scheduler-utils.mjs` `getSafeEnv` to preserve `JULES_`, `CODEX_`, `CLAUDE_`, `ANTHROPIC_`, and `GOOSE_` environment variables when spawning child processes. - Updated `scripts/agent/run-scheduler-cycle.mjs` to use `detectPlatform()` as a fallback for `AGENT_PLATFORM` instead of hardcoding `'codex'`, ensuring the correct platform is used for lock creation. - Added unit tests for `detectPlatform` in `test/utils.test.mjs`. This resolves the issue where lock cards displayed "Unknown" or incorrect platforms. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
a5c8912487
commit
ae2e382bfd
4 files changed
+69
-3
No files matched your search
@@ -25,6 +25,8 @@ import {
|
||||
summarizeLockFailureReasons,
|
||||
} from './scheduler-lock.mjs';
|
||||
|
||||
import { detectPlatform } from '../../src/utils.mjs';
|
||||
|
||||
const VALID_CADENCES = new Set(['daily', 'weekly']);
|
||||
const ALL_EXCLUDED_REASON = 'All roster tasks currently claimed by other agents';
|
||||
const FAILURE_CATEGORY = {
|
||||
@@ -35,7 +37,7 @@ const FAILURE_CATEGORY = {
|
||||
};
|
||||
|
||||
function parseArgs(argv) {
|
||||
const args = { cadence: null, platform: process.env.AGENT_PLATFORM || 'codex', model: process.env.AGENT_MODEL || null };
|
||||
const args = { cadence: null, platform: process.env.AGENT_PLATFORM || detectPlatform() || 'unknown', model: process.env.AGENT_MODEL || null };
|
||||
for (let i = 0; i < argv.length; i += 1) {
|
||||
const value = argv[i];
|
||||
if (!value.startsWith('--') && !args.cadence) {
|
||||
|
||||
@@ -20,7 +20,12 @@ export function getSafeEnv() {
|
||||
key.startsWith('NOSTR_') ||
|
||||
key.startsWith('TORCH_') ||
|
||||
key.startsWith('SCHEDULER_') ||
|
||||
key.startsWith('AGENT_')) {
|
||||
key.startsWith('AGENT_') ||
|
||||
key.startsWith('JULES_') ||
|
||||
key.startsWith('CODEX_') ||
|
||||
key.startsWith('CLAUDE_') ||
|
||||
key.startsWith('ANTHROPIC_') ||
|
||||
key.startsWith('GOOSE_')) {
|
||||
safeEnv[key] = process.env[key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user