mirror of
https://github.com/stablyai/orca.git
synced 2026-10-16 00:03:09 +00:00
fix(native-chat): honor saved agent Command and Arguments (#25721)
* fix(native-chat): honor saved agent launch commands and arguments * fix(test): retain provider import after syncing main * fix(native-chat): preserve launch arguments and explain invalid settings * refactor(native-chat): require the current launch arguments source * fix(native-chat): require saved arguments when installing the runtime * fix(native-chat): show saved argument refusals beside launch retry * fix: ship saved-argument error messages in every locale * test: align model discovery with executable overrides * chore: drop the local pnpm install lockfile block
This commit is contained in:
@@ -278,6 +278,27 @@ export function resolveCliCommand(
|
||||
return installCandidate ?? commandName
|
||||
}
|
||||
|
||||
/** Resolve a literal override without falling back to an unverified command name. */
|
||||
export function resolveExecutableCommand(
|
||||
command: string,
|
||||
options: ResolveCommandOptions = {}
|
||||
): string | null {
|
||||
const platform = options.platform ?? process.platform
|
||||
const expanded =
|
||||
command.startsWith('~/') || command.startsWith('~\\')
|
||||
? join(options.homePath ?? homedir(), command.slice(2))
|
||||
: command
|
||||
if (isAbsolute(expanded)) {
|
||||
return isRunnableCommand(platform, expanded) ? expanded : null
|
||||
}
|
||||
// Relative paths depend on the workspace, which a session-less catalog cannot name.
|
||||
if (expanded.includes('/') || expanded.includes('\\')) {
|
||||
return null
|
||||
}
|
||||
const resolved = resolveCliCommand(expanded, options)
|
||||
return isAbsolute(resolved) && isRunnableCommand(platform, resolved) ? resolved : null
|
||||
}
|
||||
|
||||
export function resolveCliCommands(
|
||||
commandNames: readonly string[],
|
||||
options: ResolveCommandOptions = {}
|
||||
|
||||
Reference in New Issue
Block a user