mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 11:54:46 +00:00
fix(agent-hooks): skip Orca's hook scripts outside Orca panes (#43081)
* fix(agent-hooks): skip managed hook scripts outside Orca panes Co-authored-by: Pr1p <zwq19980411@gmail.com> * test(gemini): drop type assertion in hook command test --------- Co-authored-by: Pr1p <zwq19980411@gmail.com>
This commit is contained in:
@@ -54,7 +54,12 @@ function getManagedScriptPath(): string {
|
||||
function getManagedCommand(scriptPath: string): string {
|
||||
return process.platform === 'win32'
|
||||
? wrapWindowsBatchHookCommand(scriptPath)
|
||||
: wrapPosixHookCommand(scriptPath)
|
||||
: getPosixManagedCommand(scriptPath)
|
||||
}
|
||||
|
||||
// Command Code scrubs hook env; its script recovers the pane from ancestor processes.
|
||||
function getPosixManagedCommand(scriptPath: string): string {
|
||||
return wrapPosixHookCommand(scriptPath, {}, { skipPaneGuard: true })
|
||||
}
|
||||
|
||||
function buildInstalledConfig(
|
||||
@@ -180,7 +185,7 @@ export class CommandCodeHookService {
|
||||
}
|
||||
}
|
||||
|
||||
buildInstalledConfig(config, wrapPosixHookCommand(remoteScriptPath), 'command-code-hook.sh')
|
||||
buildInstalledConfig(config, getPosixManagedCommand(remoteScriptPath), 'command-code-hook.sh')
|
||||
await writeManagedScriptRemote(sftp, remoteScriptPath, buildCommandCodeManagedScript('posix'))
|
||||
await writeHooksJsonRemote(sftp, remoteConfigPath, config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user