diff --git a/apps/host/server/agent/status.mjs b/apps/host/server/agent/status.mjs index aff00f95..60bb3d9d 100644 --- a/apps/host/server/agent/status.mjs +++ b/apps/host/server/agent/status.mjs @@ -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); } diff --git a/apps/host/src/locales/de.json b/apps/host/src/locales/de.json index 296ac9a0..124e034b 100644 --- a/apps/host/src/locales/de.json +++ b/apps/host/src/locales/de.json @@ -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" } diff --git a/apps/host/src/locales/en.json b/apps/host/src/locales/en.json index 9d7d67b7..9870caad 100644 --- a/apps/host/src/locales/en.json +++ b/apps/host/src/locales/en.json @@ -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" } diff --git a/apps/host/src/locales/es.json b/apps/host/src/locales/es.json index 54338fd8..c5c32346 100644 --- a/apps/host/src/locales/es.json +++ b/apps/host/src/locales/es.json @@ -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" } diff --git a/apps/host/src/locales/ja.json b/apps/host/src/locales/ja.json index a7e26689..e4fb7050 100644 --- a/apps/host/src/locales/ja.json +++ b/apps/host/src/locales/ja.json @@ -3035,5 +3035,10 @@ "s3037": "ファイルを読んでいます…", "s3038": "改良版を試しています…", "s3039": "結果を確認しています…", - "s3040": "2つの版を比較しています…" + "s3040": "2つの版を比較しています…", + "s3041": "新しいスキル", + "s3042": "スキルを保存", + "s3043": "スキルを読み込んでいます", + "s3044": "スキルを読み込みました", + "s3045": "スキルを読み込めませんでした" } diff --git a/apps/host/src/locales/ko.json b/apps/host/src/locales/ko.json index 3d1477ab..64b494ab 100644 --- a/apps/host/src/locales/ko.json +++ b/apps/host/src/locales/ko.json @@ -3035,5 +3035,10 @@ "s3037": "파일을 읽는 중…", "s3038": "개선된 버전을 시도하는 중…", "s3039": "결과를 확인하는 중…", - "s3040": "두 버전을 비교하는 중…" + "s3040": "두 버전을 비교하는 중…", + "s3041": "새 스킬", + "s3042": "스킬 저장", + "s3043": "스킬을 불러오는 중", + "s3044": "스킬을 불러왔습니다", + "s3045": "스킬을 불러올 수 없었습니다" } diff --git a/apps/host/src/locales/pt.json b/apps/host/src/locales/pt.json index df87c752..1982b966 100644 --- a/apps/host/src/locales/pt.json +++ b/apps/host/src/locales/pt.json @@ -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" } diff --git a/apps/host/src/locales/ru.json b/apps/host/src/locales/ru.json index 03c7ba46..390f0672 100644 --- a/apps/host/src/locales/ru.json +++ b/apps/host/src/locales/ru.json @@ -3035,5 +3035,10 @@ "s3037": "Чтение ваших файлов…", "s3038": "Пробуется улучшенная версия…", "s3039": "Проверка результата…", - "s3040": "Сравнение двух версий…" + "s3040": "Сравнение двух версий…", + "s3041": "Новый навык", + "s3042": "Сохранить навык", + "s3043": "Загрузка вашего навыка", + "s3044": "Ваш навык загружен", + "s3045": "Не удалось загрузить навык" } diff --git a/apps/host/src/locales/zh.json b/apps/host/src/locales/zh.json index 0e14a4eb..4eb36ff5 100644 --- a/apps/host/src/locales/zh.json +++ b/apps/host/src/locales/zh.json @@ -3035,5 +3035,10 @@ "s3037": "正在读取你的文件…", "s3038": "正在尝试改进版本…", "s3039": "正在检查结果…", - "s3040": "正在比较两个版本…" + "s3040": "正在比较两个版本…", + "s3041": "新建技能", + "s3042": "保存技能", + "s3043": "正在加载你的技能", + "s3044": "已加载你的技能", + "s3045": "无法加载技能" } diff --git a/apps/host/tests/agent-status.test.mjs b/apps/host/tests/agent-status.test.mjs index 22122516..5ebd2cd9 100644 --- a/apps/host/tests/agent-status.test.mjs +++ b/apps/host/tests/agent-status.test.mjs @@ -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(',')); +});