diff --git a/.devcontainer/codespaces/agent-worker.mjs b/.devcontainer/codespaces/agent-worker.mjs index 5c716a6ad5d..65ad2d556e2 100644 --- a/.devcontainer/codespaces/agent-worker.mjs +++ b/.devcontainer/codespaces/agent-worker.mjs @@ -51,6 +51,10 @@ for (const [k, v] of Object.entries({ } } +// Not fatal, but box pinning needs it: without a box id every turn routes by +// owner, so a thread cannot follow the box holding its session. +if (!BOX_ID) console.error('CODESPACE_NAME is not set — box pinning disabled; turns route by githubUser only.'); + function runClaude({ message, sessionId, cwd }) { const safeCwd = resolvePath(typeof cwd === 'string' && cwd ? cwd : `${ROOT}/n8n`); if (safeCwd !== ROOT && !safeCwd.startsWith(ROOT + sep)) diff --git a/.devcontainer/codespaces/docker-compose.yml b/.devcontainer/codespaces/docker-compose.yml index 8a792dcf35b..cab52a55f1d 100644 --- a/.devcontainer/codespaces/docker-compose.yml +++ b/.devcontainer/codespaces/docker-compose.yml @@ -28,3 +28,6 @@ services: DB_POSTGRESDB_PASSWORD: password # Prompt-cache TTL in seconds. 1 hour keeps the cache warm between turns. ANTHROPIC_PROMPT_CACHE_TTL: "3600" + # Compose does not inherit the codespace env. Pass the box name through so + # the worker can stamp boxId and dev:up can print the forwarded URL. + CODESPACE_NAME: ${CODESPACE_NAME:-}