deepseek-harness/packages/code-runtime/code-runtime-worker/src
Tianyi Cui 90547f283b fix: byte-exact value/error caps + write-callback contract (agent review)
Two [P1] review findings on the worker runtime:

- maxValueBytes gated and sliced the rendered fallback by UTF-16 code
  units, so a multibyte string ("€€€€" under a 4-byte cap) crossed whole
  and a truncated multibyte rendering could still run ~3x over budget.
  New truncateUtf8Bytes cuts at code-point boundaries under a real byte
  budget; prepareValue's fallback and the host's forged-error-text bound
  both use it, and the VALUE_RENDER_SLACK comment drops its now-obsolete
  "sliced by characters" wrinkle.

- The patched stream write dropped Node's optional encoding/callback
  arguments, so a program awaiting flush completion
  (write(chunk, resolve)) hung to the wall ceiling and misreported as a
  timeout. The shim now fires the callback asynchronously once the chunk
  is admitted — including for writes the exhausted budget drops.
2026-07-08 21:56:28 +08:00
..
bootstrap.ts fix: byte-exact value/error caps + write-callback contract (agent review) 2026-07-08 21:56:28 +08:00
index.ts fix: byte-exact value/error caps + write-callback contract (agent review) 2026-07-08 21:56:28 +08:00
protocol.ts fix: validate and re-cap all inbound worker-port traffic (Codex round 1) 2026-07-08 11:42:59 +08:00
worker.ts feat: add the worker-thread code runtime (dsh-code-runtime-worker) 2026-07-08 11:07:14 +08:00