Skip to content

fix(devcontainer): stop uv noise lines in agent shells - #4592

Merged
dan-petty merged 2 commits into
mainfrom
fix/4588-stop-uv-noise-lines
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4588-stop-uv-noise-lines

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The env of .claude/settings.json and of its template sets VIRTUAL_ENV to an empty value and UV_COMPILE_BYTECODE to 0.

The VS Code extension of Claude Code (setting claudeCode.usePythonEnvironment) starts the session with VIRTUAL_ENV set to the main .venv. So uv run in a git worktree wrote a warning that advises --active, which points the main editable install at the worktree. The image sets UV_COMPILE_BYTECODE=1, so each uv run wrote a Bytecode compiled line. uv reads an empty VIRTUAL_ENV as unset. The root Dockerfile keeps UV_COMPILE_BYTECODE=1 for the read-only runner pods.

A test holds the two values in the scaffolded settings. CONTRIBUTING.md describes them.

Closes #4588
Change: openspec/changes/archive/2026-11-11-4588-stop-uv-noise-lines-in-agent/

The VS Code extension of Claude Code starts the session with VIRTUAL_ENV
set to the main .venv, so uv run in a git worktree writes a warning that
advises the harmful --active. The image sets UV_COMPILE_BYTECODE=1, so
each uv run writes a Bytecode compiled line. The Claude settings now set
VIRTUAL_ENV to an empty value, which uv reads as unset, and
UV_COMPILE_BYTECODE to 0.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/devcontainer The DevContainer, its image and its features labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Measurements (2026-11-11)

Before (this Claude Code session, which the VS Code extension started with VIRTUAL_ENV=/workspaces/devops-cli/.venv and UV_COMPILE_BYTECODE=1), in the worktree of this branch:

$ uv run python -c 'import sys;print(sys.prefix)'
warning: `VIRTUAL_ENV=/workspaces/devops-cli/.venv` does not match the project environment path `.venv` and will be ignored; use `--active` to target the active environment instead
Bytecode compiled 19212 files in 757ms
/workspaces/devops-cli/.data/agent/worktrees/w-4588/.venv

After: a headless claude -p session in the same worktree, started from the same shell (VIRTUAL_ENV=/workspaces/devops-cli/.venv, UV_COMPILE_BYTECODE=1), so only the new project settings change the values. Raw tool result of printenv VIRTUAL_ENV UV_COMPILE_BYTECODE | cat -A; uv run python -c 'import sys;print(sys.prefix)' 2>&1:

$
0$
/workspaces/devops-cli/.data/agent/worktrees/w-4588/.venv

No warning and no bytecode line. sys.prefix names the worktree .venv. In the main checkout, VIRTUAL_ENV= UV_COMPILE_BYTECODE=0 uv run python -c 'import sys;print(sys.prefix)' prints only /workspaces/devops-cli/.venv.

Cause check

The audit named python.terminal.activateEnvironment in .devcontainer/devcontainer.json. It is not the cause for agent shells: /proc/<pid>/environ of the claude process holds VIRTUAL_ENV, the extension host that starts it does not, and the Kilo process that the same extension host starts has none. The source is claudeCode.usePythonEnvironment (default true) of the Claude Code extension 2.1.322, which asks the Python extension for the active environment and sets VIRTUAL_ENV and PATH for claude.

fail-to-pass

uv run devops ci fail-to-pass --base origin/main: 1 failed on base, 113 passed in tests/commands/test_devcontainer.py.

failed on base: tests.commands.test_devcontainer::test_init_scaffolds_claude_settings_that_stop_the_uv_noise_lines (AssertionError: assert (0, None, None) == (0, '', '0'))

Live steps

None. A Claude Code session reads the new values when it starts; a running session keeps its old environment.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 10:45
@dan-petty
dan-petty merged commit 9ba375c into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4588-stop-uv-noise-lines branch November 11, 2026 12:01
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.0](v0.111.0...v0.112.0)
(2026-11-11)


### Features

* **k8s:** export gateway spans without key metadata
([#4520](#4520))
([7234d71](7234d71))
* **k8s:** set the homelab domain in container env values
([#4608](#4608))
([a3bcf7c](a3bcf7c))
* **telemetry:** send pydantic-ai spans through the exporter seam
([#4538](#4538))
([fcf2a7a](fcf2a7a))


### Bug Fixes

* **ai:** price cached prompt tokens of chat calls
([#4584](#4584))
([f84bbe6](f84bbe6))
* **devcontainer:** stop uv noise lines in agent shells
([#4592](#4592))
([9ba375c](9ba375c))
* **k8s:** delete gateway management bodies from spans
([#4551](#4551))
([b835d3c](b835d3c))
* **k8s:** set the kube context and namespace on devops pods
([#4514](#4514))
([9087b39](9087b39))
* **roadmap:** a refused spec after the archive is a plan defect
([#4549](#4549))
([1db29f7](1db29f7))
* **roadmap:** count and log the reason of a left-out stage item
([#4541](#4541))
([5600179](5600179))
* **roadmap:** default the step ceiling to twice the budget
([#4556](#4556))
([1dfb6c8](1dfb6c8))
* **roadmap:** explain --trace shows the argument digest
([#4526](#4526))
([c92195f](c92195f))
* **roadmap:** explain totals count dropped model events
([#4543](#4543))
([fe0e979](fe0e979))
* **roadmap:** give each eval verify run its own report file
([#4534](#4534))
([ad27f2d](ad27f2d))
* **roadmap:** one event loop and a time limit for decide_all
([#4585](#4585))
([ec51e01](ec51e01))
* **roadmap:** scoped updates send requests with no row scope
([#4531](#4531))
([5f75d25](5f75d25))
* **roadmap:** the caller gate reads an added parameter span
([#4548](#4548))
([1ba07c1](1ba07c1))
* **roadmap:** the implement shell waits for its command
([#4536](#4536))
([571e044](571e044))
* **roadmap:** the module-test and caller gates read imports and calls
([#4490](#4490))
([8a22e82](8a22e82))
* **service:** put trace ids on Service JSON log lines
([#4511](#4511))
([0d7a0d2](0d7a0d2))


### Performance Improvements

* **ai:** keep intake embeddings between CLI runs
([#4546](#4546))
([812871e](812871e))
* **roadmap:** intake reads only the issues that changed
([#4552](#4552))
([7dfd155](7dfd155))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/devcontainer The DevContainer, its image and its features type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(devcontainer): stop uv noise lines in agent shells

1 participant