fix: retrieve stored result from tasks/result for failed tasks (#1930)
Co-authored-by: Christian-Sidak <csidak@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Konstantin Konstantinov <KKonstantinov@users.noreply.github.com> Co-authored-by: Konstantin Konstantinov <konstantin@mach5technology.com>
This commit is contained in:
parent
b8886e77f6
commit
bdfd7f0154
1 changed files with 51 additions and 5 deletions
|
|
@ -302,15 +302,12 @@ export class TaskManager {
|
|||
|
||||
if (isTerminal(task.status)) {
|
||||
switch (task.status) {
|
||||
case 'completed': {
|
||||
case 'completed':
|
||||
case 'failed': {
|
||||
const result = await this.getTaskResult({ taskId }, resultSchema, options);
|
||||
yield { type: 'result', result };
|
||||
break;
|
||||
}
|
||||
case 'failed': {
|
||||
yield { type: 'error', error: new ProtocolError(ProtocolErrorCode.InternalError, `Task ${taskId} failed`) };
|
||||
break;
|
||||
}
|
||||
case 'cancelled': {
|
||||
yield {
|
||||
type: 'error',
|
||||
|
|
|
|||
Loading…
Reference in a new issue