fix(pi): converge worker failures and thinking state

This commit is contained in:
2026-08-25 11:45:14 +08:00
parent 274187e3cf
commit 61817b161f
28 changed files with 2019 additions and 118 deletions

View File

@@ -98,6 +98,10 @@ export function CodingConversationHeader({
const modelValue = model ? codingModelKey(model) : '';
const hasCurrentOption = options.some((option) => option.key === modelValue);
const thinkingLevel = model?.thinkingLevel ?? 'off';
const availableThinkingLevels = snapshot?.conversation.model.availableThinkingLevels;
const thinkingOptions = availableThinkingLevels
? THINKING_OPTIONS.filter((option) => availableThinkingLevels.includes(option.value))
: THINKING_OPTIONS;
const runStatus = snapshot?.run.status ?? 'preparing';
const running = ['queued', 'running', 'retrying', 'compacting', 'aborting'].includes(runStatus);
const queueCount = snapshot?.queue.items.length ?? 0;
@@ -196,7 +200,7 @@ export function CodingConversationHeader({
await onRefresh();
})}
>
{THINKING_OPTIONS.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}
{thinkingOptions.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}
</Select>
<div className="flex min-w-44 items-center gap-2 rounded-xl bg-surface-subtle px-3 py-2 text-[11px] text-muted-foreground" title="当前 Conversation 的上下文使用量">
<span className="whitespace-nowrap"> {context?.usedTokens ?? 0}/{context?.contextWindow ?? 0}</span>