fix(e2b): harden remote adapter boundaries

This commit is contained in:
Tianyi Cui
2026-07-28 18:31:37 +08:00
parent dc44f93c39
commit 3e343b4477
33 changed files with 939 additions and 146 deletions

View File

@@ -453,6 +453,17 @@ describe('E2BFileSystem atomic writes and edits', () => {
expect(controller.signal.aborted).toBe(true)
})
it('returns committed rename metadata without a fallible post-commit lookup', async () => {
const remote = new FakeRemote()
const getInfo = vi.spyOn(remote.sandbox.files, 'getInfo')
const { fs } = await setup(remote)
await expect(fs.writeText(await fs.resolve('committed'), 'yes'))
.resolves.toMatchObject({ operation: 'create' })
expect(getInfo).toHaveBeenCalledTimes(1)
expect(remote.renames).toHaveLength(1)
})
it('cleans staging files and maps command, permission, and abort failures', async () => {
const remote = new FakeRemote()
const { fs } = await setup(remote)