fix(workspace/deps): pin python-multipart>=0.0.27 for chat-upload Starlette parser
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 8s
CI / Detect changes (pull_request) Successful in 14s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 12s
E2E API Smoke Test / detect-changes (pull_request) Successful in 9s
E2E Chat / detect-changes (pull_request) Successful in 7s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 6s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 5s
Lint no tenant GITEA/GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
CI / Platform (Go) (pull_request) Successful in 2m35s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m20s
gate-check-v3 / gate-check (pull_request) Successful in 5s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 6s
sop-tier-check / tier-check (pull_request) Successful in 4s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 28s
CI / Canvas (Next.js) (pull_request) Successful in 5m42s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 3s
CI / Python Lint & Test (pull_request) Successful in 6m49s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
E2E Chat / E2E Chat (pull_request) Successful in 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
CI / all-required (pull_request) Successful in 6m52s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3m3s
qa-review / approved (pull_request) Refired via review-relay; core-qa APPROVE id=4880 on 940bae15a6bef5b7a24fa028b383d6dfad5c1017
security-review / approved (pull_request) Refired via review-relay; core-security APPROVE id=4878 on 940bae15a6bef5b7a24fa028b383d6dfad5c1017
audit-force-merge / audit (pull_request) Successful in 3s

Add python-multipart to the PYPROJECT_TEMPLATE dependencies in
scripts/build_runtime_package.py — the actual SSOT for
molecule-ai-workspace-runtime's PyPI dist (not the sibling repo's
pyproject.toml, which is regenerated from this template on every
runtime-v* tag push per publish-runtime.yml).

Root cause (forensic a78762a0, 2026-05-19): Hermes workspace PDF upload
returned opaque 400 "failed to parse multipart form" because the
published PyPI runtime (0.1.17) lacks python-multipart. Without it,
Starlette's Request.form() raises AssertionError on multipart bodies,
which /internal/chat/uploads/ingest surfaces as a 400.

workspace/requirements.txt already pins this (Dependabot PR #2526
landed it months ago for the monorepo Docker image), but the PyPI
build path bypasses workspace/requirements.txt entirely — it uses the
hardcoded PYPROJECT_TEMPLATE on line 253. That divergence is the bug.

Class drift note: workspace/requirements.txt and the PyPI deps list
are two separate manifests with no enforced parity. A follow-up RFC
should consider either (a) having build_runtime_package.py derive
deps from workspace/requirements.txt, or (b) a lint that asserts the
two are aligned. Out of scope for this P0 fix.

Companion: workspace-runtime#18 was correctly rejected by mirror-guard
(direct edits to the mirror are reverted by the next publish). That
PR is closed in favor of this one.

Verification path after merge:
  1. Tag runtime-v0.1.18 on main (or trigger publish-runtime-autobump).
  2. publish-runtime.yml builds wheel via build_runtime_package.py →
     pyproject.toml now contains python-multipart>=0.0.27.
  3. twine uploads to PyPI; cascade fans out .runtime-version to
     templates including Hermes.
  4. Restart Chloe-Hermes workspace; retry PDF upload via canvas.
  5. Expect HTTP 200 with {"files":[{"uri":"workspace:/...",...}]}.

Refs: a78762a0, workspace-runtime#18, feedback_check_vendor_docs_and_actual_source_before_guess_api_shape

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 14:18:05 -07:00
parent 14d91ef032
commit 940bae15a6
+7
View File
@@ -256,6 +256,13 @@ dependencies = [
"uvicorn>=0.30.0",
"starlette>=0.38.0",
"websockets>=12.0",
# multipart/form-data parser — required for Starlette's Request.form() on
# /internal/chat/uploads/ingest. Without it, Starlette raises AssertionError
# when parsing multipart bodies, which the chat-upload handler surfaces as
# an opaque 400. Mirrors the canonical pin in workspace/requirements.txt;
# >=0.0.27 avoids CVE-2024-53981 (DoS via malformed boundary).
# Forensic a78762a0 (2026-05-19): Hermes PDF upload 400 root cause.
"python-multipart>=0.0.27",
"pyyaml>=6.0",
"langchain-core>=0.3.0",
"opentelemetry-api>=1.24.0",