Skip to content

fix: agent-runner source not updating for existing groups#1053

Open
wenkang-xie wants to merge 1 commit intoqwibitai:mainfrom
wenkang-xie:fix/agent-runner-source-hotupdate
Open

fix: agent-runner source not updating for existing groups#1053
wenkang-xie wants to merge 1 commit intoqwibitai:mainfrom
wenkang-xie:fix/agent-runner-source-hotupdate

Conversation

@wenkang-xie
Copy link

Summary

  • Agent-runner source code was cached per-group on first run and never refreshed, preventing new MCP tools or source changes from reaching existing groups
  • Replaced single copy-on-first-run approach with a two-layer mount system: src-global (read-only, shared) + src-custom (read-write, per-group overrides)
  • Container entrypoint now merges both layers into /tmp/src at startup, compiles with a pre-built tsconfig.build.json, and symlinks node_modules from /app

Changes

File Description
src/container-runner.ts Replace !fs.existsSync copy-once logic with two-layer mount (src-global + src-custom)
container/Dockerfile Add entrypoint script for source merge, pre-create tsconfig.build.json targeting /tmp/src

Root cause

The original code checked if (!fs.existsSync(groupAgentRunnerDir)) before copying source, meaning once a group's source directory existed, it was never updated. Any new MCP tools added to container/agent-runner/src/ would only appear for newly created groups.

Test plan

  • npm run build passes
  • npm test passes (271 tests)
  • Container builds successfully with ./container/build.sh
  • Verified new MCP tools appear in existing group sessions after restart
  • Verified per-group custom source overrides work via src-custom mount

🤖 Generated with Claude Code

The previous logic copied agent-runner source to a per-group cache on
first run and never updated it. This meant new MCP tools or bug fixes
to ipc-mcp-stdio.ts would never reach existing groups.

Replace with a two-layer mount approach:
- /app/src-global (read-only): always-current global source
- /app/src-custom (read-write): per-group tool overrides/additions
- Entrypoint merges both into /tmp/src before compilation

Global updates propagate automatically on next container start.
Per-group custom files are preserved. Same-named files: custom wins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Andy-NanoClaw-AI Andy-NanoClaw-AI added Status: Needs Review Ready for maintainer review PR: Fix Bug fix labels Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Fix Bug fix Status: Needs Review Ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants