Skip to content

Commit 2dc74ef

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(pi): normalize empty sandbox provider
1 parent 1835926 commit 2dc74ef

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

apps/sim/lib/execution/remote-sandbox/pi-lifetime.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ describe('resolvePiSandboxLifetimeMs', () => {
3838
expect(lifetime).toBe(max)
3939
})
4040

41+
it('matches provider selection by treating an empty provider as E2B', async () => {
42+
const { lifetime, max } = await resolveWith({ provider: '' })
43+
44+
expect(lifetime).toBe(max)
45+
})
46+
4147
it('has no lifetime to report when the provider stops on inactivity', async () => {
4248
// Daytona has no absolute lifetime, so reporting E2B's would cut the agent
4349
// turn to fit a ceiling that does not apply — the regression this prevents.

apps/sim/lib/execution/remote-sandbox/pi-lifetime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const logger = createLogger('PiSandboxLifetime')
1515
* its header describes: no provider adapters, no barrel, no config gate.
1616
*/
1717
function isLifetimeProvider(): boolean {
18-
return (env.SANDBOX_PROVIDER?.toLowerCase() ?? 'e2b') === 'e2b'
18+
return (env.SANDBOX_PROVIDER || 'e2b').toLowerCase() === 'e2b'
1919
}
2020

2121
/**

0 commit comments

Comments
 (0)