fix(云智能体): 修复微信失败运行状态投影并提高默认执行步数

This commit is contained in:
2026-09-14 15:39:35 +08:00
parent 9044f7dd8c
commit 4f2caf7dbd
7 changed files with 119 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ function ChannelSession({ sessionId, visible, refreshRevision, onBusy, onNewSess
return () => { live = false; clearTimeout(timer); };
}, [sessionId, visible, revision, refreshRevision]);
const runId = data?.run?.agent_run_id;
const runStatus = data?.run?.status;
const runStatus = data?.run?.status ?? data?.queued_requests?.[0]?.status;
const threadId = data?.thread_id;
useEffect(() => {
if (!visible || !threadId) return;
@@ -169,8 +169,13 @@ function ChannelSession({ sessionId, visible, refreshRevision, onBusy, onNewSess
{file.is_dir ? <Button variant="ghost" disabled={busy} className="min-w-0 justify-start" onClick={() => setPath(file.directory_path)}><Folder className="mr-2 h-4 w-4" /><span className="truncate">{file.name}</span></Button>
: <><span className="min-w-0 break-all">{file.name}</span><Button variant="outline" size="sm" disabled={busy} aria-label={'保存 ' + file.name} onClick={() => void save(file)}><Download className="mr-2 h-4 w-4" /></Button></>}
</div>);
const statusText = runStatus ? cloudStatus(runStatus) : data?.session_state === 'closed' ? '历史会话 · 可以查看消息和保存文件' : '等待微信消息';
const runError = data?.run?.error;
return <div className="space-y-4">
<div className="flex flex-wrap items-center justify-between gap-3"><p role="status" className="text-sm text-muted-foreground">{data?.session_state === 'closed' ? '历史会话 · 可以查看消息和保存文件' : runStatus ? cloudStatus(runStatus) : '等待微信消息'}</p>
<div className="flex flex-wrap items-center justify-between gap-3"><div data-testid="wechat-run-status" className="space-y-1 text-sm">
<p role="status" aria-label="微信任务状态" className="text-muted-foreground">{statusText}</p>
{runError?.message && <p role="alert" aria-label="微信任务错误" className="text-destructive">{runError.type ? runError.type + ' · ' : ''}{runError.message}</p>}
</div>
{controllable && <div className="flex gap-2"><Button variant="outline" size="sm" disabled={locked} onClick={() => void control({ session_id: sessionId, operation_id: crypto.randomUUID(), action: 'stop' }).catch(() => undefined)}></Button>
<Button variant="ghost" size="sm" disabled={locked || running} onClick={() => void control({ session_id: sessionId, operation_id: crypto.randomUUID(), action: 'new-session' }).catch(() => undefined)}></Button></div>}</div>
{pending.map(operation => <div key={operation.id} className="space-y-2 rounded-lg border border-amber-200 p-3 text-sm"><p></p>

View File

@@ -75,7 +75,7 @@ export function ConfigurationFields({ slug, value, disabled, onChange, section =
</div>
<div hidden={section !== 'all' && section !== 'limits'} className="space-y-6">
<CloudBudgetEditor slug={slug} />
<h2 className="font-medium"></h2><p className="text-xs text-muted-foreground">稿</p>
<h2 className="font-medium"></h2><p className="text-xs text-muted-foreground">稿</p>
<label className="block space-y-2 text-sm"><span></span>
<select className="h-10 w-full rounded-md border border-input bg-background px-3" disabled={disabled}
value={value.tool_approval_mode} onChange={e => change('tool_approval_mode', e.target.value === 'always_trust' ? 'always_trust' : 'default')}>