fix: prepare CLAUDE.md and roomRoleContext for container reviewer

Container reviewer was running without prompts because the container
path in agent-runner.ts skipped prepareGroupEnvironment() entirely.
This meant no CLAUDE.md (platform + paired room prompts + memory
briefing) and no roomRoleContext were passed to the container.

- Add prepareContainerSessionEnvironment() to write CLAUDE.md, sync
  skills, and ensure settings.json for the reviewer session directory
- Pass roomRoleContext through ReviewerContainerInput so the runner
  can prepend the [ROOM_ROLE] header
- Add roomRoleContext field to ReviewerContainerInput interface
This commit is contained in:
Eyejoker
2026-03-30 01:12:47 +09:00
parent cb66510378
commit d024b763f0
3 changed files with 76 additions and 1 deletions

View File

@@ -12,7 +12,10 @@ import {
AGENT_TIMEOUT,
IDLE_TIMEOUT,
} from './config.js';
import { prepareGroupEnvironment } from './agent-runner-environment.js';
import {
prepareContainerSessionEnvironment,
prepareGroupEnvironment,
} from './agent-runner-environment.js';
import { getEnv } from './env.js';
export {
type AvailableGroup,
@@ -75,6 +78,19 @@ export async function runAgentProcess(
if (envOverrides?.EJCLAW_REVIEWER_RUNTIME === '1') {
const ownerWorkspaceDir =
envOverrides?.EJCLAW_WORK_DIR || group.workDir || process.cwd();
// Prepare session directory for the container (CLAUDE.md, skills, settings)
// so the Claude SDK inside the container has platform & paired room prompts.
const sessionDir = envOverrides?.CLAUDE_CONFIG_DIR;
if (sessionDir) {
prepareContainerSessionEnvironment({
sessionDir,
chatJid: input.chatJid,
isMain: input.isMain,
memoryBriefing: input.memoryBriefing,
});
}
return runReviewerContainer({
group,
input: {
@@ -85,6 +101,7 @@ export async function runAgentProcess(
runId: input.runId || `${Date.now()}`,
isMain: input.isMain,
assistantName: input.assistantName,
roomRoleContext: input.roomRoleContext,
},
ownerWorkspaceDir,
envOverrides,