fix: don't kill stream after approval — only abort on stop
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 37s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 37s
This commit is contained in:
parent
e6ecb2c48f
commit
25d25b44f0
@ -36,15 +36,15 @@ export class AdminAiChatController {
|
||||
@ApiOperation({ summary: '停止正在运行的 AI 任务' })
|
||||
async stopChat(@Body() body: { runId: string; action?: string }) {
|
||||
if (body.action) {
|
||||
// Approval action: forward to Hermes
|
||||
try {
|
||||
await fetch(`http://10.2.0.7:8642/v1/runs/${body.runId}/approval`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer zhixi-hermes-key-2026' },
|
||||
body: JSON.stringify({ choice: body.action }),
|
||||
});
|
||||
} catch {}
|
||||
// Approval: just forward to Hermes, don't kill the stream
|
||||
await fetch(`http://10.2.0.7:8642/v1/runs/${body.runId}/approval`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer zhixi-hermes-key-2026' },
|
||||
body: JSON.stringify({ choice: body.action }),
|
||||
}).catch(() => {});
|
||||
return { success: true };
|
||||
}
|
||||
// Stop: abort the stream
|
||||
return this.aiChatService.stopRun(body.runId);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user