mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 16:02:37 +00:00
Apply agent defaults to AI Vault resume (#6299)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -93,11 +93,21 @@ export function buildAiVaultResumeCommand(args: {
|
||||
const { agent, sessionId, cwd, platform, commandOverride, codexHome } = args
|
||||
const baseCommand = commandOverride?.trim() || defaultAiVaultResumeCommandBase(agent)
|
||||
const sessionArg = quoteShellArg(sessionId, platform)
|
||||
const resumeCommand = buildAgentResumeInvocation(agent, baseCommand, sessionArg, {
|
||||
codexHome: codexHome?.trim() || null,
|
||||
platform
|
||||
})
|
||||
const resumeCommand = buildAgentResumeInvocation(agent, baseCommand, sessionArg)
|
||||
|
||||
return buildAiVaultResumeShellCommand({ resumeCommand, cwd, platform, codexHome })
|
||||
}
|
||||
|
||||
export function buildAiVaultResumeShellCommand(args: {
|
||||
resumeCommand: string
|
||||
cwd: string | null
|
||||
platform: NodeJS.Platform
|
||||
codexHome?: string | null
|
||||
}): string {
|
||||
const { cwd, platform, codexHome } = args
|
||||
const resumeCommand = `${codexHomeEnvPrefix(codexHome?.trim() || null, platform)}${
|
||||
args.resumeCommand
|
||||
}`
|
||||
if (!cwd) {
|
||||
return resumeCommand
|
||||
}
|
||||
@@ -130,12 +140,11 @@ function defaultAiVaultResumeCommandBase(agent: AiVaultAgent): string {
|
||||
function buildAgentResumeInvocation(
|
||||
agent: AiVaultAgent,
|
||||
baseCommand: string,
|
||||
sessionArg: string,
|
||||
options: { codexHome: string | null; platform: NodeJS.Platform }
|
||||
sessionArg: string
|
||||
): string {
|
||||
switch (agent) {
|
||||
case 'codex':
|
||||
return `${codexHomeEnvPrefix(options.codexHome, options.platform)}${baseCommand} resume ${sessionArg}`
|
||||
return `${baseCommand} resume ${sessionArg}`
|
||||
case 'rovo':
|
||||
return `${baseCommand} rovodev run --restore ${sessionArg}`
|
||||
case 'opencode':
|
||||
|
||||
Reference in New Issue
Block a user