mirror of
https://github.com/stablyai/orca.git
synced 2026-10-16 16:03:26 +00:00
Restore agent hook opt-out controls (#2778)
This commit is contained in:
@@ -19,6 +19,7 @@ import { SshFilesystemProvider } from '../providers/ssh-filesystem-provider'
|
||||
import { SshGitProvider } from '../providers/ssh-git-provider'
|
||||
import { agentHookServer } from '../agent-hooks/server'
|
||||
import { installRemoteManagedAgentHooks } from '../agent-hooks/remote-managed-hook-installers'
|
||||
import { isAgentStatusHooksEnabled } from '../agent-hooks/managed-agent-hook-controls'
|
||||
import {
|
||||
AGENT_HOOK_INSTALL_PLUGINS_METHOD,
|
||||
AGENT_HOOK_NOTIFICATION_METHOD,
|
||||
@@ -467,7 +468,7 @@ export class SshRelaySession {
|
||||
// configs before registering the PTY provider so newly spawned agent panes
|
||||
// report status from their first prompt.
|
||||
private async installManagedHooksOnRemote(mux: SshChannelMultiplexer): Promise<void> {
|
||||
if (!isRemoteAgentHooksEnabled()) {
|
||||
if (!isRemoteAgentHooksEnabled() || !this.areAgentStatusHooksEnabled()) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -519,7 +520,7 @@ export class SshRelaySession {
|
||||
// they upgrade. Hook-script-based agents use a separate explicit remote
|
||||
// installer flow because that mutates user-owned agent config files.
|
||||
private async installPluginsOnRelay(mux: SshChannelMultiplexer): Promise<void> {
|
||||
if (!isRemoteAgentHooksEnabled()) {
|
||||
if (!isRemoteAgentHooksEnabled() || !this.areAgentStatusHooksEnabled()) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
@@ -548,6 +549,11 @@ export class SshRelaySession {
|
||||
}
|
||||
}
|
||||
|
||||
private areAgentStatusHooksEnabled(): boolean {
|
||||
const store = this.store as { getSettings?: Store['getSettings'] }
|
||||
return isAgentStatusHooksEnabled(store.getSettings?.())
|
||||
}
|
||||
|
||||
private wireUpRemoteWorkspaceEvents(mux: SshChannelMultiplexer): void {
|
||||
mux.onNotification((method, params) => {
|
||||
notifyRemoteWorkspaceHandlers(this.targetId, method, params)
|
||||
|
||||
Reference in New Issue
Block a user