diff --git a/agent/sandbox/v2/options.go b/agent/sandbox/v2/options.go index 801a093c..2e51f55f 100644 --- a/agent/sandbox/v2/options.go +++ b/agent/sandbox/v2/options.go @@ -64,8 +64,6 @@ func BuildCreateOptions(cfg *types.SandboxConfig, identifier, ownerID, workspace } if opts.IdleTimeout == 0 { switch opts.Policy { - case infra.OneShot: - opts.IdleTimeout = infra.DefaultOneShotIdleTimeout case infra.Session: opts.IdleTimeout = infra.DefaultSessionIdleTimeout case infra.LongRunning: diff --git a/sandbox/v2/manager.go b/sandbox/v2/manager.go index 4d60a14c..70ce5ebd 100644 --- a/sandbox/v2/manager.go +++ b/sandbox/v2/manager.go @@ -478,8 +478,6 @@ func (m *Manager) recoverBoxes(ctx context.Context, nodeID string, res *tai.Conn manager: m, } switch policy { - case OneShot: - box.idleTimeoutD = DefaultOneShotIdleTimeout case Session: box.idleTimeoutD = DefaultSessionIdleTimeout case LongRunning: diff --git a/sandbox/v2/types.go b/sandbox/v2/types.go index 1974e04a..312aa54b 100644 --- a/sandbox/v2/types.go +++ b/sandbox/v2/types.go @@ -73,7 +73,6 @@ const ( const ( DefaultStopTimeout = 2 * time.Second - DefaultOneShotIdleTimeout = 30 * time.Minute DefaultSessionIdleTimeout = 30 * time.Minute DefaultLongRunningIdleTimeout = 2 * time.Hour ) diff --git a/sandbox/v2/watcher.go b/sandbox/v2/watcher.go index 2862edd2..32c89af3 100644 --- a/sandbox/v2/watcher.go +++ b/sandbox/v2/watcher.go @@ -86,16 +86,6 @@ func (w *sandboxWatcher) Check(ctx context.Context) []monitor.Alert { } switch b.policy { - case OneShot: - alerts = append(alerts, monitor.Alert{ - Level: monitor.Warn, - Target: "box:" + b.id, - Message: fmt.Sprintf("oneshot idle expired (idle=%s, timeout=%s), removing", idle.Round(time.Second), timeout), - Action: func(ctx context.Context) { - mgr.Remove(ctx, b.id) - }, - }) - case Session: alerts = append(alerts, monitor.Alert{ Level: monitor.Warn,