chore: remove container legacy references

- 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
This commit is contained in:
Eyejoker
2026-03-13 20:22:17 +09:00
parent 60de59627c
commit 8bd5f71a95
4 changed files with 11 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
# NanoClaw # 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 ## Quick Context
@@ -11,7 +11,7 @@ Two systemd services (`nanoclaw`, `nanoclaw-codex`) share the same codebase but
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `src/index.ts` | Orchestrator: state, message loop, agent invocation | | `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/token-refresh.ts` | OAuth auto-refresh + session directory sync |
| `src/channels/discord.ts` | Discord channel (8s typing refresh) | | `src/channels/discord.ts` | Discord channel (8s typing refresh) |
| `src/ipc.ts` | IPC watcher and task processing | | `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 | | `/setup` | First-time installation, authentication, service configuration |
| `/customize` | Adding channels, integrations, changing behavior | | `/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 | | `/update-nanoclaw` | Bring upstream NanoClaw updates into a customized install |
| `/qodo-pr-resolver` | Fetch and fix Qodo PR review issues interactively or in batch | | `/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 | | `/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 ```bash
npm run build # Build main project npm run build # Build main project
cd container/agent-runner && npm run build # Build Claude runner npm run build:runners # Install + build both runners
cd container/codex-runner && npm run build # Build Codex runner
npm run dev # Dev mode with hot reload npm run dev # Dev mode with hot reload
``` ```

View File

@@ -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}"

View File

@@ -15,7 +15,6 @@
"format:check": "prettier --check \"src/**/*.ts\"", "format:check": "prettier --check \"src/**/*.ts\"",
"prepare": "husky", "prepare": "husky",
"setup": "tsx setup/index.ts", "setup": "tsx setup/index.ts",
"auth": "tsx src/whatsapp-auth.ts",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest" "test:watch": "vitest"
}, },

View File

@@ -33,25 +33,21 @@ export const DATA_DIR = path.resolve(
); );
export const AGENT_TIMEOUT = parseInt( export const AGENT_TIMEOUT = parseInt(
process.env.AGENT_TIMEOUT || process.env.CONTAINER_TIMEOUT || '1800000', process.env.AGENT_TIMEOUT || '1800000',
10, 10,
); );
export const AGENT_MAX_OUTPUT_SIZE = parseInt( export const AGENT_MAX_OUTPUT_SIZE = parseInt(
process.env.AGENT_MAX_OUTPUT_SIZE || process.env.AGENT_MAX_OUTPUT_SIZE || '10485760',
process.env.CONTAINER_MAX_OUTPUT_SIZE ||
'10485760',
10, 10,
); // 10MB default ); // 10MB default
export const IPC_POLL_INTERVAL = 1000; 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( export const MAX_CONCURRENT_AGENTS = Math.max(
1, 1,
parseInt( parseInt(process.env.MAX_CONCURRENT_AGENTS || '5', 10) || 5,
process.env.MAX_CONCURRENT_AGENTS ||
process.env.MAX_CONCURRENT_CONTAINERS ||
'5',
10,
) || 5,
); );
function escapeRegex(str: string): string { function escapeRegex(str: string): string {