From 779a9ac73e8933f448c120f83f2e539c2c8c8921 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Tue, 24 Mar 2026 21:39:45 -0400 Subject: [PATCH] CEO: copy runtime config files (opencode.json, .mcp.json) to agent cwd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The agents repo is not the agent's cwd — opencode.json and .mcp.json must exist in the cwd at runtime for permissions and MCP access. CEO now copies these files from the repo to each agent's cwd during the sync step. Co-Authored-By: Claude Opus 4.6 (1M context) --- ceo/HEARTBEAT.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ceo/HEARTBEAT.md b/ceo/HEARTBEAT.md index 068d6e9..20384d9 100644 --- a/ceo/HEARTBEAT.md +++ b/ceo/HEARTBEAT.md @@ -61,6 +61,18 @@ For each agent whose files changed in the diff: - ALWAYS preserve `env` values that contain secrets — the repo may have redacted placeholders, do NOT overwrite live secrets with redacted values - For `claude_local` agents: ensure `instructionsFilePath` is always present in the merged config +**Copy runtime config files to agent cwd:** + +After patching the API, copy any runtime config files (`opencode.json`, `.mcp.json`) from the agent's directory in this repo to their `cwd` (from `CONFIG.md` adapter config). These files must exist in the agent's working directory at runtime — the repo is not the cwd. + + # For each agent with an opencode.json or .mcp.json in their repo directory: + AGENT_CWD=$(jq -r '.cwd' <<< "$ADAPTER_CONFIG") + mkdir -p "$AGENT_CWD" + cp /paperclip/privilegedescalation/agents/engineering//opencode.json "$AGENT_CWD/" 2>/dev/null || true + cp /paperclip/privilegedescalation/agents/engineering//.mcp.json "$AGENT_CWD/" 2>/dev/null || true + +This applies to all `opencode_local` agents (they need `opencode.json` in cwd for permissions and MCP config) and `claude_local` agents with `.mcp.json` (for MCP server access). + **Handling new agents (placeholder IDs):** If an agent directory exists in the diff but its `CONFIG.md` contains `` (or any `<..._PLACEHOLDER>` value) instead of a real UUID, this is a **new hire** that needs to be created: