From 8bd5f71a95614dffec2aaa40f4c4adb808d4a174 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Fri, 13 Mar 2026 20:22:17 +0900 Subject: [PATCH] chore: remove container legacy references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete container/build.sh (Docker build script, no longer used) - Remove "auth" npm script (whatsapp-auth.ts doesn't exist) - Remove CONTAINER_* env var fallbacks from config.ts - Update CLAUDE.md: container-runner → agent-runner, fix descriptions - Rename MAX_CONCURRENT_CONTAINERS → MAX_CONCURRENT_AGENTS in systemd --- CLAUDE.md | 9 ++++----- container/build.sh | 32 -------------------------------- package.json | 1 - src/config.ts | 18 +++++++----------- 4 files changed, 11 insertions(+), 49 deletions(-) delete mode 100755 container/build.sh diff --git a/CLAUDE.md b/CLAUDE.md index f2b0f63..3769c42 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,6 @@ # NanoClaw -Dual-agent AI assistant (Claude Code + Codex) over Discord. Fork of [qwibitai/nanoclaw](https://github.com/qwibitai/nanoclaw). +Dual-agent AI assistant (Claude Code + Codex) over Discord. Based on [qwibitai/nanoclaw](https://github.com/qwibitai/nanoclaw). ## Quick Context @@ -11,7 +11,7 @@ Two systemd services (`nanoclaw`, `nanoclaw-codex`) share the same codebase but | File | Purpose | |------|---------| | `src/index.ts` | Orchestrator: state, message loop, agent invocation | -| `src/container-runner.ts` | Spawns agent processes, manages env/sessions/MCP | +| `src/agent-runner.ts` | Spawns agent processes, manages env/sessions/skills | | `src/token-refresh.ts` | OAuth auto-refresh + session directory sync | | `src/channels/discord.ts` | Discord channel (8s typing refresh) | | `src/ipc.ts` | IPC watcher and task processing | @@ -29,7 +29,7 @@ Two systemd services (`nanoclaw`, `nanoclaw-codex`) share the same codebase but |-------|-------------| | `/setup` | First-time installation, authentication, service configuration | | `/customize` | Adding channels, integrations, changing behavior | -| `/debug` | Container issues, logs, troubleshooting | +| `/debug` | Agent issues, logs, troubleshooting | | `/update-nanoclaw` | Bring upstream NanoClaw updates into a customized install | | `/qodo-pr-resolver` | Fetch and fix Qodo PR review issues interactively or in batch | | `/get-qodo-rules` | Load org- and repo-level coding rules from Qodo before code tasks | @@ -40,8 +40,7 @@ Run commands directly—don't tell the user to run them. ```bash npm run build # Build main project -cd container/agent-runner && npm run build # Build Claude runner -cd container/codex-runner && npm run build # Build Codex runner +npm run build:runners # Install + build both runners npm run dev # Dev mode with hot reload ``` diff --git a/container/build.sh b/container/build.sh deleted file mode 100755 index b08cb6f..0000000 --- a/container/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Build the NanoClaw agent container image - -set -e - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$SCRIPT_DIR" - -IMAGE_NAME="nanoclaw-agent" -TAG="${1:-latest}" -CONTAINER_RUNTIME="${CONTAINER_RUNTIME:-container}" - -echo "Building NanoClaw agent container image..." -echo "Image: ${IMAGE_NAME}:${TAG}" - -${CONTAINER_RUNTIME} build -t "${IMAGE_NAME}:${TAG}" . - -# Build Codex agent image (if Dockerfile.codex exists) -if [ -f "$SCRIPT_DIR/Dockerfile.codex" ]; then - echo "" - echo "Building NanoClaw Codex agent container image..." - echo "Image: nanoclaw-codex-agent:${TAG}" - ${CONTAINER_RUNTIME} build -t "nanoclaw-codex-agent:${TAG}" -f Dockerfile.codex . - echo "Built nanoclaw-codex-agent:${TAG}" -fi - -echo "" -echo "Build complete!" -echo "Image: ${IMAGE_NAME}:${TAG}" -echo "" -echo "Test with:" -echo " echo '{\"prompt\":\"What is 2+2?\",\"groupFolder\":\"test\",\"chatJid\":\"test@g.us\",\"isMain\":false}' | ${CONTAINER_RUNTIME} run -i ${IMAGE_NAME}:${TAG}" diff --git a/package.json b/package.json index 09bf3a6..e5e98e5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "format:check": "prettier --check \"src/**/*.ts\"", "prepare": "husky", "setup": "tsx setup/index.ts", - "auth": "tsx src/whatsapp-auth.ts", "test": "vitest run", "test:watch": "vitest" }, diff --git a/src/config.ts b/src/config.ts index 2852fb9..d5e78e8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -33,25 +33,21 @@ export const DATA_DIR = path.resolve( ); export const AGENT_TIMEOUT = parseInt( - process.env.AGENT_TIMEOUT || process.env.CONTAINER_TIMEOUT || '1800000', + process.env.AGENT_TIMEOUT || '1800000', 10, ); export const AGENT_MAX_OUTPUT_SIZE = parseInt( - process.env.AGENT_MAX_OUTPUT_SIZE || - process.env.CONTAINER_MAX_OUTPUT_SIZE || - '10485760', + process.env.AGENT_MAX_OUTPUT_SIZE || '10485760', 10, ); // 10MB default export const IPC_POLL_INTERVAL = 1000; -export const IDLE_TIMEOUT = parseInt(process.env.IDLE_TIMEOUT || '1800000', 10); // 30min default — how long to keep agent alive after last result +export const IDLE_TIMEOUT = parseInt( + process.env.IDLE_TIMEOUT || '1800000', + 10, +); // 30min default — how long to keep agent alive after last result export const MAX_CONCURRENT_AGENTS = Math.max( 1, - parseInt( - process.env.MAX_CONCURRENT_AGENTS || - process.env.MAX_CONCURRENT_CONTAINERS || - '5', - 10, - ) || 5, + parseInt(process.env.MAX_CONCURRENT_AGENTS || '5', 10) || 5, ); function escapeRegex(str: string): string {