From 20da030e1af5652da0bd3292898d6893ac10a216 Mon Sep 17 00:00:00 2001 From: "Felipe D. Teodoro" Date: Fri, 20 Feb 2026 13:44:49 +0000 Subject: [PATCH] fix: guard against undefined snapshot.skills in applySkillEnvOverridesFromSnapshot snapshot.skills can be undefined when a session is reset during an API rate-limit cooldown, causing a TypeError crash that compounds the original rate-limit issue. Use nullish coalescing (snapshot.skills ?? []) to safely skip iteration when skills is not populated. --- src/agents/skills/env-overrides.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agents/skills/env-overrides.ts b/src/agents/skills/env-overrides.ts index 0f5061a0da4..22e0201aded 100644 --- a/src/agents/skills/env-overrides.ts +++ b/src/agents/skills/env-overrides.ts @@ -71,7 +71,7 @@ export function applySkillEnvOverridesFromSnapshot(params: { } const updates: EnvUpdate[] = []; - for (const skill of snapshot.skills) { + for (const skill of snapshot.skills ?? []) { const skillConfig = resolveSkillConfig(config, skill.name); if (!skillConfig) { continue;