Skip to content

fix(cli): disable Claude background sessions in transparent runs - #1028

Draft
afourniernv wants to merge 1 commit into
NVIDIA:mainfrom
afourniernv:codex/claude-background-launch-safety
Draft

fix(cli): disable Claude background sessions in transparent runs#1028
afourniernv wants to merge 1 commit into
NVIDIA:mainfrom
afourniernv:codex/claude-background-launch-safety

Conversation

@afourniernv

@afourniernv afourniernv commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Overview

Transparent Claude runs own an ephemeral gateway, plugin, hook configuration,
and settings overlay. Claude Code Agent View can hand a background session to
its persistent supervisor and let the foreground dispatcher exit. Relay then
correctly cleans up its temporary resources while the detached Claude worker
still references them.

This change fails closed instead of silently leaving that worker outside the
transparent run's lifecycle. It uses Claude's documented Agent View controls
at both startup and settings-load time.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Set CLAUDE_CODE_DISABLE_AGENT_VIEW=1 in the transparent child environment
    so direct --bg/--background dispatch is rejected before settings load.
  • Force both disableAgentView=true and
    env.CLAUDE_CODE_DISABLE_AGENT_VIEW=1 in Relay's existing private settings
    overlay so interactive/background entry points stay disabled after settings
    are applied and child processes inherit the gate.
  • Require Claude Code 2.1.169 or newer only for transparent runs. Official
    2.1.121-2.1.168 clients can select an earlier repeated --settings source
    and ignore Relay's final overlay. Persistent and managed integrations keep
    the existing 2.1.121 minimum.
  • Centralize that mode-specific floor in a crate-private optional agent
    descriptor field; the shared process layer remains host-agnostic.
  • Add focused version-boundary, hostile-settings, uniqueness, materialized
    overlay, compatibility-policy, and architecture-boundary coverage; update
    the Claude guide and support matrix.

Compatibility: this intentionally rejects transparent Claude 2.1.121-2.1.168
and disables Agent View/background session management within accepted
transparent runs. Users needing those sessions should use the persistent
plugin or an administrator-managed Relay deployment. There is no public Rust
API, CLI syntax, config schema, wire/protocol, middleware, cache, daemon,
plugin ABI, worker protocol, async, or cross-crate change. Configured command
wrappers must preserve Relay's injected environment and settings arguments.

Validation:

  • uv run pre-commit run passed all staged hooks.
  • cargo fmt --all -- --check passed.
  • cargo clippy -p nemo-relay-cli --all-targets -- -D warnings passed.
  • Claude-filtered tests passed: 80 library tests and 1 CLI test.
  • Focused version-policy and architecture-boundary tests passed.
  • CARGO_INCREMENTAL=0 cargo build -p nemo-relay-cli --bin nemo-relay passed.
  • just docs passed all checks.
  • The final canonical workspace artifact recorded 5,057/5,058 passing. The
    sole failure was the unrelated macOS bootstrap process-termination timing
    test, which also reproduced in isolation; no changed file participates in
    that path.
  • No-credit real-client smoke with official Claude 2.1.168/2.1.169 binaries:
    2.1.168 was rejected by Relay before spawn, while 2.1.169 reached Claude's
    native disabled gate; neither created job or daemon state.
  • A prior current-client Claude 2.1.268 foreground control completed through
    Relay and the live Anthropic provider after the dual-phase settings change.
    OpenAI was not used because this path has no OpenAI request surface.

Where should the reviewer start?

Start with crates/cli/src/agents/claude/launch.rs, then review the
mode-specific policy in crates/cli/src/agents/mod.rs and its boundary test in
crates/cli/tests/coverage/agents/launcher_tests.rs.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • None yet; keep this PR in draft until a GitHub or Linear issue is linked.

@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S PR is small Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Sep 10, 2026
@afourniernv
afourniernv force-pushed the codex/claude-background-launch-safety branch from ea1caea to 893aeec Compare September 10, 2026 18:22
Signed-off-by: Alex Fournier <afournier@nvidia.com>
@afourniernv
afourniernv force-pushed the codex/claude-background-launch-safety branch from 893aeec to 22e8baa Compare September 10, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:S PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant