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.
This commit is contained in:
Felipe D. Teodoro 2026-02-20 13:44:49 +00:00
parent d17a1f387b
commit 20da030e1a

View File

@ -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;