a goal-step status is never swallowed by the 300 ms gap (fixes the flaky /goal test); skills strings re-added to the merged catalog

This commit is contained in:
Niko1221 committed 2026-10-16 14:24:21 +02:00
1 parent ca34357b08
commit 4b5cc08d1a
10 files changed
+60 -9

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ export class StatusReporter {
this.wanted = next;
const sinceEmit = this.now() - this.lastEmitAt;
const due = changed ? this.gapMs : this.beatMs;
if (!this.current || sinceEmit >= due) this.#flush();
if (!this.current || sinceEmit >= due || update.phase === 'goal') this.#flush(); // a goal step is rare and the page should always hear it
else if (this.#differs()) this.#arm(due - sinceEmit);
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "Deine Dateien werden gelesen…",
"s3038": "Eine verbesserte Version wird ausprobiert…",
"s3039": "Das Ergebnis wird geprüft…",
"s3040": "Die beiden Versionen werden verglichen…"
"s3040": "Die beiden Versionen werden verglichen…",
"s3041": "Neuer Skill",
"s3042": "Skill speichern",
"s3043": "Dein Skill wird geladen",
"s3044": "Deinen Skill geladen",
"s3045": "Der Skill ließ sich nicht laden"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "Reading your files…",
"s3038": "Trying an improved version…",
"s3039": "Checking the result…",
"s3040": "Comparing the two versions…"
"s3040": "Comparing the two versions…",
"s3041": "New skill",
"s3042": "Save skill",
"s3043": "Loading your skill",
"s3044": "Loaded your skill",
"s3045": "Couldn't load the skill"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "Leyendo tus archivos…",
"s3038": "Probando una versión mejorada…",
"s3039": "Comprobando el resultado…",
"s3040": "Comparando las dos versiones…"
"s3040": "Comparando las dos versiones…",
"s3041": "Nueva habilidad",
"s3042": "Guardar habilidad",
"s3043": "Cargando tu habilidad",
"s3044": "Cargó tu habilidad",
"s3045": "No se pudo cargar la habilidad"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "ファイルを読んでいます…",
"s3038": "改良版を試しています…",
"s3039": "結果を確認しています…",
"s3040": "2つの版を比較しています…"
"s3040": "2つの版を比較しています…",
"s3041": "新しいスキル",
"s3042": "スキルを保存",
"s3043": "スキルを読み込んでいます",
"s3044": "スキルを読み込みました",
"s3045": "スキルを読み込めませんでした"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "파일을 읽는 중…",
"s3038": "개선된 버전을 시도하는 중…",
"s3039": "결과를 확인하는 중…",
"s3040": "두 버전을 비교하는 중…"
"s3040": "두 버전을 비교하는 중…",
"s3041": "새 스킬",
"s3042": "스킬 저장",
"s3043": "스킬을 불러오는 중",
"s3044": "스킬을 불러왔습니다",
"s3045": "스킬을 불러올 수 없었습니다"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "Lendo os seus arquivos…",
"s3038": "Testando uma versão melhorada…",
"s3039": "Verificando o resultado…",
"s3040": "Comparando as duas versões…"
"s3040": "Comparando as duas versões…",
"s3041": "Nova habilidade",
"s3042": "Salvar habilidade",
"s3043": "Carregando a sua habilidade",
"s3044": "Carregou a sua habilidade",
"s3045": "Não foi possível carregar a habilidade"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "Чтение ваших файлов…",
"s3038": "Пробуется улучшенная версия…",
"s3039": "Проверка результата…",
"s3040": "Сравнение двух версий…"
"s3040": "Сравнение двух версий…",
"s3041": "Новый навык",
"s3042": "Сохранить навык",
"s3043": "Загрузка вашего навыка",
"s3044": "Ваш навык загружен",
"s3045": "Не удалось загрузить навык"
}
+6 -1
View File
@@ -3035,5 +3035,10 @@
"s3037": "正在读取你的文件…",
"s3038": "正在尝试改进版本…",
"s3039": "正在检查结果…",
"s3040": "正在比较两个版本…"
"s3040": "正在比较两个版本…",
"s3041": "新建技能",
"s3042": "保存技能",
"s3043": "正在加载你的技能",
"s3044": "已加载你的技能",
"s3045": "无法加载技能"
}
+11
View File
@@ -165,3 +165,14 @@ test('a sentence with a name or a number also carries its catalog template and v
'Opening {0}…', 'Opening a web page…', 'Using the browser…', 'Setting the goal…', 'Updating the goal…', 'Checking the goal…', 'Using a tool…', 'Reading your files…', 'Trying an improved version…', 'Checking the result…', 'Comparing the two versions…'];
for (const key of keys) { const id = idOf(key); assert.ok(id, `${key} is in the catalog`); for (const l of ['de', 'es', 'ja', 'ko', 'pt', 'ru', 'zh']) { assert.ok(catalog[l][id]?.trim(), `${l}: ${key}`); assert.deepEqual((catalog[l][id].match(/\{\d\}/g) ?? []).sort(), (key.match(/\{\d\}/g) ?? []).sort(), `${l} keeps the slots of ${key}`); } }
});
test('a goal step is always sent, even right after another status (it used to be swallowed by the 300 ms gap, which made a test flaky)', () => {
const { reporter, frames, advance } = rig();
reporter.set({ phase: 'waiting', code: 'reading-prompt', text: 'Reading your message…' });
advance(20);
reporter.set({ phase: 'goal', code: 'goal-step', text: 'Working on the goal, step 1', key: 'Working on the goal, step {0}', values: [1], args: { round: 1, max: 3 } });
advance(10);
reporter.set({ phase: 'thinking', code: 'thinking', text: 'Thinking… 1 tokens', tokens: 1 });
advance(400);
assert.ok(frames.some(f => f.phase === 'goal' && f.args.round === 1), frames.map(f => f.phase).join(','));
});