Default simple persona launches to direct mode#128
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR refactors the CLI's session sandboxing strategy for interactive agent launches. Instead of mounting sandboxes by default for certain harnesses, simple persona launches now run directly in the user's cwd by default, and Relayfile mounts activate only when declared mount policies, sidecars, config files, or non-Claude skill installs require filesystem isolation. ChangesConditional mounting for interactive persona launches
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f37df44 to
c145e44
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f37df446e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const useClean = decideCleanMode(harness, { | ||
| installInRepo: options.installInRepo === true, | ||
| mount: effectiveSelection.mount, | ||
| hasSidecar: Boolean(sidecarLookup.sidecar), | ||
| hasConfigFiles: harness === 'opencode', | ||
| installNeedsSandbox: harness !== 'claude' && effectiveSelection.skills.length > 0 |
There was a problem hiding this comment.
Honor project Relayfile policies when choosing mount mode
Include project-level Relayfile policy presence (.agentignore / .agentreadonly) in the decideCleanMode inputs; otherwise simple launches skip the mount even when the repo has explicit filesystem rules. In runInteractive, useClean is now derived only from persona-side flags (mount, sidecar, opencode config, non-Claude skills), and the Relayfile dotfiles are only read later inside the mount branch via buildRelayfileMountPatterns. This means repos that relied on .agentignore/.agentreadonly to hide or protect paths will silently lose those protections on default profile launches.
Useful? React with 👍 / 👎.
c145e44 to
385ef88
Compare
khaliqgant
left a comment
There was a problem hiding this comment.
Peer review — one substantive concern + a few nits.
Substantive: scope expansion vs. the original codex-only ask
The original brief and human approval was 'make codex mount conditional.' This PR also flips claude from mount-by-default to direct launch:
test('decideCleanMode: claude defaults to direct launch without a mount', () => {
assert.deepEqual(decideCleanMode('claude'), { useClean: false });
});In runInteractive:
const useClean = decideCleanMode(harness, {
installInRepo: options.installInRepo === true,
mount: effectiveSelection.mount,
hasSidecar: Boolean(sidecarLookup.sidecar),
hasConfigFiles: harness === 'opencode',
installNeedsSandbox: harness !== 'claude' && effectiveSelection.skills.length > 0
}).useClean;For plain claude personas (no claudeMd sidecar, no mount block, skills already staged via installRoot), useClean is now false. The session sees the user's real-repo CLAUDE.md, .claude/, and .mcp.json — which the mount was previously hiding.
This is a meaningful isolation change: a persona without its own claudeMd will inherit the user's CLAUDE.md instructions at runtime. Persona authors who relied on the mount to give them a clean session lose that guarantee silently.
Two ways forward:
- Narrow the PR back to codex-only, leaving claude/opencode mount-by-default. Smallest diff to current behavior, matches what was approved.
- Keep the wider change, but flag it explicitly in the PR description (it currently buries the claude flip under 'simple persona launches') and add an explicit test for the claude direct-launch behavior so reviewers see it.
I'd prefer (1) for this PR and a follow-up to design the broader 'direct by default' behavior with explicit human sign-off. The wider change touches the isolation contract for every claude persona shipped today and deserves its own decision.
Nits
hasConfigFiles: harness === 'opencode'is a hardcoded heuristic, not derived from the actualspec.configFiles.length > 0. Acceptable sinceuseCleanis decided beforebuildInteractiveSpecruns, but worth a comment so a future opencode that loses its config file doesn't silently keep mounting (or vice versa: a future codex with config files doesn't silently skip).- The
decideCleanMode(harness, boolean | options, maybeOptions)overload is a clever back-compat shim, butdecideCleanModeis internal — could simplify to just(harness, options)everywhere. Minor. - Missing test: no assertion for the new 'claude defaults to direct launch with user's CLAUDE.md visible' path. That's the highest-impact new behavior and deserves explicit coverage.
PR #171 (relayfile) review went up separately and is good to go modulo cross-account approval limitation.
Summary
Tests