Commit Graph

19 Commits

Author SHA1 Message Date
creatixchu
0a6561fa76 refactor(fs): share read preflight helpers 2026-08-10 20:36:24 +08:00
creatixchu
528c776e1b fix(e2b): release bounded read stream locks
Release the Web Stream reader after either completion or cancellation. Strengthen the oversized-file test so a regression that downloads content before applying the stat bound fails directly.
2026-08-10 19:11:06 +08:00
creatixchu
97a9ec5a0e fix(review): bound E2B readBytes at the seam, prove conditional-registration disposal, and align read_image contracts
- E2BFileSystem.readBytes now short-circuits on the stat size before any
  content transfer and streams the remote object, cancelling at the first
  chunk past the cap, honoring the seam's bounded-buffering contract; the
  fs-e2b README pair documents the new primitive.
- The tool-fs HMR test now proves the attachments-scoped registration:
  disposing the store withdraws read_image while read/write/edit stay,
  remounting restores it, and disposing the plugin withdraws everything.
- read_image caps reads at the smaller of maxImageBytes and
  maxMessageImageBytes, records an absent observation for a missing
  target like its sibling read, widens the mismatch remedy to cover
  out-of-family formats, and renames the gate's parameter to
  requestedPath; module/apply/registration JSDoc now match the shipped
  composition. zh terminology aligned; the examples manifest keeps its
  literal arrow.
2026-08-10 15:35:33 +08:00
creatixchu
1861a3fc7c feat(fs): add a minimal read_image tool over the attachment and fs seams
The model reads a PNG/JPEG/WebP/GIF file, the bytes commit through the
durable attachment lifecycle, and the tool result carries the real
ImageBlock so the image enters context from the next request onward.
FileSystem gains a bounded readBytes primitive (local + E2B providers);
registration is conditional on the attachment store, and a strict
execution gate refuses routes that do not declare image input, so a
text route's durable history stays free of image blocks. llm-replay
models may declare inputModalities, letting keyless ACP snapshots pin
both the sha256-referenced success and the verbatim refusal.

Supersedes the withdrawn route-scoped design of PR #598; the decision
record is .agents/notes/implemented/feature/2026-08-10-minimal-read-image-tool.md.
2026-08-10 15:09:07 +08:00
Tianyi Cui
7132b9730e fix(fs): harden guarded-create publication 2026-08-09 17:44:34 +08:00
Tianyi Cui
ceba53edd7 fix(fs): observe absence before guarded recreation 2026-08-09 17:43:53 +08:00
Turtle
dda02250f5 docs: reserve seam for complete capabilities 2026-08-09 17:26:57 +08:00
Tianyi Cui
55c0a44bd9 fix(e2b): trim published files to the hardened allowlist
Master's publication hardening enforces the exact package files list;
the three E2B manifests still published src and d.ts maps.
2026-08-08 22:19:13 +08:00
Tianyi Cui
f5866fc202 fix(e2b): address review round on cadence config, disposal, and SDK edge cases
- subprocess-e2b: the 20 ms remote poll cadence becomes a validated pollMs
  Config field (each tick is one control-plane request); the README documents
  the latency-versus-request-count trade.
- subprocess-e2b: extract src/remote.ts owning asError, signalOpts,
  commandOpts, delay, waitTick, and one tolerant signalRemoteGroups shared by
  the pgid-keyed process ladder and sid-keyed terminal ladder, so the two
  teardown paths keep identical error tolerance.
- subprocess-e2b: service disposal aggregates sibling cleanup failures into
  one AggregateError instead of discarding all but the first.
- subprocess-e2b: waitForProcessGroupId refuses published group ids <= 1, so
  a same-UID rewrite of the pid file cannot aim termination at kill -- -1;
  README documents the same-UID control-state limitation.
- subprocess-e2b: drain-grace expiry now releases an inherited-output E2B
  callback blocked on host backpressure before disconnecting, so the SDK
  settlement cannot stay pinned behind an unread host stream.
- subprocess-e2b: spawn/spawnTerminal stop validating typed spec fields
  (trust-TypeScript rule; pty-local validates its config before specs exist);
  resolveExecutable rejects separator-containing relative paths per the seam
  contract; terminal setups tracked as a Set of records.
- subprocess-e2b: PTY output push-without-backpressure is a documented
  contract (flowing consumer folds bytes; paused consumer buffers).
- fs-e2b: streamText normalizes the pinned SDK's empty-file '' return into an
  empty stream instead of throwing on getReader().
- e2b overlays: comment the one-world cwd invariant across e2b.cwd,
  workspaceRoot, and bash-local's implicit default workdir.
2026-08-08 22:19:13 +08:00
Tianyi Cui
de77310c6f refactor(e2b): narrow the sandbox POC 2026-08-08 22:19:13 +08:00
Tianyi Cui
677541d123 fix(e2b): close proven provider boundary gaps 2026-08-08 22:19:12 +08:00
Tianyi Cui
917a7493f7 refactor(e2b): keep provider layer substrate-only 2026-08-08 22:19:12 +08:00
Tianyi Cui
81e2e1f647 fix(e2b): harden SDK shell and cleanup boundaries
E2B starts command and PTY requests through login shells, so isolate each control shell behind a fresh randomized HOME and blank sandbox credential names before mutable profiles can run. Preserve the real remote HOME only for the requested argv.

Collapse duplicate termination state, keep failed force cleanup retryable until quiescence is observed, and make terminal state allocation cancellable. Leave numeric PGID reuse as an explicit provider-level TODO because a userspace precheck would remain TOCTOU.
2026-08-08 22:19:12 +08:00
Tianyi Cui
c122d984c4 fix(e2b): harden cancellation and teardown boundaries 2026-08-08 22:19:12 +08:00
Tianyi Cui
219999cd2f fix(e2b): close adapter lifecycle review gaps 2026-08-08 22:19:12 +08:00
Tianyi Cui
2abc9823e7 refactor(e2b): compose portable runtime consumers 2026-08-08 22:19:11 +08:00
Tianyi Cui
3e343b4477 fix(e2b): harden remote adapter boundaries 2026-08-08 22:19:11 +08:00
Tianyi Cui
3dea36f1ce fix(e2b): close remote lifecycle gaps 2026-08-08 22:19:10 +08:00
Tianyi Cui
e64d40837c refactor(e2b): group remote providers 2026-08-08 22:19:10 +08:00