chore: remove dead upload-path remnants#1236
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Mock-LLM E2E Tests42/42 passed Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
📸 Snapshot Test ReportWarning Snapshot comparison step crashed (timeout, OOM, or runner error) — diff results below may be incomplete or absent. ✅ All snapshots match the main branch baselines.
✅ Unchanged snapshots (73)
Generated by the Snapshot Tests workflow. This comment was created by an AI agent (OpenHands) on behalf of the repo maintainers. |
🔶 Mock-LLM Docker E2E Test Results37/42 passed · 5 skipped Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Why
Description:
src/hooks/mutation/use-conversation-upload-files.ts(104 LOC). Its last caller was removed in feat(chat): attachment UX, upload-as-file, and home/cloud submit fixes #712 (attachment UX rework); since then, live uploads flow exclusively throughsrc/api/conversation-file-upload.api.ts. The hook has been maintained only collaterally — most recently fix(upload): resolve relative working dirs against /api/file/home #1106 updated its path handling without it having any consumer. Zero references repo-wide (useConversationUploadFiles/use-conversation-upload-filesgrep both empty outside the file).toAbsoluteWorkspacePath()insrc/api/workspace-upload-path.ts(~15 LOC with JSDoc). The naive/-prefix helper whose behavior was the root cause of the read-only-filesystem upload bug fix(upload): resolve relative working dirs against /api/file/home #1106 fixed. fix(upload): resolve relative working dirs against /api/file/home #1106 migrated every real caller to the home-anchoredresolveAbsoluteWorkspacePathand kept this one only "for cosmetic/log use" — but no such caller exists (only its own unit test referenced it). Its own JSDoc already marks it@deprecated. Removing it eliminates the foot-gun of someone reaching for it again.The spec is updated to record this:
specs/workspace-upload-path.mdWUP-001's last bullet now asserts the resolver is the only sanctioned mechanism and notes the legacy helper's removal.Scope (1 deletion + 3 surgical edits, ~120 LOC removed):
src/hooks/mutation/use-conversation-upload-files.tssrc/api/workspace-upload-path.tstoAbsoluteWorkspacePath+ its@deprecatedJSDoc (15 LOC);resolveAbsoluteWorkspacePath& friends untouched__tests__/api/workspace-upload-path.test.tsit("toAbsoluteWorkspacePath is a naive…")block (-1 test); all resolver/builder/safe-filename tests untouchedspecs/workspace-upload-path.mdAcceptance Criteria:
npm run lint,npm test,npm run build:liball pass.git grep "toAbsoluteWorkspacePath\|useConversationUploadFiles\|use-conversation-upload-files"returns only the spec's historical note.Out of scope / Notes:
conversation-file-upload.api.ts,resolveAbsoluteWorkspacePath,buildWorkspaceUploadPath,getSafeUploadFileName, and the/api/file/homecaching all remain exactly as fix(upload): resolve relative working dirs against /api/file/home #1106 left them.git revertfrom recovery if the team wants them back.Summary
Removes the last two dead remnants of the pre-#1106 upload-path handling (~120 LOC): the
useConversationUploadFileshook (caller-less since #712) and the@deprecatedtoAbsoluteWorkspacePathhelper (the naive/-prefix function whose behavior caused the bug #1106 fixed; kept then for cosmetic/log callers that never existed). The WUP-001 spec is updated to record the removal.⚠ Reviewer note: both files were collaterally touched by #1106 three days ago — flagging @chuckbutkus for a quick confirm that nothing in-flight is about to consume them.
Changes
src/hooks/mutation/use-conversation-upload-files.ts(104 LOC)src/api/workspace-upload-path.ts— removetoAbsoluteWorkspacePath+ JSDoc; everything else (resolver, cache, builders) untouched__tests__/api/workspace-upload-path.test.ts— remove the helper's import and single test block (−1 test; no new tests)specs/workspace-upload-path.md— WUP-001 final bullet now records the removal and names the resolver as the only sanctioned mechanismVerification
npm run lint✅ ·npm run build:lib✅npm test✅ — 403 files passed | 2 skipped, 3015 tests passed | 12 skipped | 9 todo; count delta reconciles exactly (−1 = the removed helper test). Full transparency: one unrelated test flaked on the first full run and passed on two consecutive identical re-runs (exit 0, zero code changes between runs) — consistent with the repo's documented Vitest v4 parallel-contamination flakiness (see theuse-websocket.test.tsskip TODO).git grepfor both symbols returns only the spec's historical noteRisk
Low, with a social caveat. Reference analysis is unambiguous (zero callers for either symbol), but #1106's recency means the team should confirm intent — hence the explicit reviewer flag. Functionally, the live upload path (
conversation-file-upload.api.ts→resolveAbsoluteWorkspacePath→/api/file/homeanchor) is byte-for-byte untouched.Rollback
Revert this single commit; independent of all other units.
Issue Number
Resolves #1235
Type
🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.26.0-pythonopenhands-automation==1.0.0a604560ce4fa89ecf28b2b6d6061856eee53c0eb27Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-04560ceRun
All tags pushed for this build
About Multi-Architecture Support
sha-04560ce) is a multi-arch manifest supporting both amd64 and arm64sha-04560ce-amd64) are also available if needed