mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 15:10:00 +08:00
## Description
Includes the approved #4358 as its prerequisite. This PR targets main so
the complete integration workflows qualify the combined repair; its diff
will shrink to this follow-up once #4358 lands. Replace OpenClaw's
affected Undici copy instead of excepting it, and reduce the E2E audit
exceptions from seven advisory/path pairs to three.
OpenClaw 2026.10.2 lists Undici in `bundleDependencies`. Version
2026.10.6 removes it from that bundle, allowing a targeted, same-major
override to install fixed Undici 8.12.3. npm 12.2.1 still bundles its
own affected copies; this PR retains only those existing, expiring
exceptions.
## Type of Change
- [x] Bug fix
## Changes Made
- Pin the existing E2E OpenClaw CLI to 2026.10.6 and override only its
Undici dependency to 8.12.3.
- Regenerate the E2E lockfile; keep Codex and the npm override
unchanged.
- Remove every OpenClaw exception and the now-stale advisory, preserving
the parent's exact bundled-version checks and 2026-11-15 expiry.
- Update the Dockerfile comment to the actual Node requirement: 24.22.1
in the Node 24 line. Its NodeSource installation already selects that
line.
## Dependency and install-surface assessment
This updates an existing upstream-maintained CLI for a security fix,
rather than adding a replacement package. The fixed Undici remains in
the same major line. The graph is used only by the Docker wrap E2E
harness and is not shipped in Headroom's wheel or SDK. Normal
installation runs OpenClaw's existing lifecycle scripts and fetches
packages from the registry; those scripts were inspected, then exercised
inside a fresh Linux container without host credentials. No application
compression or routing logic changes.
## Testing
- [x] Manual testing performed
- [x] Dependency installation and runtime resolution verified
### Test Output
```text
OpenClaw runtime resolves Undici 8.12.3
OpenClaw 2026.10.6 (fe06181)
Installed audit: only npm bundled copies remain
{ info: 0, low: 0, moderate: 1, high: 1, critical: 0, total: 2 }
parent: 9 audit-guard cases passed
child: 9 audit-guard cases passed
git diff --check: passed
```
The guard accepts the current scoped findings and rejects a new
advisory, wrong path, expired exception, stale exception, audit error,
changed version, non-bundled copy, and missing inherited-advisory entry.
A raw audit remains nonzero for npm's bundled dependencies; this PR does
not claim those packages are patched.
## Real Behavior Proof
- Environment: fresh Linux amd64 Docker container,
`node:24.22.1-bookworm-slim`, Node 24.22.1 / npm 11.19.1, normal `npm
ci` with lifecycle scripts enabled.
- Exact command / steps: copy the two committed package files into a
fresh container volume; run `npm ci --no-audit --no-fund`; resolve
`undici/package.json` using
`createRequire('/work/node_modules/openclaw/package.json')` and assert
version 8.12.3; run `node node_modules/openclaw/openclaw.mjs --version`
and `--help`; run `npm audit --json` and assert that every remaining
affected node is under `node_modules/npm/`.
- Observed result: installation, exact runtime-resolution assertion,
version, and help all succeeded. Both installed-tree and lockfile audits
leave only npm's bundled Undici 6.29.0 and ip-address 10.7.2. The parent
workflow's guard passes with the narrowed exceptions and rejects all
eight negative cases.
- Not tested: a billed provider request or live production deployment.
Hosted Docker agent/integration scenarios have now passed. Hosted
qualification on head 63c3abc5b3 is
complete: all reported checks are terminal with no failures or pending
checks, including the full Security, build, test, and Docker integration
workflows.
## Runtime Rollout Safety
- Rollout-managed feature(s): none; E2E dependency data only.
- Minimum rollout channel: existing E2E test environment.
- Stable/default behavior changed: this follow-up patches only the
harness CLI. The included parent retains its explicitly documented
affected-Pillow decoder guard.
- Kill switch / disable path: revert this dependency commit.
- Unsafe override required: none; the override selects a compatible
fixed Undici 8.x patch. The parent's existing, bounded npm exceptions
remain explicit.
- Qualification impact: package installation, CLI startup, runtime
dependency resolution, and audit guarding were verified in isolation.
- Rollback path: revert the four-file change.
## Review Readiness
- [x] I performed self-review
- [x] This PR is ready for human merge review; the complete hosted check
set passed
## Checklist
- [x] I did not edit CHANGELOG.md.
- [x] The exception scope is reduced, not expanded.
- [x] No contributor correctness logic was modified.
Python lint/type checks and new production unit tests are not applicable
to these dependency/data changes. Independent human approval is
required; this is an author-side qualification record.
---------
Co-authored-by: Tejas Chopra <chopratejas@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tejas Chopra <tejas@headroomlabs.ai>
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
"""Security overrides reach every install the project controls.
|
|
|
|
fastembed caps pillow <13 while the decoder fixes are only in 13, so uv.lock
|
|
takes 13 through [tool.uv] override-dependencies. A lock refresh, or a build
|
|
step that installs from package metadata, would silently drop it.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from pathlib import Path
|
|
|
|
try:
|
|
import tomllib
|
|
except ModuleNotFoundError: # Python 3.10
|
|
import tomli as tomllib # type: ignore[no-redef]
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def _overrides() -> list[str]:
|
|
with open(ROOT / "pyproject.toml", "rb") as f:
|
|
return tomllib.load(f)["tool"]["uv"]["override-dependencies"]
|
|
|
|
|
|
def test_the_lock_takes_the_fixed_pillow_on_supported_pythons():
|
|
with open(ROOT / "uv.lock", "rb") as f:
|
|
versions = [p["version"] for p in tomllib.load(f)["package"] if p["name"] == "pillow"]
|
|
assert any(int(v.split(".")[0]) >= 13 for v in versions), versions
|
|
assert any(o.startswith("pillow>=13") for o in _overrides())
|
|
|
|
|
|
def test_the_image_build_applies_the_overrides():
|
|
# `uv pip install` ignores [tool.uv] override-dependencies; the Dockerfile
|
|
# must pass them, or the image installs pillow 12 under fastembed's cap.
|
|
dockerfile = (ROOT / "Dockerfile").read_text()
|
|
install = re.search(r"uv pip install --system (.*)", dockerfile)
|
|
assert install and "--overrides" in install.group(1)
|
|
assert "override-dependencies" in dockerfile
|