|
@@ -18,7 +18,7 @@ import type {
|
|
|
WorkspaceAgentUsageSummary,
|
|
WorkspaceAgentUsageSummary,
|
|
|
} from '../shared/workspace.js'
|
|
} from '../shared/workspace.js'
|
|
|
|
|
|
|
|
-import { WorkspaceScheduler, type Work, NO_REPLY, HOST_FALLBACK, WORKSPACE_CONCURRENCY_LIMIT } from './workspaceScheduler.js'
|
|
|
|
|
|
|
+import { WorkspaceScheduler, type Work, NO_REPLY, HOST_FALLBACK, WORKSPACE_CONCURRENCY_LIMIT, RESOURCE_WAIT_CODES } from './workspaceScheduler.js'
|
|
|
import type { WorkspacePlugins, OpenBotPlugins } from './botPlugins/workspacePlugins.js'
|
|
import type { WorkspacePlugins, OpenBotPlugins } from './botPlugins/workspacePlugins.js'
|
|
|
import { mentionedAgents } from './workspaceMentions.js'
|
|
import { mentionedAgents } from './workspaceMentions.js'
|
|
|
import { WorkspaceTeamTools, TEAM_TOOL_RULES } from './workspaceTeamTools.js'
|
|
import { WorkspaceTeamTools, TEAM_TOOL_RULES } from './workspaceTeamTools.js'
|
|
@@ -115,7 +115,7 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
const tools = response.status === 200 && value.ready === true && value.native_tools === true && value.in_process === true
|
|
const tools = response.status === 200 && value.ready === true && value.native_tools === true && value.in_process === true
|
|
|
return { tools, memory: tools && value.memory_isolation === true, extraction: value.memory_extraction === true }
|
|
return { tools, memory: tools && value.memory_isolation === true, extraction: value.memory_extraction === true }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- if (error instanceof HttpError && ['computer_busy', 'computer_quota', 'runner_offline'].includes(error.code ?? '')) throw error
|
|
|
|
|
|
|
+ if (error instanceof HttpError && RESOURCE_WAIT_CODES.has(error.code ?? '')) throw error
|
|
|
return { tools: false, memory: false, extraction: false }
|
|
return { tools: false, memory: false, extraction: false }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -356,7 +356,7 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
this.live.delete(key)
|
|
this.live.delete(key)
|
|
|
try {
|
|
try {
|
|
|
const current = this.getWork(owner, run.id)
|
|
const current = this.getWork(owner, run.id)
|
|
|
- if(error&&!submitted&¤t.status!=='interrupted'&&error instanceof HttpError&&['computer_busy','computer_quota','runner_offline'].includes(error.code??'')){
|
|
|
|
|
|
|
+ if(error&&!submitted&¤t.status!=='interrupted'&&error instanceof HttpError&&RESOURCE_WAIT_CODES.has(error.code??'')){
|
|
|
current.status='queued';current.resourceWait=true;current.error='等待执行节点或电脑资源';resultMessage.status='queued';resultMessage.visible=false;resultMessage.error=undefined
|
|
current.status='queued';current.resourceWait=true;current.error='等待执行节点或电脑资源';resultMessage.status='queued';resultMessage.visible=false;resultMessage.error=undefined
|
|
|
}else if (error) {
|
|
}else if (error) {
|
|
|
current.status = current.status === 'interrupted' ? 'interrupted' : submitted ? 'uncertain' : 'failed'
|
|
current.status = current.status === 'interrupted' ? 'interrupted' : submitted ? 'uncertain' : 'failed'
|