feat: distill any oversized goal objective, not just plans

The distillation moved from PlanView into setSessionGoal — the shared
choke point for every goal source (composer, fork dialog, plans) — and
into the scheduled-tasks goal creation server-side. Any objective over
5000 chars is distilled into completion criteria by the small model; on a
transient failure a head+tail excerpt keeps the intent (top) and the
acceptance criteria (bottom) with a trim marker, plus a toast. The
working agent always received the full prompt in chat — only the auditor
is bound by the limit.
This commit is contained in:
Bohdan Triapitsyn
2026-07-12 16:34:16 +03:00
parent 19b2a3d0d3
commit 8d956f5f9c
14 changed files with 99 additions and 51 deletions
+1 -1
View File
@@ -1437,7 +1437,7 @@ export const dict = {
'chat.goal.action.save': 'Save goal',
'chat.goal.action.start': 'Start goal',
'chat.goal.toast.actionFailed': 'Goal update failed',
"plans.goal.toast.distillFallback": "Couldn't distill the plan for the auditor — a trimmed excerpt was used instead",
"chat.goal.toast.distillFallback": "Objective exceeded the limit and couldn't be distilled — a trimmed version is used for the auditor",
'chat.goal.row.aria': 'Session goal — open details',
'chat.goal.button.createAria': 'Set a session goal',
'chat.goal.button.manageAria': 'Manage session goal',
+1 -1
View File
@@ -1415,7 +1415,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.action.save": "Guardar objetivo",
"chat.goal.action.start": "Iniciar objetivo",
"chat.goal.toast.actionFailed": "No se pudo actualizar el objetivo",
"plans.goal.toast.distillFallback": "No se pudo destilar el plan para el auditor — se usó un extracto recortado",
"chat.goal.toast.distillFallback": "El objetivo superó el límite y no se pudo destilar — el auditor usa una versión recortada",
"chat.goal.row.aria": "Objetivo de sesión — abrir detalles",
"chat.goal.button.createAria": "Definir un objetivo de sesión",
"chat.goal.button.manageAria": "Gestionar el objetivo de sesión",
+1 -1
View File
@@ -1258,7 +1258,7 @@ export const dict = {
'chat.goal.action.save': 'Enregistrer l\'objectif',
'chat.goal.action.start': 'Lancer l\'objectif',
'chat.goal.toast.actionFailed': 'Échec de la mise à jour de l\'objectif',
"plans.goal.toast.distillFallback": "Impossible de condenser le plan pour l'auditeur — un extrait tronqué a été utilisé",
"chat.goal.toast.distillFallback": "L'objectif dépassait la limite et n'a pas pu être condensé — l'auditeur utilise une version tronquée",
'chat.goal.row.aria': 'Objectif de session — ouvrir les détails',
'chat.goal.button.createAria': 'Définir un objectif de session',
'chat.goal.button.manageAria': 'Gérer l\'objectif de session',
+1 -1
View File
@@ -1433,7 +1433,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.action.save': 'ゴールを保存',
'chat.goal.action.start': 'ゴールを開始',
'chat.goal.toast.actionFailed': 'ゴールの更新に失敗しました',
'plans.goal.toast.distillFallback': '監査用にプランを要約できませんでした — 抜粋版を使用します',
'chat.goal.toast.distillFallback': '目標が上限を超え、要約もできませんでした — 監査には抜粋版を使用します',
'chat.goal.row.aria': 'セッションゴール — 詳細を開く',
'chat.goal.button.createAria': 'セッションゴールを設定',
'chat.goal.button.manageAria': 'セッションゴールを管理',
+1 -1
View File
@@ -1439,7 +1439,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.action.save': '목표 저장',
'chat.goal.action.start': '목표 시작',
'chat.goal.toast.actionFailed': '목표 업데이트에 실패했습니다',
'plans.goal.toast.distillFallback': '감사용으로 계획을 요약하지 못했습니다 — 발췌본을 사용합니다',
'chat.goal.toast.distillFallback': '목표가 제한을 초과했고 요약도 실패했습니다 — 감사에는 발췌본을 사용합니다',
'chat.goal.row.aria': '세션 목표 — 세부 정보 열기',
'chat.goal.button.createAria': '세션 목표 설정',
'chat.goal.button.manageAria': '세션 목표 관리',
+1 -1
View File
@@ -2122,7 +2122,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.action.save': 'Zapisz cel',
'chat.goal.action.start': 'Rozpocznij cel',
'chat.goal.toast.actionFailed': 'Nie udało się zaktualizować celu',
'plans.goal.toast.distillFallback': 'Nie udało się skondensować planu dla audytora — użyto skróconego fragmentu',
'chat.goal.toast.distillFallback': 'Cel przekroczył limit i nie udało się go skondensować — audytor używa skróconej wersji',
'chat.goal.row.aria': 'Cel sesji — otwórz szczegóły',
'chat.goal.button.createAria': 'Ustaw cel sesji',
'chat.goal.button.manageAria': 'Zarządzaj celem sesji',
+1 -1
View File
@@ -1415,7 +1415,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.action.save": "Salvar objetivo",
"chat.goal.action.start": "Iniciar objetivo",
"chat.goal.toast.actionFailed": "Falha ao atualizar o objetivo",
"plans.goal.toast.distillFallback": "Não foi possível destilar o plano para o auditor — um trecho recortado foi usado",
"chat.goal.toast.distillFallback": "O objetivo excedeu o limite e não pôde ser destilado — o auditor usa uma versão recortada",
"chat.goal.row.aria": "Objetivo da sessão — abrir detalhes",
"chat.goal.button.createAria": "Definir um objetivo da sessão",
"chat.goal.button.manageAria": "Gerenciar objetivo da sessão",
+1 -1
View File
@@ -1415,7 +1415,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.action.save": "Зберегти ціль",
"chat.goal.action.start": "Розпочати ціль",
"chat.goal.toast.actionFailed": "Не вдалося оновити ціль",
"plans.goal.toast.distillFallback": "Не вдалося стиснути план для аудитора — використано скорочений уривок",
"chat.goal.toast.distillFallback": "Ціль перевищила ліміт і її не вдалося стиснути — аудитор використовує скорочену версію",
"chat.goal.row.aria": "Ціль сесії — відкрити деталі",
"chat.goal.button.createAria": "Встановити ціль сесії",
"chat.goal.button.manageAria": "Керувати ціллю сесії",
+1 -1
View File
@@ -1403,7 +1403,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.action.save': '保存目标',
'chat.goal.action.start': '启动目标',
'chat.goal.toast.actionFailed': '目标更新失败',
'plans.goal.toast.distillFallback': '无法为审核提炼计划 — 已改用节选版本',
'chat.goal.toast.distillFallback': '目标超出限制且无法提炼 — 审核将使用节选版本',
'chat.goal.row.aria': '会话目标 — 打开详情',
'chat.goal.button.createAria': '设置会话目标',
'chat.goal.button.manageAria': '管理会话目标',
+1 -1
View File
@@ -1407,7 +1407,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.action.save': '儲存目標',
'chat.goal.action.start': '啟動目標',
'chat.goal.toast.actionFailed': '目標更新失敗',
'plans.goal.toast.distillFallback': '無法為稽核提煉計畫 — 已改用節錄版本',
'chat.goal.toast.distillFallback': '目標超出限制且無法提煉 — 稽核將使用節錄版本',
'chat.goal.row.aria': '工作階段目標 — 開啟詳細資訊',
'chat.goal.button.createAria': '設定工作階段目標',
'chat.goal.button.manageAria': '管理工作階段目標',