Skip to content

[upstream pr #504] Use VecDeque for Sandbox log tails #50

Open

Description

@mengmengmengqiang

[upstream PR Ephemeral-AI-Lab#504] Use VecDeque for Sandbox log tails

Original body (excerpt)

Sandbox::log_tail previously appended each incoming chunk to a Vec and drained excess bytes from the front, repeatedly shifting retained data once the buffer filled.

Use VecDeque to discard old bytes without shifting the retained suffix. When a chunk reaches or exceeds the byte cap, replace the buffer with that chunk's suffix.

Add tests covering capacity boundaries, repeated wraps, interleaved stdout/stderr, fragmented frames, binary bytes, and malformed responses with zero capacity.

Validation: all 3 tests in engine_log_tail pass on macOS with Rust 1.85.1; git diff --check passes.

Production LOC: 102831 -> 102838 (delta +7)
Scope: core 38395 -> 38395; engine 61777 -> 61784; api 2659 -> 2659.
Method: tools/production_loc.py --root --json on archived first-parent and staged trees, using the same counter from 582bc78.
Reference absent (retired R9c; last counted 65,417 at tree 498dd1917812).

Sync note

这是只读镜像,不是上游仓库的替代。上游 issue/PR 仍是唯一真源;本镜像不复制评论、不复制代码分支。

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-prMirrored upstream pull request as an issueupstream-syncMirror of Ephemeral-AI-Lab/layerfs upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions