fix: forward ONECLI_API_KEY to OneCLI SDK for authenticated container config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
johnnyfish
2026-04-15 00:20:28 +03:00
parent 934f063aff
commit 8b5b5818e0
2 changed files with 5 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ const envConfig = readEnvFile([
'ASSISTANT_NAME',
'ASSISTANT_HAS_OWN_NUMBER',
'ONECLI_URL',
'ONECLI_API_KEY',
'TZ',
]);
@@ -52,6 +53,8 @@ export const CONTAINER_MAX_OUTPUT_SIZE = parseInt(
10,
); // 10MB default
export const ONECLI_URL = process.env.ONECLI_URL || envConfig.ONECLI_URL;
export const ONECLI_API_KEY =
process.env.ONECLI_API_KEY || envConfig.ONECLI_API_KEY;
export const MAX_MESSAGES_PER_PROMPT = Math.max(
1,
parseInt(process.env.MAX_MESSAGES_PER_PROMPT || '10', 10) || 10,

View File

@@ -13,6 +13,7 @@ import {
DATA_DIR,
GROUPS_DIR,
IDLE_TIMEOUT,
ONECLI_API_KEY,
ONECLI_URL,
TIMEZONE,
} from './config.js';
@@ -28,7 +29,7 @@ import { OneCLI } from '@onecli-sh/sdk';
import { validateAdditionalMounts } from './mount-security.js';
import { RegisteredGroup } from './types.js';
const onecli = new OneCLI({ url: ONECLI_URL });
const onecli = new OneCLI({ url: ONECLI_URL, apiKey: ONECLI_API_KEY });
// Sentinel markers for robust output parsing (must match agent-runner)
const OUTPUT_START_MARKER = '---NANOCLAW_OUTPUT_START---';