Repository navigation
Treat all uploaded files as normal workspace files - #770
Conversation
Preview:
|
|
Review: 2 findings. Posted two actionable inline comments. Verified both with code inspection and focused Node checks. The backend test suite was not run because dependencies are not installed. |
|
Review: 1 finding. Posted one actionable inline comment. Both earlier findings are fixed. Focused byte-storage checks passed for 4 MiB payloads, cross-chunk reads, scoped grants, resumed uploads, and empty files. The backend suite was not run because dependencies are not installed. |
|
I like the idea of putting attachments in a worktree. I wonder if
|
So longer-term my SWAG is that we're going to want to be caching per-worktree, not per-container, for network volume attach. So having these "volumes" at a useful fidelity to be individual units attached to multiple containers is kinda where I'm roughly aiming. Having one growing "attachment worktree" gets closer to that being a useful level of fidelity without making too many of them to attach to a container longer term. So I landed here for now. Definitely open to pushback on that, but basically I'm just pulling out my divining rod and thinking that in the future, worktrees won't be quite as free as they are today, for the sake of faster launch times. |
|
Review: 2 findings. Posted two actionable inline comments, verified with focused Node reproductions and provider documentation. The three earlier findings are addressed. The full test suites were not run because dependencies are not installed. |
|
LGTM! |
|
🤖 Some more GPT comments:
|
deregtd
left a comment
There was a problem hiding this comment.
Independently reproduced both issues in the report above at c46ad806c4274a4be6313c7c899c19f08cd0712f with two passing regression probes in the actual Workers runtime (real Overseer DO and agent loop; faux model, no live provider):
- A 4 MiB valid UTF-8 file with a short first line is readable through
readFile({lineCount: 1})when uploaded first. Uploading the identical bytes after a small initial attachment makes that call fail withBinary content requires byte operations. - Replacing a byte-backed attachment with
writeFileand reading it in the same step returns the replacement text live. After the next user turn, replay changes that successful read into the binary-content error.
These remain functional blockers despite green CI. Please retain text-tool access for the large-text fallback and apply pending whole-file replacements before replay requires text. The probes cover those paths directly; they do not exercise a live model/provider.
deregtd
left a comment
There was a problem hiding this comment.
Re-reviewed e175ced5488c395d450b7669a350e9db9077c326 against 7b0ac75ebcfa53292d56245f288a27f11831aa6d. The rename race/wording changes and documentation updates are covered.
I independently reproduced the existing many-image finding through the actual Overseer and runAgent in workerd: five turns uploading 5/5/5/5/1 valid 4000×1000 PNGs produce model inputs with 5/10/15/20/21 images, all retaining the original bytes. The fifth input therefore exceeds Anthropic’s documented dimensions for requests with more than 20 images. The guard needs to account for the complete replayed input, or use a compatible projection/fallback while preserving workspace originals. This probe uses a faux model; it does not claim a live provider request.
Validation: 126 focused Workers tests, 20 frontend tests, the independent replay probe, and backend/frontend type checks passed. No duplicate inline finding added; this existing issue still blocks readiness.
|
Review follow-up:
Validation: full uncached workspace build, lint, script types, generated-config and diff checks passed; backend 1,503 tests passed excluding only the previously reproduced unchanged ai-models baseline failures, followed by an 81-test attachment rerun including the additional lost-ACK case; 68 focused frontend tests and 34 real WebSocket RPC lifecycle/worktree/authorization/recovery tests passed. The backend's separate integration suite also passed (3 tests, 4 pre-existing skips). |
e175ced to
940716e
Compare
|
LGTM! |
deregtd
left a comment
There was a problem hiding this comment.
Re-reviewed 940716e1 against base 9ae2f05f, including the real diff after the rebase. The image-limit finding is fixed: an independent real-Worker probe using valid 4000×1000 PNGs produces image counts 5/10/15/20/0 across successive turns, while all 21 original downloads remain byte-exact. The migration tests also cover continued progress with an unavailable legacy payload, retry after repair/eviction, and a lost acknowledgement after durable publication.
146 focused Workers tests, 20 frontend tests, and backend/frontend type checks passed locally with codegen prerequisites. No additional blocking finding from this review. The remaining documentation wording and retention/quota suggestions are nonblocking follow-ups; required Build and test CI is still running. No live model/provider call was made.
ndisidore
left a comment
There was a problem hiding this comment.
Clever! I could see a future here were files over the 8MB limit still get a blob OID but they get chunked rows in R2 keyed by OID
|
|
Addressed the naming cleanup from Kenton’s request in ad8bec3 (committed and pushed):
This is naming-only: one shared chat-private SCRATCH worktree still holds uploads, plans, and other working files. Validation: all 1,504 backend tests passed (excluding only the previously established unrelated ai-models baseline suite), including real DO eviction/retry coverage; backend/browser type checks, the full pnpm lint (including the uncached 84-task workspace build), and diff checks passed. |
|
LGTM! |
Eval resultsVerdict: ⚪ Unchanged. No task moved beyond what 10 runs can tell apart from noise.
Failed checks
|
🔬 Eval runs reviewPerformanceAcross 10 runs per task, change-calendar and incident-desk stayed at 10/10, chess rose from 8/10 to 10/10, and worker-logs from 8/10 to 9/10; none moved beyond pass-rate noise. Mean cost/run was effectively flat for calendar ($0.0242 → $0.0243) and higher for chess ($0.0506 → $0.0615), incident-desk ($0.0239 → $0.0257), and worker-logs ($0.0184 → $0.0218), within the observed run-to-run spread; chess consumed the most steps, 53.3 → 69.3, partly from completing turns that main never reached and repeated PGN-edit repairs. Cache hits remained around 95–98%, with only calendar’s decrease statistically significant and no new cache-miss step evident there. ⚪ VERDICT: NO REGRESSION FROM THIS PRThe candidate’s lone failure repeats main’s unsorted-percentile model error, while the upload/SCRATCH changes do not explain the cost variation or introduce observable cache invalidation in these attachment-free tasks. TriageFailure modes
Tool errors
Prompt cache
What to do
|
User scenario
A user uploads a CSV, image, PDF, archive, or other file and asks an agent to work with it. The file should have a stable workspace path, be usable through ordinary file APIs, and eventually materialize into a container alongside repository files. Downloading the original upload must still return the original bytes after the workspace copy is edited.
Previously attachments lived in a separate upload store and model-input path rather than the workspace's Git-backed file model.
What changes
Every new upload becomes a file in one shared chat-private SCRATCH worktree, regardless of MIME type or the selected model's input support. Agent-created plans and other scratch files can share that worktree.
Attachments are limited to 4 MiB per file, 5 MiB per message, and five files. Original images must now fit the 4 MiB file limit: the old path that accepted source images up to 25 MiB and resized them is intentionally removed. Raw Git-blob ingress is bounded to 8,000,000 bytes; general large-file support is deferred.
Discarded uploads can leave unreferenced blobs in the shared Git store. Retention/quota is explicitly a follow-up: deleting a blob on chip removal is unsafe because another message or worktree may reference the same OID.
Boundary and dependencies
Targets main independently. This branch includes the shared whole-file binary foundation reused from #759; it does not require merging #759 first. Binary diffs are not included. Container replica mutations remain in the replica/binary follow-ups, not this upload-ingress PR.
No container engine, lifecycle, replica lease, network policy, or provider-bootstrap implementation. Backend/shared and frontend changes are separate commits for review.
Verification
Extracted from #729 and since expanded to all uploaded files, not just text. No live deployment or feature enablement.