feat: surface session goal evaluation model and add diagnostics

Shows the evaluation provider/model used for the latest successful goal audit in the UI.
Persists evaluation model metadata on session goals and covers it in tests.
Adds diagnostic logging for small-model calls and session-goal audit parsing.
This commit is contained in:
Bohdan Triapitsyn
2026-07-15 08:56:10 +03:00
parent 4eac90ad44
commit e48a9397f1
17 changed files with 106 additions and 6 deletions
@@ -117,6 +117,14 @@ export function SessionGoalDialog({ open, onOpenChange, sessionId, directory }:
{goal.statusReason && (goal.status === 'blocked' || goal.status === 'budgetLimited') ? (
<p className="typography-meta text-muted-foreground/70">{goal.statusReason}</p>
) : null}
{goal.evaluationProviderID || goal.evaluationModelID ? (
<div className="flex items-baseline gap-2 typography-meta">
<span className="text-muted-foreground/70">{t('chat.goal.dialog.evaluationModelLabel')}</span>
<span className="min-w-0 break-all text-foreground">
{[goal.evaluationProviderID, goal.evaluationModelID].filter(Boolean).join('/')}
</span>
</div>
) : null}
</div>
)}
+1
View File
@@ -1416,6 +1416,7 @@ export const dict = {
'chat.goal.dialog.objectiveLabel': 'Objective',
'chat.goal.dialog.objectivePlaceholder': 'Describe the end state the agent should reach and verify…',
'chat.goal.dialog.budgetLabel': 'Token budget',
'chat.goal.dialog.evaluationModelLabel': 'Evaluation model',
'chat.goal.status.active': 'Active',
'chat.goal.status.evaluating': 'Evaluating…',
'chat.goal.status.paused': 'Paused',
+1
View File
@@ -1394,6 +1394,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.dialog.objectiveLabel": "Objetivo",
"chat.goal.dialog.objectivePlaceholder": "Describe el estado final que el agente debe alcanzar y verificar…",
"chat.goal.dialog.budgetLabel": "Presupuesto de tokens",
"chat.goal.dialog.evaluationModelLabel": "Modelo de evaluación",
"chat.goal.status.active": "Activo",
"chat.goal.status.evaluating": "Evaluando…",
"chat.goal.status.paused": "En pausa",
+1
View File
@@ -1236,6 +1236,7 @@ export const dict = {
'chat.goal.dialog.objectiveLabel': 'Objectif',
'chat.goal.dialog.objectivePlaceholder': 'Décrivez l\'état final que l\'agent doit atteindre et vérifier…',
'chat.goal.dialog.budgetLabel': 'Budget de tokens',
'chat.goal.dialog.evaluationModelLabel': 'Modèle d’évaluation',
'chat.goal.status.active': 'Actif',
'chat.goal.status.evaluating': 'Évaluation…',
'chat.goal.status.paused': 'En pause',
+1
View File
@@ -1412,6 +1412,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.dialog.objectiveLabel': '目標',
'chat.goal.dialog.objectivePlaceholder': 'エージェントが到達して検証すべき最終状態を記述してください…',
'chat.goal.dialog.budgetLabel': 'トークン予算',
'chat.goal.dialog.evaluationModelLabel': '評価モデル',
'chat.goal.status.active': '進行中',
'chat.goal.status.evaluating': '評価中…',
'chat.goal.status.paused': '一時停止',
+1
View File
@@ -1418,6 +1418,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.dialog.objectiveLabel': '목표',
'chat.goal.dialog.objectivePlaceholder': '에이전트가 도달하고 검증해야 할 최종 상태를 설명하세요…',
'chat.goal.dialog.budgetLabel': '토큰 예산',
'chat.goal.dialog.evaluationModelLabel': '평가 모델',
'chat.goal.status.active': '진행 중',
'chat.goal.status.evaluating': '평가 중…',
'chat.goal.status.paused': '일시 중지됨',
+1
View File
@@ -2104,6 +2104,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.dialog.objectiveLabel': 'Cel',
'chat.goal.dialog.objectivePlaceholder': 'Opisz stan końcowy, który agent ma osiągnąć i zweryfikować…',
'chat.goal.dialog.budgetLabel': 'Budżet tokenów',
'chat.goal.dialog.evaluationModelLabel': 'Model oceniający',
'chat.goal.status.active': 'Aktywny',
'chat.goal.status.evaluating': 'Ocenianie…',
'chat.goal.status.paused': 'Wstrzymany',
@@ -1394,6 +1394,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.dialog.objectiveLabel": "Objetivo",
"chat.goal.dialog.objectivePlaceholder": "Descreva o estado final que o agente deve alcançar e verificar…",
"chat.goal.dialog.budgetLabel": "Orçamento de tokens",
"chat.goal.dialog.evaluationModelLabel": "Modelo de avaliação",
"chat.goal.status.active": "Ativo",
"chat.goal.status.evaluating": "Avaliando…",
"chat.goal.status.paused": "Pausado",
+1
View File
@@ -1394,6 +1394,7 @@ export const dict: Record<I18nKey, string> = {
"chat.goal.dialog.objectiveLabel": "Ціль",
"chat.goal.dialog.objectivePlaceholder": "Опишіть кінцевий стан, якого агент має досягти та перевірити…",
"chat.goal.dialog.budgetLabel": "Бюджет токенів",
"chat.goal.dialog.evaluationModelLabel": "Модель оцінювання",
"chat.goal.status.active": "Активна",
"chat.goal.status.evaluating": "Оцінювання…",
"chat.goal.status.paused": "Призупинена",
@@ -1382,6 +1382,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.dialog.objectiveLabel': '目标',
'chat.goal.dialog.objectivePlaceholder': '描述代理应达到并验证的最终状态…',
'chat.goal.dialog.budgetLabel': '令牌预算',
'chat.goal.dialog.evaluationModelLabel': '评估模型',
'chat.goal.status.active': '进行中',
'chat.goal.status.evaluating': '评估中…',
'chat.goal.status.paused': '已暂停',
@@ -1386,6 +1386,7 @@ export const dict: Record<I18nKey, string> = {
'chat.goal.dialog.objectiveLabel': '目標',
'chat.goal.dialog.objectivePlaceholder': '描述代理應達成並驗證的最終狀態…',
'chat.goal.dialog.budgetLabel': '權杖預算',
'chat.goal.dialog.evaluationModelLabel': '評估模型',
'chat.goal.status.active': '進行中',
'chat.goal.status.evaluating': '評估中…',
'chat.goal.status.paused': '已暫停',
@@ -23,6 +23,8 @@ export interface SessionGoalPayload {
blockedStreak: number;
note: string;
statusReason: string;
evaluationProviderID: string;
evaluationModelID: string;
lastAccountedMessageID: string;
createdAt: number;
updatedAt: number;
@@ -64,6 +66,8 @@ export function getSessionGoal(session: Session | null | undefined): SessionGoal
blockedStreak: asCount(goal.blockedStreak),
note: typeof goal.note === 'string' ? goal.note : '',
statusReason: typeof goal.statusReason === 'string' ? goal.statusReason : '',
evaluationProviderID: typeof goal.evaluationProviderID === 'string' ? goal.evaluationProviderID : '',
evaluationModelID: typeof goal.evaluationModelID === 'string' ? goal.evaluationModelID : '',
lastAccountedMessageID: typeof goal.lastAccountedMessageID === 'string' ? goal.lastAccountedMessageID : '',
createdAt: typeof goal.createdAt === 'number' ? goal.createdAt : 0,
updatedAt: typeof goal.updatedAt === 'number' ? goal.updatedAt : 0,