Commit Graph

10 Commits

Author SHA1 Message Date
Eyejoker
37188bd98e refactor: remove auto-continue from codex runner
Auto-continue was punishing the model for thinking — text-only turns
were treated as failures and re-prompted up to 5 times with aggressive
"execute now" messages. This made Codex overly compliant and suppressed
critical thinking.

Now each turn result is delivered directly. The model decides whether
to think, push back, or execute.
2026-03-13 22:43:06 +09:00
Eyejoker
8a0e407526 feat: add Discord image receiving for Claude Code and Codex agents
Download Discord image attachments to DATA_DIR/attachments/ and pass
them as multimodal content blocks to both agent types:
- Claude Code: base64 ImageBlockParam via Agent SDK MessageParam
- Codex: localImage input block via app-server turn/start
2026-03-13 19:15:23 +09:00
Eyejoker
a10cf049ca feat: auto-continue turns when Codex responds without tool execution
Track whether tool execution occurred during each turn via approval
request notifications. If a turn completes with only text (no commands
or file changes), automatically start a follow-up turn nudging Codex
to execute rather than just describe plans. Max 5 auto-continues per
user message to prevent infinite loops.

Also strengthen instructions.md with execution-first policy.
2026-03-13 18:04:13 +09:00
Eyejoker
35277cea0a feat: codex app-server integration, token sync fix, typing fix
- Rewrite codex-runner to use `codex app-server` JSON-RPC instead of
  `codex exec`. Supports streaming (item/agentMessage/delta), session
  persistence (thread/start, thread/resume), and mid-turn message
  injection (turn/steer with IPC polling during execution).
- Fix token refresh not syncing to per-group session directories,
  causing 401 errors on running agents.
- Fix typing indicator staying on when codex returns null result
  by always clearing typing on any streaming callback.
- Update README and CLAUDE.md to reflect dual-service architecture,
  host process mode, and codex app-server integration.
2026-03-13 16:03:08 +09:00
Eyejoker
0515edc93d feat: OAuth auto-refresh, Codex session resume, MCP injection, and secret sanitization
- Add token-refresh module that auto-renews Claude OAuth tokens 30min before expiry
- Fix Codex session loss on service restart by resuming previous sessions
- Inject nanoclaw MCP server into Codex config.toml for send_message/schedule_task
- Sanitize ANTHROPIC_API_KEY and CLAUDE_CODE_OAUTH_TOKEN from Codex subprocess env
2026-03-12 02:47:24 +09:00
Eyejoker
9da32a9bb7 fix: use -c flag for codex effort instead of non-existent --effort 2026-03-11 02:28:52 +09:00
Eyejoker
021014cc56 feat: add CODEX_MODEL and CODEX_EFFORT env var support for codex-runner 2026-03-11 02:25:20 +09:00
Eyejoker
cb51ef36f9 feat: add per-group workDir for agent working directory override
Agents can now run in a specified project directory instead of the group
folder. The group's CLAUDE.md is still loaded via additionalDirectories.
2026-03-11 02:02:51 +09:00
Eyejoker
08dd468692 feat: remove container layer, run agents as direct host processes
- Rewrite container-runner.ts to spawn node processes directly instead
  of Docker/Apple Container
- Runner paths configurable via env vars (NANOCLAW_GROUP_DIR, etc.)
  with container-path defaults for backwards compat
- Pass real credentials directly (no credential proxy needed)
- Remove ensureContainerSystemRunning() and startCredentialProxy()
  from startup
- Add build:runners script for building agent-runner and codex-runner
- Fix TS strict mode errors in agent-runner ipc-mcp-stdio.ts
2026-03-10 21:05:21 +09:00
Eyejoker
4a34a9c802 feat: add Codex CLI support, dual Discord bots, and Discord typing fix
- Add Codex as alternative agent type (agentType: 'codex' per group)
- Codex container runner with session resume and 100-turn limit
- Dual Discord bot support (DISCORD_BOT_TOKEN + DISCORD_CODEX_BOT_TOKEN)
- Each bot handles only its agentType's registered groups
- Discord typing indicator refreshes every 8s (was single-shot, expired after ~10s)
- Agent runner 100-turn limit to prevent infinite bot-to-bot loops
- Apple Container runtime support (convert-to-apple-container skill)
- Session commands (/compact) support
- DB migration for agent_type column
2026-03-10 20:45:48 +09:00