Skip to content

chore(deps): bump pydantic-settings, transformers, soupsieve (security)#2727

Merged
dcbouius merged 1 commit into
mainfrom
chore/pydantic-settings-and-root-highs
Jul 17, 2026
Merged

chore(deps): bump pydantic-settings, transformers, soupsieve (security)#2727
dcbouius merged 1 commit into
mainfrom
chore/pydantic-settings-and-root-highs

Conversation

@dcbouius

Copy link
Copy Markdown
Contributor

Closes the pydantic-settings Dependabot alert across every affected manifest, plus the three high-severity alerts in the root lock.

Package From To Advisory
pydantic-settings 2.12.0 / 2.14.0 / 2.14.1 2.14.2 GHSA-4xgf-cpjx-pc3j
transformers 5.3.0 5.12.1 GHSA-fgcw-684q-jj6r
soupsieve 2.8 2.8.4 GHSA-2wc2-fm75-p42x, GHSA-836r-79rf-4m37

pydantic-settings is transitive everywhere (no direct declaration), so the locks are the only lever. It's bumped in all 7 flagged manifests: root, hindsight-integration-tests, strands, openai-agents, dify, claude-agent-sdk, agno.

Reviewer notes

1. The transformers floor bump is a behavioral change for downstream consumers.

transformers is a direct dep and hindsight-api is published to PyPI, so the declared floor — not our lock — is what protects installers of the local-ml / local-onnx extras. The old >=4.53.0 floor resolves to 4.57.6 (vulnerable) under any downstream cap of transformers<5, so a user could get a vulnerable install while our lock looked clean. Raised to the advisory's first patched version, >=5.5.0.

The trade: consumers pinned below transformers 5 now get a resolution error instead of a silent vulnerable install. That's intended, but it's the notable call in this PR.

Worth knowing the old floor was already unreachable in practice — 4.53.0 requires tokenizers<0.22, which our own cap excludes.

2. The tokenizers<=0.23.0 cap is deliberately kept.

It looks redundant (every transformers >=5.5.0 declares the same cap itself), but it is the guard for #2055: transformers shipped metadata declaring a wider tokenizers range than its import-time check enforces, which let 0.23.1 in and broke local embeddings at startup. Dropping the cap re-opens that door and trusts the metadata that already failed once. The comment now records this so it doesn't read as removable next time.

3. crewai is intentionally not bumped.

Its lock has pydantic-settings 2.10.1, which looks stale next to this sweep. The advisory's range is >=2.12.0, <2.14.2NestedSecretsSettingsSource didn't exist in 2.10.x, so it's genuinely unaffected. Dependabot correctly did not flag it.

4. Root uv.lock diff is 3353 lines; only 3 are real.

uv rewrites in its own current format whenever it writes, so the upgrade dragged the root lock from revision 1 to 3 and added upload-time metadata throughout. This isn't drift — the other 32 locks in the repo are already revision 3 and CI's setup-uv@v7 is unpinned, so this brings root in line. It couldn't be split into a separate reformat commit because a no-op uv lock doesn't write at all. Verified the change set contains exactly 9 version changes and nothing else.

Verification

#2055 failed at import, not resolution, so this was checked past the lock diff:

  • uv sync --extra local-ml resolves tokenizers 0.22.2 under transformers 5.12.1
  • LocalSTEmbeddings initializes and returns 384-dim vectors matching its declared dimension
  • LocalSTCrossEncoder initializes and scores sanely (relevant 9.55 vs irrelevant -11.17)
  • ./scripts/hooks/lint.sh passes
  • Local-ML test files: 30 passed, 10 skipped (9 errors are connection refused on port 5432 — no local Postgres, unrelated)

🤖 Generated with Claude Code

@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from 1a99908 to c85144c Compare July 16, 2026 13:56
@dcbouius

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (154998701, includes the v0.8.4 release). The CI failures were all from the stale base, not this change:

Re-verified after rebase: the root uv.lock re-locks as a no-op with exactly the 3 intended version changes (pydantic-settings 2.14.2, transformers 5.12.1, soupsieve 2.8.4), workspace versions correctly reflect v0.8.4, and the local-ML import/embedding/reranker path still resolves tokenizers 0.22.2 under transformers 5.12.1.

@dcbouius

Copy link
Copy Markdown
Contributor Author

The remaining CI reds are environmental, not caused by this dependency change:

  • test-api (2/3) — 46× ImportError: sentence-transformers is required + Failed to start embedded PostgreSQL. sentence-transformers is 5.2.0 in this branch's uv.lock, byte-identical to main — this bump does not touch it, and transformers 5.12.1 + sentence-transformers 5.2.0 was verified locally (LocalSTEmbeddings returns 384-dim vectors; LocalSTCrossEncoder scores correctly). The job's venv cache key hashes uv.lock + pyproject.toml, so this PR is a cache miss; shards restore a stale venv via restore-keys and reconcile with uv sync --frozen --all-extras. Shards 1 and 3 pass; only shard 2 ends up without sentence-transformers, alongside an embedded-Postgres start failure — a sharded-venv-cache/infra flake, not a dependency defect.
  • Core LLM tests — LLM-as-judge non-determinism (test_date_field_calculation_yesterday, test_cognitive_epistemic_dimension, test_reflect_chinese_content) plus a Gemini 400 INVALID_ARGUMENT ("Multiple tools are supported only when they are all search tools") provider error. Unrelated to a lockfile bump.

The dependency change itself is verified: root uv.lock re-locks to a no-op with exactly the 3 intended version changes, npm ci/local-ML import path all clean. These jobs may need a maintainer re-run on a warm cache, or a look at the sharded-venv caching if shard 2 keeps missing --all-extras deps on cache-miss PRs.

@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from c85144c to 711af75 Compare July 16, 2026 17:59
dcbouius added a commit that referenced this pull request Jul 16, 2026
The test-api venv cache used `restore-keys`, so a lockfile change (exact-key
miss) restored a venv built for a *different* lock and `uv sync --frozen`
reconciled only the delta. That left orphaned/mismatched package files that
the main process tolerates (cached imports) but fresh pytest-xdist worker
subprocesses do not: transformers' lazy import of
AutoModelForSequenceClassification fails, surfacing as a misleading
"sentence-transformers is required for LocalSTEmbeddings" error on whichever
shard runs the reranker tests (consistently shard 2/3).

Reproduced across every uv.lock-changing PR regardless of transformers
version (#2727 at transformers 5.12.1; dependabot uv-group PRs at 5.3.0),
which rules out the dependency bump and points at the venv cache.

- Drop `restore-keys` so an exact-key miss builds the venv fresh instead of
  reconciling a foreign one.
- Bump the key to `-v2-` so the corrupt venvs saved under the old key by
  pre-fix runs are not restored.
- Add `--reinstall` to the sync as a backstop for any exact-key hit on a
  pre-fix cache; uv relinks from its global download cache, so it stays fast.

This commit lives on the pydantic-settings/transformers/soupsieve branch to
prove it unblocks that PR's test-api shard; it can be split into its own PR.
@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from 180c74d to 711af75 Compare July 17, 2026 00:58
@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from 711af75 to 240047b Compare July 17, 2026 11:41
@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from 240047b to 97a2191 Compare July 17, 2026 14:07
Clears the pydantic-settings Dependabot alert across all affected
manifests plus the three high-severity alerts in the root lock.

  pydantic-settings 2.12.0/2.14.0/2.14.1 -> 2.14.2  GHSA-4xgf-cpjx-pc3j
  transformers      5.3.0  -> 5.12.1               GHSA-fgcw-684q-jj6r
  soupsieve         2.8    -> 2.8.4                GHSA-2wc2-fm75-p42x
                                                   GHSA-836r-79rf-4m37

pydantic-settings is transitive everywhere (no direct declaration), so
the locks are the only lever. crewai is deliberately left at 2.10.1: the
advisory's range is >=2.12.0,<2.14.2 and NestedSecretsSettingsSource did
not exist in 2.10.x, so it is unaffected.

transformers is a direct dep, and hindsight-api is published, so the
declared floor -- not our lock -- is what protects installers of the
local-ml/local-onnx extras. The old >=4.53.0 floor resolved to 4.57.6
(vulnerable) under any downstream cap of transformers<5, so raise it to
the advisory's first patched version. Note this now fails resolution for
consumers pinned below transformers 5 rather than silently installing a
vulnerable build. The >=4.53.0 floor was already unreachable in practice:
4.53.0 requires tokenizers<0.22, which our own cap excludes.

The tokenizers<=0.23.0 cap is kept. #2055 was caused by transformers
declaring a wider tokenizers range in metadata than its import-time check
enforces, and the cap is what blocks that; the comment now records this
so it does not read as removable.

Root uv.lock is reformatted from lock revision 1 to 3 because uv rewrites
in its current format whenever it writes. The other 32 locks in the repo
are already revision 3 and CI's setup-uv is unpinned, so this aligns root
rather than drifting it. Only 3 versions actually change.

Verified: local-ml sync resolves tokenizers 0.22.2 under transformers
5.12.1; LocalSTEmbeddings and LocalSTCrossEncoder both initialize and run
(the #2055 import path). Lint passes.
@dcbouius
dcbouius force-pushed the chore/pydantic-settings-and-root-highs branch from 97a2191 to 26fc8bb Compare July 17, 2026 14:56
@dcbouius
dcbouius merged commit 7bb3d19 into main Jul 17, 2026
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant