diff --git a/container/agent-runner/src/db/messages-in.ts b/container/agent-runner/src/db/messages-in.ts index dc6eeac83..94f208059 100644 --- a/container/agent-runner/src/db/messages-in.ts +++ b/container/agent-runner/src/db/messages-in.ts @@ -56,7 +56,7 @@ function getMaxMessagesPerPrompt(): number { * Reads from inbound.db (read-only), filters against processing_ack in outbound.db * to skip messages already picked up by this or a previous container run. * - * Returns the most recent `MAX_MESSAGES_PER_PROMPT` pending rows in + * Returns the most recent `maxMessagesPerPrompt` pending rows in * chronological order, regardless of their `trigger` flag: accumulated * context (trigger=0) rides along with the wake-eligible rows so the agent * sees the prior context it missed. Host's countDueMessages gates waking on @@ -163,4 +163,3 @@ export function findQuestionResponse(questionId: string): MessageInRow | undefin inbound.close(); } } - diff --git a/package.json b/package.json index ce57347d6..856d776e5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "setup:auto": "tsx setup/auto.ts", "ncl": "tsx src/cli/client.ts", "chat": "tsx scripts/chat.ts", - "auth": "tsx src/whatsapp-auth.ts", "lint": "eslint src/", "lint:fix": "eslint src/ --fix", "test": "vitest run", diff --git a/src/config.ts b/src/config.ts index c3d5185d5..2f4950e7d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,36 +37,14 @@ export const CONTAINER_IMAGE = process.env.CONTAINER_IMAGE || getDefaultContaine // cleanupOrphans only reaps containers from this install, not peers. export const INSTALL_SLUG = getInstallSlug(PROJECT_ROOT); export const CONTAINER_INSTALL_LABEL = `nanoclaw-install=${INSTALL_SLUG}`; -export const CONTAINER_TIMEOUT = parseInt(process.env.CONTAINER_TIMEOUT || '1800000', 10); -export const CONTAINER_MAX_OUTPUT_SIZE = parseInt(process.env.CONTAINER_MAX_OUTPUT_SIZE || '10485760', 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); -export const IDLE_TIMEOUT = parseInt(process.env.IDLE_TIMEOUT || '1800000', 10); // 30min default — how long to keep container alive after last result -export const MAX_CONCURRENT_CONTAINERS = Math.max(1, parseInt(process.env.MAX_CONCURRENT_CONTAINERS || '5', 10) || 5); // Per-container resource caps, passed through to `docker run`. Default empty = // no flag added = today's unbounded behavior (don't OOM existing OSS workloads). // Operators opt in: CONTAINER_CPU_LIMIT=2, CONTAINER_MEMORY_LIMIT=8g. export const CONTAINER_CPU_LIMIT = process.env.CONTAINER_CPU_LIMIT || ''; export const CONTAINER_MEMORY_LIMIT = process.env.CONTAINER_MEMORY_LIMIT || ''; -function escapeRegex(str: string): string { - return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); -} - -export function buildTriggerPattern(trigger: string): RegExp { - return new RegExp(`^${escapeRegex(trigger.trim())}\\b`, 'i'); -} - -export const DEFAULT_TRIGGER = `@${ASSISTANT_NAME}`; - -export function getTriggerPattern(trigger?: string): RegExp { - const normalizedTrigger = trigger?.trim(); - return buildTriggerPattern(normalizedTrigger || DEFAULT_TRIGGER); -} - -export const TRIGGER_PATTERN = buildTriggerPattern(DEFAULT_TRIGGER); - // Timezone for scheduled tasks, message formatting, etc. // Validates each candidate is a real IANA identifier before accepting. function resolveConfigTimezone(): string {