问数据接着收尾一轮时按当前账号重新核对身份:服务重启后接手(已发起运行的接着等、复核)以前用的是发起时的身份快照,之后停用了、降了角色不会再核对。现在每次执行开始时按用户名读现在的账号(chat/job.current_principal):不在了、停用了,或者按现在的角色已经用不了问数据的,照实标中断、写清原因(cause identity),不再往下做;还用得了的按现在的角色、组接着做。已经发起的运行不动。页面照原因说「上次未完成」

This commit is contained in:
ThearchyHelios
2026-10-19 09:38:07 +08:00
parent edde451d19
commit fa431da91b
3 changed files with 145 additions and 7 deletions
+8
View File
@@ -136,6 +136,8 @@ export type TurnCause =
| { kind: 'run'; error?: string; detail?: string | null }
| { kind: 'gone' }
| { kind: 'build_interrupted' }
/** 服务重启后接着收尾时,发起这一轮的账号已停用、或者已经没有问数据的权限(服务端 chat/job.current_principal) */
| { kind: 'identity'; message?: string }
| { kind: 'crash'; message?: string }
/**
@@ -649,6 +651,12 @@ function causeFailure(cause: TurnCause, scope?: ScopeSource[]): Failure {
return GONE
case 'build_interrupted':
return BUILD_INTERRUPTED
case 'identity':
return {
title: '上次未完成',
reason: cause.message || '发起这一轮的账号已无法接着收尾,本轮没有接着做。',
hint: '如需继续,请由现在有问数据权限的人重新提问。',
}
case 'crash':
return failureOf(cause.message || '发生错误')
}