Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/docker-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ export function generateDockerCompose(
fs.mkdirSync(parentDir, { recursive: true, mode: 0o755 });
}
// Create empty file that will be populated by entrypoint
fs.writeFileSync(claudeJsonPath, '{}', { mode: 0o600 });
// Use 0o666 mode to allow container root to write and host user to read
// The entrypoint script runs as root and modifies this file
fs.writeFileSync(claudeJsonPath, '{}', { mode: 0o666 });
Comment on lines +563 to +565

Copilot AI Feb 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entrypoint script sets chmod 600 on this file after writing to it (containers/agent/entrypoint.sh:153 and :160). This will make the file owned by root with 600 permissions, which will prevent the host user from reading it.

To fix this, the entrypoint script should either:

  1. Set chmod 644 instead of chmod 600 to allow read access
  2. Or use chmod a+r to add read permissions for all users

The current approach of setting 0o666 here won't work because the entrypoint script's chmod command will override these permissions.

Suggested change
// Use 0o666 mode to allow container root to write and host user to read
// The entrypoint script runs as root and modifies this file
fs.writeFileSync(claudeJsonPath, '{}', { mode: 0o666 });
// The entrypoint script runs as root, writes to this file, and sets restrictive permissions
// Use 0o600 here to align with the entrypoint's chmod behavior
fs.writeFileSync(claudeJsonPath, '{}', { mode: 0o600 });

Copilot uses AI. Check for mistakes.
logger.debug(`Created ${claudeJsonPath} for chroot mounting`);
}
agentVolumes.push(`${claudeJsonPath}:/host${claudeJsonPath}:rw`);
Expand Down