feat(worker): run terminals and agent turns as the box user
This commit is contained in:
@@ -22,6 +22,20 @@ describe('box registry', () => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
test('passes an onCreated hook so a fresh box gets its user initialized', async () => {
|
||||
const module = await load();
|
||||
const docker = await import('../../src/runtime/docker');
|
||||
await module.acquireUserBox({
|
||||
username: 'ada',
|
||||
workdir: '/w',
|
||||
containerHome: '/home/ada',
|
||||
});
|
||||
const call = vi.mocked(docker.ensureUserContainer).mock.calls[0]?.[0] as {
|
||||
onCreated?: unknown;
|
||||
};
|
||||
expect(call.onCreated).toBeTypeOf('function');
|
||||
});
|
||||
|
||||
test('re-ensures the container on every acquire so an externally removed box self-heals', async () => {
|
||||
const module = await load();
|
||||
const docker = await import('../../src/runtime/docker');
|
||||
|
||||
Reference in New Issue
Block a user