mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
Remove the per-repo agent folder trust prompt (#40934)
The first-launch 'Trust <repo> for agents?' modal blocked agent launches to ask a question that offered no real protection: undecided repos, and every unattended launch, already pre-trusted. Drop the dialog, the launch hold and the skipAgentWorkspaceTrust plumbing. Repos default to pre-trust; the per-repo setting remains as an opt-out.
This commit is contained in:
@@ -8,12 +8,10 @@ async function sshTrustRequest(input: {
|
||||
worktreeId: string
|
||||
globalEnabled?: boolean
|
||||
repoDecision?: AgentWorkspaceTrustDecision
|
||||
skipForThisLaunch?: boolean
|
||||
}): Promise<AgentTrustSpawnFields> {
|
||||
const spawnOptions: AgentTrustSpawnFields = {}
|
||||
await applyAgentWorkspaceTrustToSpawn({
|
||||
launchAgent: 'claude',
|
||||
skipForThisLaunch: input.skipForThisLaunch,
|
||||
worktreeId: input.worktreeId,
|
||||
cwd: '/srv/app',
|
||||
store: {
|
||||
@@ -56,10 +54,4 @@ describe('agent folder trust follows the repo decision', () => {
|
||||
})
|
||||
).toEqual({})
|
||||
})
|
||||
|
||||
it("honours this launch's let-agents-ask answer even when the repo has none stored", async () => {
|
||||
expect(
|
||||
await sshTrustRequest({ worktreeId: 'repo-1::/srv/app', skipForThisLaunch: true })
|
||||
).toEqual({})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -43,8 +43,6 @@ export function agentWorkspaceTrustDecisionForWorkspace(
|
||||
export function applyAgentWorkspaceTrustToSpawn(
|
||||
args: {
|
||||
launchAgent: unknown
|
||||
/** The user chose "let agents ask" for this launch; it wins even if saving that answer failed. */
|
||||
skipForThisLaunch?: boolean
|
||||
/** Placement workspace id; its root may differ from the agent’s starting folder. */
|
||||
worktreeId: string | undefined
|
||||
/** Section root to pre-trust for this launch; never part of the terminal identity. */
|
||||
@@ -64,7 +62,6 @@ export function applyAgentWorkspaceTrustToSpawn(
|
||||
const trustWorkspaceId = resolveAgentWorkspaceTrustOwner(args)
|
||||
if (
|
||||
!args.isFreshLaunch ||
|
||||
args.skipForThisLaunch === true ||
|
||||
!shouldPreTrustAgentWorkspace(
|
||||
args.settings?.agentWorkspaceTrustEnabled,
|
||||
agentWorkspaceTrustDecisionForWorkspace(trustWorkspaceId, args.store)
|
||||
|
||||
@@ -65,8 +65,6 @@ export type PtySpawnIpcArgs = {
|
||||
spawnIntent?: unknown
|
||||
// Only `true` counts: a window restore no user act asked for.
|
||||
wslPassiveRestore?: unknown
|
||||
// Only `true` counts: the user just chose to let agents ask, even if saving that answer failed.
|
||||
skipAgentWorkspaceTrust?: unknown
|
||||
// Validate untyped launch input through AgentLaunch.safeParse.
|
||||
agentLaunch?: unknown
|
||||
// Main validates renderer telemetry; retain unknown input types at the IPC boundary.
|
||||
|
||||
@@ -93,7 +93,6 @@ export type PtySpawnLaunchOptionsInput = {
|
||||
connectionId?: string | null
|
||||
shellOverride?: string
|
||||
telemetry?: { agent_kind?: unknown }
|
||||
skipAgentWorkspaceTrust?: unknown
|
||||
}
|
||||
env: Record<string, string> | undefined
|
||||
/** Mutated: OpenCode prep may add the keys its launch must drop. */
|
||||
@@ -210,7 +209,6 @@ export async function assemblePtySpawnLaunchOptions(input: PtySpawnLaunchOptions
|
||||
launchAgent: args.launchAgent,
|
||||
worktreeId: args.worktreeId,
|
||||
trustWorktreeId: args.trustWorktreeId,
|
||||
skipForThisLaunch: args.skipAgentWorkspaceTrust === true,
|
||||
cwd: input.cwd,
|
||||
store: input.store,
|
||||
isFreshLaunch: !input.preAdoptedStablePane && launchCommand !== undefined,
|
||||
|
||||
@@ -79,8 +79,6 @@ export type PtyApi = {
|
||||
spawnIntent?: SpawnIntent
|
||||
// A restore no user act asked for; main holds it for a stopped WSL distro. Older mains ignore it.
|
||||
wslPassiveRestore?: true
|
||||
// The user's "let agents ask" answer for this launch; older mains ignore it.
|
||||
skipAgentWorkspaceTrust?: true
|
||||
agentLaunch?: AgentPaneLaunchRequest
|
||||
// Main emits agent_started only after a successful spawn.
|
||||
telemetry?: { agent_kind: AgentKind; launch_source: LaunchSource; request_kind: RequestKind }
|
||||
|
||||
@@ -66,8 +66,6 @@ export const ptySessionControlApi = {
|
||||
placement?: TerminalPanePlacement
|
||||
spawnIntent?: SpawnIntent
|
||||
wslPassiveRestore?: true
|
||||
// The user's "let agents ask" answer for this launch; older mains ignore it.
|
||||
skipAgentWorkspaceTrust?: true
|
||||
agentLaunch?: AgentPaneLaunchRequest
|
||||
telemetry?: { agent_kind: AgentKind; launch_source: LaunchSource; request_kind: RequestKind }
|
||||
}): Promise<{
|
||||
|
||||
@@ -11,7 +11,6 @@ import { SkillFreshnessNudge } from './components/skills/freshness/SkillFreshnes
|
||||
import PinnedTabCloseDialog from './components/terminal-pane/layout/close/PinnedTabCloseDialog'
|
||||
import RunningTerminalCloseDialog from './components/terminal-pane/layout/close/RunningTerminalCloseDialog'
|
||||
import WorktreeBaseFallbackDialog from './components/WorktreeBaseFallbackDialog'
|
||||
import AgentWorkspaceTrustDecisionDialog from './components/agent-workspace-trust/AgentWorkspaceTrustDecisionDialog'
|
||||
import ClaudeAccountSwitchDialog from './components/ClaudeAccountSwitchDialog'
|
||||
import { useUnreadDockBadge } from './hooks/useUnreadDockBadge'
|
||||
import { AppBackgroundServices } from './app-shell/AppBackgroundServices'
|
||||
@@ -128,7 +127,6 @@ function App(): React.JSX.Element {
|
||||
</TooltipProvider>
|
||||
<SkillFreshnessNudge />
|
||||
<WorktreeBaseFallbackDialog />
|
||||
<AgentWorkspaceTrustDecisionDialog />
|
||||
<ClaudeAccountSwitchDialog />
|
||||
<PinnedTabCloseDialog />
|
||||
<RunningTerminalCloseDialog />
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
import { Dialog } from '@/components/ui/dialog'
|
||||
import { defineFixture } from '../../component-fixtures/component-fixture'
|
||||
import { AgentWorkspaceTrustDecisionDialogView } from './AgentWorkspaceTrustDecisionDialog'
|
||||
|
||||
export const firstLaunch = defineFixture({
|
||||
width: 640,
|
||||
render: () => (
|
||||
<Dialog open>
|
||||
<AgentWorkspaceTrustDecisionDialogView
|
||||
repoName="acme-web"
|
||||
saving={false}
|
||||
onAnswer={() => {}}
|
||||
/>
|
||||
</Dialog>
|
||||
)
|
||||
})
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
import { useEffect, useState, useSyncExternalStore } from 'react'
|
||||
import { ShieldQuestion } from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useAppStore } from '@/store'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle
|
||||
} from '@/components/ui/dialog'
|
||||
import type { AgentWorkspaceTrustDecision } from '../../../../shared/agent-launch/permissions/agent-workspace-trust-decision'
|
||||
import { agentWorkspaceTrustDecisionCopy as copy } from './agent-workspace-trust-decision-copy'
|
||||
import {
|
||||
answerAgentWorkspaceTrustDecision,
|
||||
getAgentWorkspaceTrustDecisionRequest,
|
||||
subscribeAgentWorkspaceTrustDecisionRequest
|
||||
} from './agent-workspace-trust-decision-prompt'
|
||||
|
||||
export type AgentWorkspaceTrustDecisionDialogViewProps = {
|
||||
repoName: string
|
||||
saving: boolean
|
||||
onAnswer: (decision: AgentWorkspaceTrustDecision) => void
|
||||
}
|
||||
|
||||
/** A launch waits on this answer, so it closes only through a choice. */
|
||||
export function AgentWorkspaceTrustDecisionDialogView({
|
||||
repoName,
|
||||
saving,
|
||||
onAnswer
|
||||
}: AgentWorkspaceTrustDecisionDialogViewProps): React.JSX.Element {
|
||||
return (
|
||||
<DialogContent
|
||||
className="sm:max-w-md"
|
||||
showCloseButton={false}
|
||||
onEscapeKeyDown={(event) => event.preventDefault()}
|
||||
onInteractOutside={(event) => event.preventDefault()}
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle size="compact">
|
||||
<span className="flex items-center gap-2">
|
||||
<ShieldQuestion className="size-4 text-muted-foreground" aria-hidden="true" />
|
||||
{copy.promptTitle(repoName)}
|
||||
</span>
|
||||
</DialogTitle>
|
||||
<DialogDescription>{copy.promptDescription()}</DialogDescription>
|
||||
</DialogHeader>
|
||||
<p className="text-xs text-muted-foreground">{copy.promptRemembered()}</p>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant="outline"
|
||||
disabled={saving}
|
||||
onClick={() => onAnswer('agent-asks')}
|
||||
>
|
||||
{copy.letAgentsAsk()}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
autoFocus
|
||||
disabled={saving}
|
||||
onClick={() => onAnswer('pre-trust')}
|
||||
>
|
||||
{copy.trustRepository()}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
)
|
||||
}
|
||||
|
||||
export default function AgentWorkspaceTrustDecisionDialog(): React.JSX.Element | null {
|
||||
const request = useSyncExternalStore(
|
||||
subscribeAgentWorkspaceTrustDecisionRequest,
|
||||
getAgentWorkspaceTrustDecisionRequest,
|
||||
getAgentWorkspaceTrustDecisionRequest
|
||||
)
|
||||
const [savingFor, setSavingFor] = useState<typeof request>(null)
|
||||
const setContextualToursBlockingSurfaceVisible = useAppStore(
|
||||
(state) => state.setContextualToursBlockingSurfaceVisible
|
||||
)
|
||||
const open = request !== null
|
||||
useEffect(() => {
|
||||
setContextualToursBlockingSurfaceVisible(open)
|
||||
return () => setContextualToursBlockingSurfaceVisible(false)
|
||||
}, [open, setContextualToursBlockingSurfaceVisible])
|
||||
if (!request) {
|
||||
return null
|
||||
}
|
||||
const answer = (decision: AgentWorkspaceTrustDecision): void => {
|
||||
setSavingFor(request)
|
||||
void answerAgentWorkspaceTrustDecision(decision).finally(() => setSavingFor(null))
|
||||
}
|
||||
return (
|
||||
<Dialog open>
|
||||
<AgentWorkspaceTrustDecisionDialogView
|
||||
key={`${request.hostId}:${request.repoId}`}
|
||||
repoName={request.repoName}
|
||||
saving={savingFor === request}
|
||||
onAnswer={answer}
|
||||
/>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
-21
@@ -2,22 +2,6 @@
|
||||
import { translate } from '@/i18n/i18n'
|
||||
|
||||
export const agentWorkspaceTrustDecisionCopy = {
|
||||
promptTitle: (repo: string) =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.prompt-title',
|
||||
'Trust {{repo}} for agents?',
|
||||
{ repo }
|
||||
),
|
||||
promptDescription: () =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.prompt-description',
|
||||
'Agents like Claude Code and Codex ask "Do you trust this folder?" before they load the project\'s own agent settings and hooks, which can run commands. Orca can answer yes for you in every worktree of this repository.'
|
||||
),
|
||||
promptRemembered: () =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.prompt-remembered',
|
||||
"Orca remembers your answer for this repository. You can change it in the repository's settings."
|
||||
),
|
||||
trustRepository: () =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.trust-repository',
|
||||
@@ -32,11 +16,6 @@ export const agentWorkspaceTrustDecisionCopy = {
|
||||
'auto.components.agent-workspace-trust-decision.setting-description',
|
||||
'Whether agents Orca starts in this repository\'s worktrees skip their "Do you trust this folder?" prompt and load the project\'s agent settings and hooks right away.'
|
||||
),
|
||||
settingUndecided: () =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.setting-undecided',
|
||||
'Not decided yet. Orca will ask the next time you start an agent here.'
|
||||
),
|
||||
settingGlobalOff: () =>
|
||||
translate(
|
||||
'auto.components.agent-workspace-trust-decision.setting-global-off',
|
||||
|
||||
-148
@@ -1,148 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { Repo } from '../../../../shared/repo-types'
|
||||
import {
|
||||
installIpcPtyWindow,
|
||||
restorePtySpecWindow
|
||||
} from '../terminal-pane/pty-transport/ipc/pty-transport-test-harness'
|
||||
|
||||
type StoreState = {
|
||||
repos: Partial<Repo>[]
|
||||
settings: { agentWorkspaceTrustEnabled: boolean }
|
||||
updateRepo: ReturnType<typeof vi.fn>
|
||||
}
|
||||
|
||||
const state = vi.hoisted((): StoreState => ({
|
||||
repos: [],
|
||||
settings: { agentWorkspaceTrustEnabled: true },
|
||||
updateRepo: vi.fn()
|
||||
}))
|
||||
|
||||
vi.mock('@/store', () => ({ useAppStore: { getState: () => state } }))
|
||||
|
||||
import {
|
||||
AGENT_TRUST_PROMPT_TIMEOUT_MS,
|
||||
AGENT_TRUST_SAVE_WAIT_MS,
|
||||
answerAgentWorkspaceTrustDecision,
|
||||
awaitAgentWorkspaceTrustDecision,
|
||||
getAgentWorkspaceTrustDecisionRequest,
|
||||
subscribeAgentWorkspaceTrustDecisionRequest
|
||||
} from './agent-workspace-trust-decision-prompt'
|
||||
|
||||
const WORKTREE = 'repo-1::/repos/app/feature'
|
||||
const launch = (workspaceId = WORKTREE) =>
|
||||
awaitAgentWorkspaceTrustDecision({ launchAgent: 'claude', workspaceId, connectionId: null })
|
||||
|
||||
let unsubscribeDialog: () => void = () => {}
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
vi.spyOn(console, 'warn').mockImplementation(() => {})
|
||||
unsubscribeDialog = subscribeAgentWorkspaceTrustDecisionRequest(() => {})
|
||||
state.repos = [{ id: 'repo-1', path: '/repos/app', displayName: 'app' }]
|
||||
state.settings = { agentWorkspaceTrustEnabled: true }
|
||||
state.updateRepo = vi.fn(async (repoId: string, updates: Partial<Repo>) => {
|
||||
state.repos = state.repos.map((repo) => (repo.id === repoId ? { ...repo, ...updates } : repo))
|
||||
return true
|
||||
})
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
// Release anything a test left on screen so module state never leaks between tests.
|
||||
await vi.advanceTimersByTimeAsync(AGENT_TRUST_PROMPT_TIMEOUT_MS)
|
||||
unsubscribeDialog()
|
||||
vi.useRealTimers()
|
||||
vi.restoreAllMocks()
|
||||
})
|
||||
|
||||
describe('first agent launch in a repo', () => {
|
||||
it.each([true, false])(
|
||||
'asks once for concurrent section launches through PTY connect (save succeeds: %s)',
|
||||
async (saveSucceeds) => {
|
||||
const originalWindow: typeof window | undefined = globalThis.window
|
||||
installIpcPtyWindow(originalWindow, {})
|
||||
if (!saveSucceeds) {
|
||||
state.updateRepo = vi.fn(async () => false)
|
||||
}
|
||||
vi.mocked(window.api.pty.spawn)
|
||||
.mockResolvedValueOnce({ id: 'section-1' })
|
||||
.mockResolvedValueOnce({ id: 'section-2' })
|
||||
const { createIpcPtyTransport } =
|
||||
await import('../terminal-pane/pty-transport/ipc/pty-transport')
|
||||
const transports = ['folder:placement', 'folder:other'].map((worktreeId) =>
|
||||
createIpcPtyTransport({
|
||||
worktreeId,
|
||||
trustWorktreeId: WORKTREE,
|
||||
cwd: '/repos/app/feature',
|
||||
command: 'claude',
|
||||
launchAgent: 'claude'
|
||||
})
|
||||
)
|
||||
const connecting = Promise.all(
|
||||
transports.map((transport) => transport.connect({ url: '', callbacks: {} }))
|
||||
)
|
||||
try {
|
||||
expect(getAgentWorkspaceTrustDecisionRequest()).toMatchObject({
|
||||
repoId: 'repo-1',
|
||||
repoName: 'app',
|
||||
hostId: 'local'
|
||||
})
|
||||
expect(window.api.pty.spawn).not.toHaveBeenCalled()
|
||||
await answerAgentWorkspaceTrustDecision('agent-asks')
|
||||
await connecting
|
||||
expect(state.updateRepo).toHaveBeenCalledExactlyOnceWith(
|
||||
'repo-1',
|
||||
{ agentWorkspaceTrust: 'agent-asks' },
|
||||
{ hostId: 'local' }
|
||||
)
|
||||
expect(getAgentWorkspaceTrustDecisionRequest()).toBeNull()
|
||||
expect(vi.mocked(window.api.pty.spawn).mock.calls.map(([args]) => args)).toMatchObject([
|
||||
{
|
||||
worktreeId: 'folder:placement',
|
||||
trustWorktreeId: WORKTREE,
|
||||
cwd: '/repos/app/feature',
|
||||
skipAgentWorkspaceTrust: true
|
||||
},
|
||||
{
|
||||
worktreeId: 'folder:other',
|
||||
trustWorktreeId: WORKTREE,
|
||||
cwd: '/repos/app/feature',
|
||||
skipAgentWorkspaceTrust: true
|
||||
}
|
||||
])
|
||||
} finally {
|
||||
await answerAgentWorkspaceTrustDecision('agent-asks')
|
||||
await connecting
|
||||
for (const transport of transports) {
|
||||
transport.destroy?.()
|
||||
}
|
||||
restorePtySpecWindow(originalWindow)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
it('releases with the answer when saving stalls', async () => {
|
||||
state.updateRepo = vi.fn(() => new Promise<boolean>(() => {}))
|
||||
const pending = launch()
|
||||
|
||||
const answered = answerAgentWorkspaceTrustDecision('agent-asks')
|
||||
await vi.advanceTimersByTimeAsync(AGENT_TRUST_SAVE_WAIT_MS)
|
||||
await answered
|
||||
|
||||
await expect(pending).resolves.toBe('agent-asks')
|
||||
})
|
||||
|
||||
it("releases an unanswered prompt with today's default and closes it", async () => {
|
||||
const pending = launch()
|
||||
|
||||
await vi.advanceTimersByTimeAsync(AGENT_TRUST_PROMPT_TIMEOUT_MS)
|
||||
|
||||
await expect(pending).resolves.toBeNull()
|
||||
expect(getAgentWorkspaceTrustDecisionRequest()).toBeNull()
|
||||
expect(state.updateRepo).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('never holds a launch when no dialog is mounted to answer it', () => {
|
||||
unsubscribeDialog()
|
||||
expect(launch()).toBeNull()
|
||||
})
|
||||
})
|
||||
-169
@@ -1,169 +0,0 @@
|
||||
import { useAppStore } from '@/store'
|
||||
import { getRepoRowIdentity, repoMatchesHostIdentity } from '@/store/repos/repo-host-identity'
|
||||
import {
|
||||
TUI_AGENT_CONFIG,
|
||||
isTuiAgent
|
||||
} from '../../../../shared/agent-launch/catalog/tui-agent-config'
|
||||
import {
|
||||
needsAgentWorkspaceTrustDecision,
|
||||
type AgentWorkspaceTrustDecision
|
||||
} from '../../../../shared/agent-launch/permissions/agent-workspace-trust-decision'
|
||||
import {
|
||||
getConnectionExecutionHostId,
|
||||
getRepoExecutionHostId
|
||||
} from '../../../../shared/execution-host'
|
||||
import type { Repo } from '../../../../shared/repo-types'
|
||||
import { parseWorkspaceKey } from '../../../../shared/workspace-scope'
|
||||
import { splitWorktreeId } from '../../../../shared/worktree/id'
|
||||
|
||||
export type AgentWorkspaceTrustDecisionRequest = {
|
||||
repoId: string
|
||||
repoName: string
|
||||
hostId: ReturnType<typeof getRepoExecutionHostId>
|
||||
}
|
||||
|
||||
/** The user's answer for this launch; null means no answer, so today's default applies. */
|
||||
export type AgentWorkspaceTrustLaunchAnswer = AgentWorkspaceTrustDecision | null
|
||||
|
||||
/** An unanswered prompt releases its launches with today's default rather than holding them. */
|
||||
export const AGENT_TRUST_PROMPT_TIMEOUT_MS = 120_000
|
||||
/** A slow save must not hold the launch; the answer still applies to this launch. */
|
||||
export const AGENT_TRUST_SAVE_WAIT_MS = 5_000
|
||||
|
||||
type PendingRequest = AgentWorkspaceTrustDecisionRequest & {
|
||||
rowIdentity: string
|
||||
settle: (answer: AgentWorkspaceTrustLaunchAnswer) => void
|
||||
timer?: ReturnType<typeof setTimeout>
|
||||
answering?: boolean
|
||||
}
|
||||
|
||||
const queue: PendingRequest[] = []
|
||||
const inFlightByRow = new Map<string, Promise<AgentWorkspaceTrustLaunchAnswer>>()
|
||||
const listeners = new Set<() => void>()
|
||||
|
||||
function notifyListeners(): void {
|
||||
for (const listener of listeners) {
|
||||
listener()
|
||||
}
|
||||
}
|
||||
|
||||
function release(request: PendingRequest, answer: AgentWorkspaceTrustLaunchAnswer): void {
|
||||
clearTimeout(request.timer)
|
||||
const index = queue.indexOf(request)
|
||||
if (index !== -1) {
|
||||
queue.splice(index, 1)
|
||||
}
|
||||
inFlightByRow.delete(request.rowIdentity)
|
||||
request.settle(answer)
|
||||
showNext()
|
||||
}
|
||||
|
||||
/** The timeout starts when a request is on screen, so a queued repo is not timed out unseen. */
|
||||
function showNext(): void {
|
||||
const next = queue[0]
|
||||
if (next && next.timer === undefined) {
|
||||
next.timer = setTimeout(() => {
|
||||
if (!next.answering) {
|
||||
release(next, null)
|
||||
}
|
||||
}, AGENT_TRUST_PROMPT_TIMEOUT_MS)
|
||||
}
|
||||
notifyListeners()
|
||||
}
|
||||
|
||||
/** The PTY's own connection names the owning host; never fall back to the focused host. */
|
||||
function repoForWorkspace(
|
||||
workspaceId: string | undefined,
|
||||
connectionId: string | null | undefined
|
||||
): Repo | null {
|
||||
const scope = workspaceId ? parseWorkspaceKey(workspaceId) : null
|
||||
if (!workspaceId || scope?.type === 'folder') {
|
||||
return null
|
||||
}
|
||||
const repoId = splitWorktreeId(
|
||||
scope?.type === 'worktree' ? scope.worktreeId : workspaceId
|
||||
)?.repoId
|
||||
if (!repoId) {
|
||||
return null
|
||||
}
|
||||
const hostId = getConnectionExecutionHostId(connectionId)
|
||||
return (
|
||||
useAppStore.getState().repos.find((repo) => repoMatchesHostIdentity(repo, repoId, hostId)) ??
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
/** Null when no answer is needed, so launches that need none keep their synchronous path. */
|
||||
export function awaitAgentWorkspaceTrustDecision(args: {
|
||||
launchAgent: unknown
|
||||
workspaceId: string | undefined
|
||||
connectionId: string | null | undefined
|
||||
}): Promise<AgentWorkspaceTrustLaunchAnswer> | null {
|
||||
// No mounted dialog could answer, so never hold the launch.
|
||||
if (listeners.size === 0) {
|
||||
return null
|
||||
}
|
||||
if (!isTuiAgent(args.launchAgent) || !TUI_AGENT_CONFIG[args.launchAgent].preflightTrust) {
|
||||
return null
|
||||
}
|
||||
const repo = repoForWorkspace(args.workspaceId, args.connectionId)
|
||||
const globalEnabled = useAppStore.getState().settings?.agentWorkspaceTrustEnabled
|
||||
if (!repo || !needsAgentWorkspaceTrustDecision(globalEnabled, repo.agentWorkspaceTrust)) {
|
||||
return null
|
||||
}
|
||||
const rowIdentity = getRepoRowIdentity(repo)
|
||||
const existing = inFlightByRow.get(rowIdentity)
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
const pending = new Promise<AgentWorkspaceTrustLaunchAnswer>((settle) => {
|
||||
queue.push({
|
||||
repoId: repo.id,
|
||||
repoName: repo.displayName,
|
||||
hostId: getRepoExecutionHostId(repo),
|
||||
rowIdentity,
|
||||
settle
|
||||
})
|
||||
})
|
||||
inFlightByRow.set(rowIdentity, pending)
|
||||
showNext()
|
||||
return pending
|
||||
}
|
||||
|
||||
/** Saves the answer, then releases waiting launches with it even if the save fails or stalls. */
|
||||
export async function answerAgentWorkspaceTrustDecision(
|
||||
decision: AgentWorkspaceTrustDecision
|
||||
): Promise<void> {
|
||||
const request = queue[0]
|
||||
if (!request || request.answering) {
|
||||
return
|
||||
}
|
||||
request.answering = true
|
||||
clearTimeout(request.timer)
|
||||
let saveWait: ReturnType<typeof setTimeout> | undefined
|
||||
const saved = await Promise.race([
|
||||
useAppStore
|
||||
.getState()
|
||||
.updateRepo(request.repoId, { agentWorkspaceTrust: decision }, { hostId: request.hostId })
|
||||
.catch(() => false),
|
||||
new Promise<false>((resolve) => {
|
||||
saveWait = setTimeout(() => resolve(false), AGENT_TRUST_SAVE_WAIT_MS)
|
||||
})
|
||||
])
|
||||
clearTimeout(saveWait)
|
||||
if (!saved) {
|
||||
console.warn(
|
||||
'[agent-trust] the repository answer was not saved; it applies to this launch only'
|
||||
)
|
||||
}
|
||||
release(request, decision)
|
||||
}
|
||||
|
||||
export function getAgentWorkspaceTrustDecisionRequest(): AgentWorkspaceTrustDecisionRequest | null {
|
||||
return queue[0] ?? null
|
||||
}
|
||||
|
||||
export function subscribeAgentWorkspaceTrustDecisionRequest(listener: () => void): () => void {
|
||||
listeners.add(listener)
|
||||
return () => listeners.delete(listener)
|
||||
}
|
||||
@@ -13,7 +13,7 @@ export function getAgentWorkspaceTrustTitle(t: Translate = translate): string {
|
||||
export function getAgentWorkspaceTrustDescription(t: Translate = translate): string {
|
||||
return t(
|
||||
'auto.components.settings.agent-workspace-trust-copy.description',
|
||||
'Agents Orca starts can skip their "Do you trust this folder?" prompt, so the project\'s agent hooks and settings run right away. Orca asks once per repository the first time you start an agent there, and you can change the answer in that repository\'s settings. Turn this off to let agents always ask. An agent that asks while running without you watching, such as an orchestration worker, an automation or an agent started from your phone, waits until you answer in its terminal. Folders already trusted stay trusted.'
|
||||
'Agents Orca starts can skip their "Do you trust this folder?" prompt, so the project\'s agent hooks and settings run right away. You can turn this off for one repository in that repository\'s settings. Turn this off to let agents always ask. An agent that asks while running without you watching, such as an orchestration worker, an automation or an agent started from your phone, waits until you answer in its terminal. Folders already trusted stay trusted.'
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ function fixture(decision: AgentWorkspaceTrustDecision | undefined, globalEnable
|
||||
})
|
||||
}
|
||||
|
||||
export const undecided = fixture(undefined)
|
||||
export const preTrust = fixture('pre-trust')
|
||||
export const agentAsks = fixture('agent-asks')
|
||||
export const globalOff = fixture('pre-trust', false)
|
||||
|
||||
@@ -30,7 +30,7 @@ export function RepositoryAgentTrustSection({
|
||||
(state) => state.settings?.agentWorkspaceTrustEnabled !== false
|
||||
)
|
||||
const entry = getRepositoryAgentTrustSearchEntry()
|
||||
const value = repo.agentWorkspaceTrust ?? 'undecided'
|
||||
const value = repo.agentWorkspaceTrust ?? 'pre-trust'
|
||||
return (
|
||||
<SearchableSetting
|
||||
title={entry.title}
|
||||
@@ -43,10 +43,10 @@ export function RepositoryAgentTrustSection({
|
||||
<div className="text-sm font-semibold">{entry.title}</div>
|
||||
<p className="text-xs text-muted-foreground">{entry.description}</p>
|
||||
</div>
|
||||
<SettingsSegmentedControl<AgentWorkspaceTrustDecision | 'undecided'>
|
||||
<SettingsSegmentedControl<AgentWorkspaceTrustDecision>
|
||||
value={value}
|
||||
onChange={(next) => {
|
||||
if (next !== 'undecided' && next !== value) {
|
||||
if (next !== value) {
|
||||
void updateRepo(repo.id, { agentWorkspaceTrust: next })
|
||||
}
|
||||
}}
|
||||
@@ -59,8 +59,6 @@ export function RepositoryAgentTrustSection({
|
||||
/>
|
||||
{!globalTrustEnabled ? (
|
||||
<p className="text-xs text-muted-foreground">{copy.settingGlobalOff()}</p>
|
||||
) : value === 'undecided' ? (
|
||||
<p className="text-xs text-muted-foreground">{copy.settingUndecided()}</p>
|
||||
) : null}
|
||||
</SearchableSetting>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { admitTerminalNoticeLifetime } from '../../provider-notices/terminal-notice-lifetime'
|
||||
import { resolveAgentWorkspaceTrustOwner } from '../../../../../../shared/agent-launch/permissions/agent-workspace-trust-decision'
|
||||
import { terminalLaunchFacts } from '../../../../../../shared/agent-session/lifecycle/agent-session-resume'
|
||||
import { readTerminalSpawnDeferral } from '../../../../../../shared/terminal/pty/admission/spawn-admission-contract'
|
||||
import { isRuntimeOwnedSshTargetId } from '../../../../../../shared/execution-host'
|
||||
@@ -20,7 +19,6 @@ import type { IpcPtySessionHandlers } from './ipc-pty-session-handlers'
|
||||
import { isSshSessionGoneError } from '../host-ownership/ssh-session-gone-verdict'
|
||||
import { spawnIpcPty } from './ipc-pty-spawn-request'
|
||||
import { settleAgentLaunchPaneStart } from '@/lib/agent-session/launch/pane/agent-launch-pane-start'
|
||||
import { awaitAgentWorkspaceTrustDecision } from '../../../agent-workspace-trust/agent-workspace-trust-decision-prompt'
|
||||
import type { IpcPtyTransportOptions, PtyConnectResult, PtyTransport } from '../pty-transport-types'
|
||||
|
||||
const SSH_PTY_CONNECTION_MISMATCH_MARKER = 'belongs to SSH connection'
|
||||
@@ -83,31 +81,12 @@ export async function connectIpcPty(
|
||||
return
|
||||
}
|
||||
}
|
||||
// A fresh agent launch in an undecided repo waits for the user's trust answer.
|
||||
const trustDecision =
|
||||
admittedSessionId || (options.command ?? transportOptions.command) === undefined
|
||||
? null
|
||||
: awaitAgentWorkspaceTrustDecision({
|
||||
launchAgent: options.launchAgent ?? transportOptions.launchAgent,
|
||||
workspaceId: resolveAgentWorkspaceTrustOwner(transportOptions),
|
||||
connectionId: transportOptions.connectionId
|
||||
})
|
||||
// Bounded: an unanswered prompt releases with today's default (agent-workspace-trust-decision-prompt).
|
||||
const trustAnswer = trustDecision ? await trustDecision : null
|
||||
if (trustDecision && context.isDestroyed()) {
|
||||
return
|
||||
}
|
||||
if (options.shouldContinue && !options.shouldContinue()) {
|
||||
return
|
||||
}
|
||||
// Fence before spawning: redeployed relays recycle IDs, so earlier buffered state belongs to a previous PTY lifetime.
|
||||
const priorIncarnationFence = currentPreHandlerPtySequence()
|
||||
const spawnResult = await spawnIpcPty(
|
||||
transportOptions,
|
||||
options,
|
||||
admittedSessionId,
|
||||
trustAnswer === 'agent-asks'
|
||||
)
|
||||
const spawnResult = await spawnIpcPty(transportOptions, options, admittedSessionId)
|
||||
settleAgentLaunchPaneStart(transportOptions.tabId, transportOptions.leafId, spawnResult.id)
|
||||
// Any resolved spawn or cold restore is live under this id, even if this transport was destroyed meanwhile.
|
||||
markTerminalProviderSessionBound(spawnResult.id)
|
||||
|
||||
+1
-4
@@ -19,9 +19,7 @@ export type IpcPtySpawnResponse = PtyConnectResult & {
|
||||
export async function spawnIpcPty(
|
||||
transportOptions: IpcPtyTransportOptions,
|
||||
connectOptions: PtyConnectOptions,
|
||||
admittedSessionId?: string,
|
||||
/** The user's "let agents ask" answer for this launch. */
|
||||
skipAgentWorkspaceTrust = false
|
||||
admittedSessionId?: string
|
||||
): Promise<IpcPtySpawnResponse> {
|
||||
if (
|
||||
!admittedSessionId &&
|
||||
@@ -146,7 +144,6 @@ export async function spawnIpcPty(
|
||||
...(placement && !admittedSessionId ? { placement } : {}),
|
||||
...(spawnIntent ? { spawnIntent } : {}),
|
||||
...(connectOptions.wslPassiveRestore ? { wslPassiveRestore: true as const } : {}),
|
||||
...(skipAgentWorkspaceTrust ? { skipAgentWorkspaceTrust: true as const } : {}),
|
||||
...(replacesPtyId ? { replacesPtyId } : {}),
|
||||
...(shellOverride ? { shellOverride } : {}),
|
||||
...(projectRuntime ? { projectRuntime } : {}),
|
||||
|
||||
@@ -11307,7 +11307,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Dem Ordner vertrauen, wenn Orca einen Agenten startet",
|
||||
"description": "Von Orca gestartete Agenten können die Abfrage „Do you trust this folder?“ überspringen, sodass die Agenten-Hooks und Einstellungen des Projekts sofort ausgeführt werden. Orca fragt einmal pro Repository beim ersten Agentenstart dort nach; die Antwort lässt sich in den Einstellungen dieses Repositorys ändern. Ausgeschaltet fragen Agenten immer selbst nach. Ein Agent, der unbeaufsichtigt läuft und nachfragt, etwa ein Orchestrierungs-Worker, eine Automatisierung oder ein vom Smartphone gestarteter Agent, wartet, bis die Frage in seinem Terminal beantwortet wird. Bereits als vertrauenswürdig eingestufte Ordner bleiben vertrauenswürdig."
|
||||
"description": "Von Orca gestartete Agenten können die Abfrage „Do you trust this folder?“ überspringen, sodass die Agenten-Hooks und Einstellungen des Projekts sofort ausgeführt werden. In den Einstellungen eines Repositorys lässt sich das für dieses Repository ausschalten. Ausgeschaltet fragen Agenten immer selbst nach. Ein Agent, der unbeaufsichtigt läuft und nachfragt, etwa ein Orchestrierungs-Worker, eine Automatisierung oder ein vom Smartphone gestarteter Agent, wartet, bis die Frage in seinem Terminal beantwortet wird. Bereits als vertrauenswürdig eingestufte Ordner bleiben vertrauenswürdig."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Tab-Titel automatisch generieren",
|
||||
@@ -18987,14 +18987,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "Dem Repository {{repo}} für Agenten vertrauen?",
|
||||
"prompt-description": "Agenten wie Claude Code und Codex fragen „Do you trust this folder?“, bevor sie die eigenen Agenten-Einstellungen und Hooks des Projekts laden, die Befehle ausführen können. Orca kann diese Frage in jedem Worktree dieses Repositorys automatisch mit Ja beantworten.",
|
||||
"prompt-remembered": "Orca merkt sich die Antwort für dieses Repository. Sie lässt sich in den Einstellungen des Repositorys ändern.",
|
||||
"trust-repository": "Dem Repository vertrauen",
|
||||
"let-agents-ask": "Agenten fragen lassen",
|
||||
"setting-title": "Ordnervertrauen für Agenten",
|
||||
"setting-description": "Legt fest, ob von Orca gestartete Agenten in den Worktrees dieses Repositorys die Abfrage „Do you trust this folder?“ überspringen und die Agenten-Einstellungen und Hooks des Projekts sofort laden.",
|
||||
"setting-undecided": "Noch nicht entschieden. Orca fragt beim nächsten Agentenstart hier nach.",
|
||||
"setting-global-off": "Das Ordnervertrauen ist in den Agenten-Einstellungen ausgeschaltet, daher fragen Agenten immer nach.",
|
||||
"keyword-trust": "vertrauen",
|
||||
"keyword-hooks": "Hooks"
|
||||
|
||||
@@ -11768,7 +11768,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Trust the folder when Orca starts an agent",
|
||||
"description": "Agents Orca starts can skip their \"Do you trust this folder?\" prompt, so the project's agent hooks and settings run right away. Orca asks once per repository the first time you start an agent there, and you can change the answer in that repository's settings. Turn this off to let agents always ask. An agent that asks while running without you watching, such as an orchestration worker, an automation or an agent started from your phone, waits until you answer in its terminal. Folders already trusted stay trusted."
|
||||
"description": "Agents Orca starts can skip their \"Do you trust this folder?\" prompt, so the project's agent hooks and settings run right away. You can turn this off for one repository in that repository's settings. Turn this off to let agents always ask. An agent that asks while running without you watching, such as an orchestration worker, an automation or an agent started from your phone, waits until you answer in its terminal. Folders already trusted stay trusted."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Auto-generate tab titles",
|
||||
@@ -19607,14 +19607,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "Trust {{repo}} for agents?",
|
||||
"prompt-description": "Agents like Claude Code and Codex ask \"Do you trust this folder?\" before they load the project's own agent settings and hooks, which can run commands. Orca can answer yes for you in every worktree of this repository.",
|
||||
"prompt-remembered": "Orca remembers your answer for this repository. You can change it in the repository's settings.",
|
||||
"trust-repository": "Trust repository",
|
||||
"let-agents-ask": "Let agents ask",
|
||||
"setting-title": "Agent Folder Trust",
|
||||
"setting-description": "Whether agents Orca starts in this repository's worktrees skip their \"Do you trust this folder?\" prompt and load the project's agent settings and hooks right away.",
|
||||
"setting-undecided": "Not decided yet. Orca will ask the next time you start an agent here.",
|
||||
"setting-global-off": "Folder trust is turned off in Agents settings, so agents always ask.",
|
||||
"keyword-trust": "trust",
|
||||
"keyword-hooks": "hooks"
|
||||
|
||||
@@ -10905,7 +10905,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Confiar en la carpeta cuando Orca inicia un agente",
|
||||
"description": "Los agentes que inicia Orca pueden omitir su pregunta \"Do you trust this folder?\", así que los hooks y ajustes de agente del proyecto se ejecutan de inmediato. Orca pregunta una vez por repositorio la primera vez que inicias un agente allí, y puedes cambiar la respuesta en los ajustes de ese repositorio. Desactívalo para que los agentes pregunten siempre. Un agente que pregunta mientras se ejecuta sin que estés mirando, como un worker de orquestación, una automatización o un agente iniciado desde tu teléfono, espera hasta que respondas en su terminal. Las carpetas que ya son de confianza lo siguen siendo."
|
||||
"description": "Los agentes que inicia Orca pueden omitir su pregunta \"Do you trust this folder?\", así que los hooks y ajustes de agente del proyecto se ejecutan de inmediato. Puedes desactivarlo para un repositorio en los ajustes de ese repositorio. Desactívalo para que los agentes pregunten siempre. Un agente que pregunta mientras se ejecuta sin que estés mirando, como un worker de orquestación, una automatización o un agente iniciado desde tu teléfono, espera hasta que respondas en su terminal. Las carpetas que ya son de confianza lo siguen siendo."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Generar títulos de pestañas automáticamente",
|
||||
@@ -18781,14 +18781,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "¿Confiar en {{repo}} para los agentes?",
|
||||
"prompt-description": "Los agentes como Claude Code y Codex preguntan \"Do you trust this folder?\" antes de cargar los ajustes y hooks de agente propios del proyecto, que pueden ejecutar comandos. Orca puede responder que sí por ti en todos los worktrees de este repositorio.",
|
||||
"prompt-remembered": "Orca recuerda tu respuesta para este repositorio. Puedes cambiarla en los ajustes del repositorio.",
|
||||
"trust-repository": "Confiar en el repositorio",
|
||||
"let-agents-ask": "Dejar que los agentes pregunten",
|
||||
"setting-title": "Confianza de carpetas para agentes",
|
||||
"setting-description": "Indica si los agentes que Orca inicia en los worktrees de este repositorio omiten su pregunta \"Do you trust this folder?\" y cargan de inmediato los ajustes y hooks de agente del proyecto.",
|
||||
"setting-undecided": "Aún no se ha decidido. Orca preguntará la próxima vez que inicies un agente aquí.",
|
||||
"setting-global-off": "La confianza de carpetas está desactivada en los ajustes de Agentes, así que los agentes siempre preguntan.",
|
||||
"keyword-trust": "confianza",
|
||||
"keyword-hooks": "hooks"
|
||||
|
||||
@@ -11175,7 +11175,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Faire confiance au dossier quand Orca lance un agent",
|
||||
"description": "Les agents lancés par Orca peuvent ignorer leur question « Do you trust this folder? » : les hooks et paramètres d'agent du projet s'exécutent donc tout de suite. Orca pose la question une fois par dépôt, la première fois que vous y lancez un agent, et vous pouvez modifier la réponse dans les paramètres de ce dépôt. Désactivez cette option pour que les agents posent toujours la question. Un agent qui pose la question alors qu'il tourne sans que vous le surveilliez, comme un worker d'orchestration, une automatisation ou un agent lancé depuis votre téléphone, attend que vous répondiez dans son terminal. Les dossiers déjà approuvés le restent."
|
||||
"description": "Les agents lancés par Orca peuvent ignorer leur question « Do you trust this folder? » : les hooks et paramètres d'agent du projet s'exécutent donc tout de suite. Vous pouvez désactiver cette option pour un dépôt dans les paramètres de ce dépôt. Désactivez cette option pour que les agents posent toujours la question. Un agent qui pose la question alors qu'il tourne sans que vous le surveilliez, comme un worker d'orchestration, une automatisation ou un agent lancé depuis votre téléphone, attend que vous répondiez dans son terminal. Les dossiers déjà approuvés le restent."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Générer automatiquement les titres des onglets",
|
||||
@@ -19020,14 +19020,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "Faire confiance à {{repo}} pour les agents ?",
|
||||
"prompt-description": "Les agents comme Claude Code et Codex demandent « Do you trust this folder? » avant de charger les paramètres et hooks d'agent propres au projet, qui peuvent exécuter des commandes. Orca peut répondre oui à votre place dans chaque worktree de ce dépôt.",
|
||||
"prompt-remembered": "Orca mémorise votre réponse pour ce dépôt. Vous pouvez la modifier dans les paramètres du dépôt.",
|
||||
"trust-repository": "Faire confiance au dépôt",
|
||||
"let-agents-ask": "Laisser les agents demander",
|
||||
"setting-title": "Confiance des dossiers pour les agents",
|
||||
"setting-description": "Indique si les agents lancés par Orca dans les worktrees de ce dépôt ignorent leur question « Do you trust this folder? » et chargent tout de suite les paramètres et hooks d'agent du projet.",
|
||||
"setting-undecided": "Pas encore décidé. Orca posera la question la prochaine fois que vous lancerez un agent ici.",
|
||||
"setting-global-off": "La confiance des dossiers est désactivée dans les paramètres Agents : les agents posent donc toujours la question.",
|
||||
"keyword-trust": "confiance",
|
||||
"keyword-hooks": "hooks"
|
||||
|
||||
@@ -10664,7 +10664,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Orca が Agent を起動するときにフォルダーを信頼する",
|
||||
"description": "Orca が起動した Agent は「Do you trust this folder?」の確認を省略できるため、プロジェクトの Agent のフックと設定がすぐに実行されます。Orca はリポジトリごとに、初めて Agent を起動したときに一度だけ確認します。回答はそのリポジトリの設定で変更できます。オフにすると Agent は常に確認します。オーケストレーションのワーカー、オートメーション、スマートフォンから起動した Agent など、あなたが見ていない間に動く Agent が確認を求めた場合は、そのターミナルで応答するまで待機します。すでに信頼済みのフォルダーは信頼されたままです。"
|
||||
"description": "Orca が起動した Agent は「Do you trust this folder?」の確認を省略できるため、プロジェクトの Agent のフックと設定がすぐに実行されます。リポジトリごとに、そのリポジトリの設定でオフにできます。オフにすると Agent は常に確認します。オーケストレーションのワーカー、オートメーション、スマートフォンから起動した Agent など、あなたが見ていない間に動く Agent が確認を求めた場合は、そのターミナルで応答するまで待機します。すでに信頼済みのフォルダーは信頼されたままです。"
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "タブタイトルを自動生成",
|
||||
@@ -18308,14 +18308,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "{{repo}} を Agent 用に信頼しますか?",
|
||||
"prompt-description": "Claude Code や Codex などの Agent は、プロジェクト独自の Agent 設定とフック(コマンドを実行できます)を読み込む前に「Do you trust this folder?」と確認します。Orca がこのリポジトリのすべてのワークツリーで代わりに「はい」と答えることができます。",
|
||||
"prompt-remembered": "Orca はこのリポジトリへの回答を記憶します。リポジトリの設定で変更できます。",
|
||||
"trust-repository": "リポジトリを信頼",
|
||||
"let-agents-ask": "Agent に確認させる",
|
||||
"setting-title": "Agent のフォルダー信頼",
|
||||
"setting-description": "このリポジトリのワークツリーで Orca が起動した Agent が「Do you trust this folder?」の確認を省略し、プロジェクトの Agent 設定とフックをすぐに読み込むかどうかを指定します。",
|
||||
"setting-undecided": "まだ決めていません。次にここで Agent を起動したときに Orca が確認します。",
|
||||
"setting-global-off": "Agent 設定でフォルダーの信頼がオフになっているため、Agent は常に確認します。",
|
||||
"keyword-trust": "信頼",
|
||||
"keyword-hooks": "フック"
|
||||
|
||||
@@ -10627,7 +10627,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Orca가 에이전트를 시작할 때 폴더 신뢰",
|
||||
"description": "Orca가 시작한 에이전트는 \"Do you trust this folder?\" 확인을 건너뛸 수 있으므로, 프로젝트의 에이전트 훅과 설정이 바로 실행됩니다. Orca는 저장소마다 처음 에이전트를 시작할 때 한 번 묻고, 답변은 해당 저장소 설정에서 변경할 수 있습니다. 이 설정을 끄면 에이전트가 항상 확인을 요청합니다. 오케스트레이션 워커, 자동화, 휴대폰에서 시작한 에이전트처럼 사용자가 지켜보지 않는 동안 실행되는 에이전트가 확인을 요청하면 해당 터미널에서 응답할 때까지 기다립니다. 이미 신뢰한 폴더는 계속 신뢰됩니다."
|
||||
"description": "Orca가 시작한 에이전트는 \"Do you trust this folder?\" 확인을 건너뛸 수 있으므로, 프로젝트의 에이전트 훅과 설정이 바로 실행됩니다. 저장소별로 해당 저장소 설정에서 끌 수 있습니다. 이 설정을 끄면 에이전트가 항상 확인을 요청합니다. 오케스트레이션 워커, 자동화, 휴대폰에서 시작한 에이전트처럼 사용자가 지켜보지 않는 동안 실행되는 에이전트가 확인을 요청하면 해당 터미널에서 응답할 때까지 기다립니다. 이미 신뢰한 폴더는 계속 신뢰됩니다."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "탭 제목 자동 생성",
|
||||
@@ -18308,14 +18308,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "{{repo}}을(를) 에이전트용으로 신뢰할까요?",
|
||||
"prompt-description": "Claude Code, Codex 같은 에이전트는 명령을 실행할 수 있는 프로젝트 자체의 에이전트 설정과 훅을 불러오기 전에 \"Do you trust this folder?\"라고 묻습니다. Orca가 이 저장소의 모든 작업 트리에서 대신 \"예\"라고 답할 수 있습니다.",
|
||||
"prompt-remembered": "Orca는 이 저장소에 대한 답변을 기억합니다. 저장소 설정에서 변경할 수 있습니다.",
|
||||
"trust-repository": "저장소 신뢰",
|
||||
"let-agents-ask": "에이전트가 묻도록 하기",
|
||||
"setting-title": "에이전트 폴더 신뢰",
|
||||
"setting-description": "이 저장소의 작업 트리에서 Orca가 시작한 에이전트가 \"Do you trust this folder?\" 확인을 건너뛰고 프로젝트의 에이전트 설정과 훅을 바로 불러올지 정합니다.",
|
||||
"setting-undecided": "아직 정하지 않았습니다. 다음에 여기서 에이전트를 시작하면 Orca가 묻습니다.",
|
||||
"setting-global-off": "에이전트 설정에서 폴더 신뢰가 꺼져 있으므로 에이전트가 항상 확인을 요청합니다.",
|
||||
"keyword-trust": "신뢰",
|
||||
"keyword-hooks": "훅"
|
||||
|
||||
@@ -8716,7 +8716,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Confiar na pasta quando o Orca iniciar um agente",
|
||||
"description": "Os agentes iniciados pelo Orca podem pular a pergunta “Você confia nesta pasta?”, para que os hooks e configurações de agentes do projeto sejam executados imediatamente. O Orca pergunta uma vez por repositório, na primeira vez que você inicia um agente nele, e você pode alterar a resposta nas configurações desse repositório. Desative para que os agentes sempre perguntem. Um agente que pergunta enquanto é executado sem sua supervisão, como um worker de orquestração, uma automação ou um agente iniciado pelo celular, espera até você responder no terminal dele. As pastas já confiáveis continuam confiáveis."
|
||||
"description": "Os agentes iniciados pelo Orca podem pular a pergunta “Você confia nesta pasta?”, para que os hooks e configurações de agentes do projeto sejam executados imediatamente. Você pode desativar isso para um repositório nas configurações desse repositório. Desative para que os agentes sempre perguntem. Um agente que pergunta enquanto é executado sem sua supervisão, como um worker de orquestração, uma automação ou um agente iniciado pelo celular, espera até você responder no terminal dele. As pastas já confiáveis continuam confiáveis."
|
||||
},
|
||||
"MachineNameField": {
|
||||
"label": "Nome da máquina",
|
||||
@@ -20016,14 +20016,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "Confiar em {{repo}} para agentes?",
|
||||
"prompt-description": "Agentes como Claude Code e Codex perguntam “Você confia nesta pasta?” antes de carregar as configurações e hooks de agentes do próprio projeto, que podem executar comandos. O Orca pode responder sim por você em todas as worktrees deste repositório.",
|
||||
"prompt-remembered": "O Orca lembra sua resposta para este repositório. Você pode alterá-la nas configurações do repositório.",
|
||||
"trust-repository": "Confiar no repositório",
|
||||
"let-agents-ask": "Deixar os agentes perguntarem",
|
||||
"setting-title": "Confiança de Pasta para Agentes",
|
||||
"setting-description": "Define se os agentes que o Orca inicia nas worktrees deste repositório pulam a pergunta “Você confia nesta pasta?” e carregam imediatamente as configurações e hooks de agentes do projeto.",
|
||||
"setting-undecided": "Ainda não decidido. O Orca vai perguntar na próxima vez que você iniciar um agente aqui.",
|
||||
"setting-global-off": "A confiança de pasta está desativada nas configurações de Agentes, então os agentes sempre perguntam.",
|
||||
"keyword-trust": "confiança",
|
||||
"keyword-hooks": "hooks"
|
||||
|
||||
@@ -11659,7 +11659,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Доверять папке при запуске агента из Orca",
|
||||
"description": "Агенты, запущенные Orca, могут пропускать вопрос «Доверяете ли вы этой папке?», поэтому хуки и настройки агентов проекта выполняются сразу. Orca спрашивает один раз для каждого репозитория при первом запуске агента в нём; ответ можно изменить в настройках этого репозитория. Отключите, чтобы агенты всегда спрашивали сами. Агент, который задаёт этот вопрос, работая без вашего наблюдения, например исполнитель оркестрации, автоматизация или агент, запущенный с телефона, ждёт ответа в своём терминале. Уже доверенные папки сохраняют доверие."
|
||||
"description": "Агенты, запущенные Orca, могут пропускать вопрос «Доверяете ли вы этой папке?», поэтому хуки и настройки агентов проекта выполняются сразу. Для отдельного репозитория это можно отключить в его настройках. Отключите, чтобы агенты всегда спрашивали сами. Агент, который задаёт этот вопрос, работая без вашего наблюдения, например исполнитель оркестрации, автоматизация или агент, запущенный с телефона, ждёт ответа в своём терминале. Уже доверенные папки сохраняют доверие."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Автоматически создавать заголовки вкладок",
|
||||
@@ -19557,14 +19557,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "Доверять {{repo}} для агентов?",
|
||||
"prompt-description": "Агенты, такие как Claude Code и Codex, спрашивают «Доверяете ли вы этой папке?», прежде чем загрузить собственные настройки и хуки агентов проекта, которые могут выполнять команды. Orca может отвечать «да» за вас во всех рабочих деревьях этого репозитория.",
|
||||
"prompt-remembered": "Orca запоминает ваш ответ для этого репозитория. Его можно изменить в настройках репозитория.",
|
||||
"trust-repository": "Доверять репозиторию",
|
||||
"let-agents-ask": "Пусть агенты спрашивают",
|
||||
"setting-title": "Доверие к папкам для агентов",
|
||||
"setting-description": "Пропускают ли агенты, запущенные Orca в рабочих деревьях этого репозитория, вопрос «Доверяете ли вы этой папке?» и сразу загружают настройки и хуки агентов проекта.",
|
||||
"setting-undecided": "Решение ещё не принято. Orca спросит, когда вы в следующий раз запустите здесь агента.",
|
||||
"setting-global-off": "Доверие к папкам отключено в настройках агентов, поэтому агенты всегда спрашивают.",
|
||||
"keyword-trust": "доверие",
|
||||
"keyword-hooks": "хуки"
|
||||
|
||||
@@ -11291,7 +11291,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Orca bir ajan başlattığında klasöre güven",
|
||||
"description": "Orca'nın başlattığı ajanlar \"Bu klasöre güveniyor musunuz?\" sorusunu atlayabilir; böylece projenin ajan kancaları ve ayarları hemen çalışır. Orca her repository için orada ilk kez bir ajan başlattığınızda bir kez sorar; yanıtı o repository'nin ayarlarından değiştirebilirsiniz. Ajanların her zaman sorması için bunu kapatın. Orkestrasyon çalışanı, otomasyon veya telefonunuzdan başlatılan bir ajan gibi gözetiminiz dışında çalışırken soru soran bir ajan, terminalinde yanıt verene kadar bekler. Zaten güvenilen klasörlere güvenilmeye devam edilir."
|
||||
"description": "Orca'nın başlattığı ajanlar \"Bu klasöre güveniyor musunuz?\" sorusunu atlayabilir; böylece projenin ajan kancaları ve ayarları hemen çalışır. Bunu bir repository için o repository'nin ayarlarından kapatabilirsiniz. Ajanların her zaman sorması için bunu kapatın. Orkestrasyon çalışanı, otomasyon veya telefonunuzdan başlatılan bir ajan gibi gözetiminiz dışında çalışırken soru soran bir ajan, terminalinde yanıt verene kadar bekler. Zaten güvenilen klasörlere güvenilmeye devam edilir."
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "Sekme başlıklarını otomatik oluştur",
|
||||
@@ -18971,14 +18971,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "{{repo}} ajanlar için güvenilir olsun mu?",
|
||||
"prompt-description": "Claude Code ve Codex gibi ajanlar, projenin komut çalıştırabilen kendi ajan ayarlarını ve kancalarını yüklemeden önce \"Bu klasöre güveniyor musunuz?\" diye sorar. Orca, bu repository'nin tüm worktree'lerinde sizin yerinize evet diyebilir.",
|
||||
"prompt-remembered": "Orca bu repository için verdiğiniz yanıtı hatırlar. Yanıtı repository ayarlarından değiştirebilirsiniz.",
|
||||
"trust-repository": "Repository'ye güven",
|
||||
"let-agents-ask": "Ajanlar sorsun",
|
||||
"setting-title": "Ajan Klasör Güveni",
|
||||
"setting-description": "Orca'nın bu repository'nin worktree'lerinde başlattığı ajanların \"Bu klasöre güveniyor musunuz?\" sorusunu atlayıp projenin ajan ayarlarını ve kancalarını hemen yükleyip yüklemeyeceği.",
|
||||
"setting-undecided": "Henüz karar verilmedi. Burada bir sonraki ajan başlatışınızda Orca soracak.",
|
||||
"setting-global-off": "Klasör güveni Ajanlar ayarlarında kapalı olduğundan ajanlar her zaman sorar.",
|
||||
"keyword-trust": "güven",
|
||||
"keyword-hooks": "kancalar"
|
||||
|
||||
@@ -11128,7 +11128,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Orca 啟動代理程式時信任該資料夾",
|
||||
"description": "Orca 啟動的代理程式可以略過「是否信任此資料夾?」的詢問,因此專案的代理程式鉤子和設定會立即執行。Orca 會在每個存放庫中首次啟動代理程式時詢問一次,你可以在該存放庫的設定中變更回答。關閉此項可讓代理程式一律自行詢問。在你沒有看著時執行的代理程式(例如編排工作行程、自動化以及從手機啟動的代理程式)若發出詢問,會一直等待,直到你在它的終端機中作答。已信任的資料夾仍保持信任。"
|
||||
"description": "Orca 啟動的代理程式可以略過「是否信任此資料夾?」的詢問,因此專案的代理程式鉤子和設定會立即執行。你可以在某個存放庫的設定中為該存放庫關閉此項。關閉此項可讓代理程式一律自行詢問。在你沒有看著時執行的代理程式(例如編排工作行程、自動化以及從手機啟動的代理程式)若發出詢問,會一直等待,直到你在它的終端機中作答。已信任的資料夾仍保持信任。"
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "自動產生分頁標題",
|
||||
@@ -18726,14 +18726,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "要為代理程式信任 {{repo}} 嗎?",
|
||||
"prompt-description": "Claude Code 和 Codex 等代理程式在載入專案自帶的代理程式設定和鉤子(可以執行命令)之前,會詢問「是否信任此資料夾?」。Orca 可以在此存放庫的每個工作樹中替你回答「是」。",
|
||||
"prompt-remembered": "Orca 會記住你對此存放庫的回答。你可以在存放庫設定中變更。",
|
||||
"trust-repository": "信任存放庫",
|
||||
"let-agents-ask": "讓代理程式詢問",
|
||||
"setting-title": "代理程式資料夾信任",
|
||||
"setting-description": "Orca 在此存放庫的工作樹中啟動的代理程式是否略過「是否信任此資料夾?」的詢問,並立即載入專案的代理程式設定和鉤子。",
|
||||
"setting-undecided": "尚未決定。下次你在這裡啟動代理程式時,Orca 會詢問。",
|
||||
"setting-global-off": "已在代理程式設定中關閉資料夾信任,因此代理程式一律會詢問。",
|
||||
"keyword-trust": "信任",
|
||||
"keyword-hooks": "鉤子"
|
||||
|
||||
@@ -10627,7 +10627,7 @@
|
||||
},
|
||||
"agent-workspace-trust-copy": {
|
||||
"title": "Orca 启动智能体时信任该文件夹",
|
||||
"description": "Orca 启动的智能体可以跳过“Do you trust this folder?”提示,因此项目的智能体钩子和设置会立即运行。Orca 会在每个仓库中首次启动智能体时询问一次,你可以在该仓库的设置中更改回答。关闭此项可让智能体始终自行询问。在你没有看着时运行的智能体(例如编排工作进程、自动化以及从手机启动的智能体)如果发出询问,会一直等待,直到你在它的终端中作答。已信任的文件夹仍保持信任。"
|
||||
"description": "Orca 启动的智能体可以跳过“Do you trust this folder?”提示,因此项目的智能体钩子和设置会立即运行。你可以在某个仓库的设置中为该仓库关闭此项。关闭此项可让智能体始终自行询问。在你没有看着时运行的智能体(例如编排工作进程、自动化以及从手机启动的智能体)如果发出询问,会一直等待,直到你在它的终端中作答。已信任的文件夹仍保持信任。"
|
||||
},
|
||||
"agent-generated-tab-title-copy": {
|
||||
"19ad21615a": "自动生成标签页标题",
|
||||
@@ -18308,14 +18308,10 @@
|
||||
}
|
||||
},
|
||||
"agent-workspace-trust-decision": {
|
||||
"prompt-title": "为智能体信任 {{repo}}?",
|
||||
"prompt-description": "Claude Code 和 Codex 等智能体在加载项目自带的智能体设置和钩子(可以运行命令)之前,会询问“Do you trust this folder?”。Orca 可以在此仓库的每个工作树中替你回答“是”。",
|
||||
"prompt-remembered": "Orca 会记住你对此仓库的回答。你可以在仓库设置中更改。",
|
||||
"trust-repository": "信任仓库",
|
||||
"let-agents-ask": "让智能体询问",
|
||||
"setting-title": "智能体文件夹信任",
|
||||
"setting-description": "Orca 在此仓库的工作树中启动的智能体是否跳过“Do you trust this folder?”提示,并立即加载项目的智能体设置和钩子。",
|
||||
"setting-undecided": "尚未决定。下次你在这里启动智能体时,Orca 会询问。",
|
||||
"setting-global-off": "已在智能体设置中关闭文件夹信任,因此智能体总会询问。",
|
||||
"keyword-trust": "信任",
|
||||
"keyword-hooks": "钩子"
|
||||
|
||||
+1
-3
@@ -81,9 +81,7 @@ export function launchWorkspaceState(
|
||||
addedAt: 0,
|
||||
kind: 'git',
|
||||
connectionId: null,
|
||||
executionHostId: 'local',
|
||||
// Parity rows model a repo whose first-launch trust answer is already stored.
|
||||
agentWorkspaceTrust: 'pre-trust'
|
||||
executionHostId: 'local'
|
||||
}
|
||||
: null
|
||||
const worktree = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type AgentWorkspaceTrustSettings = {
|
||||
/** Off: never pre-trust. On: pre-trust per each repo's decision (asked on first desktop launch). Defaults on. */
|
||||
/** Off: never pre-trust. On: pre-trust unless the repo opted out. Defaults on. */
|
||||
agentWorkspaceTrustEnabled: boolean
|
||||
/** One-shot guard: repos saved before per-repo trust decisions were pinned to pre-trust. */
|
||||
agentWorkspaceTrustExistingReposMigrated?: boolean
|
||||
@@ -14,7 +14,7 @@ export function sanitizeAgentWorkspaceTrustDecision(
|
||||
return value === 'pre-trust' || value === 'agent-asks' ? value : undefined
|
||||
}
|
||||
|
||||
/** Global off always wins; an undecided repo keeps the pre-existing pre-trust default so unattended launches never stall. */
|
||||
/** Global off always wins; a repo is pre-trusted unless it opted out. */
|
||||
export function shouldPreTrustAgentWorkspace(
|
||||
globalEnabled: boolean | undefined,
|
||||
repoDecision: AgentWorkspaceTrustDecision | undefined
|
||||
@@ -22,14 +22,6 @@ export function shouldPreTrustAgentWorkspace(
|
||||
return globalEnabled !== false && repoDecision !== 'agent-asks'
|
||||
}
|
||||
|
||||
/** Only a launch the user is watching asks; it must settle before the spawn reads the answer. */
|
||||
export function needsAgentWorkspaceTrustDecision(
|
||||
globalEnabled: boolean | undefined,
|
||||
repoDecision: AgentWorkspaceTrustDecision | undefined
|
||||
): boolean {
|
||||
return globalEnabled !== false && repoDecision === undefined
|
||||
}
|
||||
|
||||
export function resolveAgentWorkspaceTrustOwner(args: {
|
||||
worktreeId?: string
|
||||
trustWorktreeId?: string
|
||||
|
||||
@@ -70,13 +70,9 @@
|
||||
"auto.components.agent-workspace-trust-decision.keyword-hooks",
|
||||
"auto.components.agent-workspace-trust-decision.keyword-trust",
|
||||
"auto.components.agent-workspace-trust-decision.let-agents-ask",
|
||||
"auto.components.agent-workspace-trust-decision.prompt-description",
|
||||
"auto.components.agent-workspace-trust-decision.prompt-remembered",
|
||||
"auto.components.agent-workspace-trust-decision.prompt-title",
|
||||
"auto.components.agent-workspace-trust-decision.setting-description",
|
||||
"auto.components.agent-workspace-trust-decision.setting-global-off",
|
||||
"auto.components.agent-workspace-trust-decision.setting-title",
|
||||
"auto.components.agent-workspace-trust-decision.setting-undecided",
|
||||
"auto.components.agent-workspace-trust-decision.trust-repository",
|
||||
"auto.components.automations.AutomationsPage.080dcb5fbb",
|
||||
"auto.components.automations.AutomationsPage.15e0bfb13b",
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
import type { Page } from '@stablyai/playwright-test'
|
||||
import { expect, test } from './helpers/orca-app'
|
||||
import {
|
||||
configureGoldenStubAgent,
|
||||
getGoldenStubAgentLaunchEnv,
|
||||
GOLDEN_STUB_READY_MARKER
|
||||
} from './helpers/golden-stub-agent'
|
||||
import { addRepoWithWorkspaces } from './helpers/repo-with-workspaces'
|
||||
import { ensureTerminalVisible, switchToWorktree, waitForSessionReady } from './helpers/store'
|
||||
import { focusActiveTerminalInput, waitForTerminalOutput } from './helpers/terminal'
|
||||
|
||||
test.use({ launchEnv: getGoldenStubAgentLaunchEnv() })
|
||||
|
||||
const CLAUDE_MENU_ITEM = /^Claude(?:\s|$)/i
|
||||
|
||||
async function startClaudeFromNewTab(page: Page): Promise<void> {
|
||||
await page.getByRole('button', { name: 'New tab' }).click({ force: true })
|
||||
const launchOption = page.getByRole('menuitem', { name: CLAUDE_MENU_ITEM }).first()
|
||||
await expect(launchOption).toBeVisible({ timeout: 15_000 })
|
||||
await launchOption.click({ force: true })
|
||||
}
|
||||
|
||||
async function waitForAgentReady(page: Page): Promise<void> {
|
||||
await focusActiveTerminalInput(page)
|
||||
await waitForTerminalOutput(page, GOLDEN_STUB_READY_MARKER, 20_000)
|
||||
}
|
||||
|
||||
async function readRepoDecision(page: Page, repoId: string): Promise<string | null> {
|
||||
return page.evaluate(
|
||||
(id) =>
|
||||
window.__store?.getState().repos.find((repo) => repo.id === id)?.agentWorkspaceTrust ?? null,
|
||||
repoId
|
||||
)
|
||||
}
|
||||
|
||||
test('the first agent launch in a new repo asks once, and its worktrees share the answer', async ({
|
||||
orcaPage
|
||||
}, testInfo) => {
|
||||
await waitForSessionReady(orcaPage)
|
||||
await configureGoldenStubAgent(orcaPage, { agent: 'claude' })
|
||||
// A repo added now has no stored answer, like a fresh clone after the upgrade.
|
||||
const { repoId, mainId, ids } = await addRepoWithWorkspaces(orcaPage, testInfo, 1)
|
||||
await switchToWorktree(orcaPage, mainId)
|
||||
await ensureTerminalVisible(orcaPage)
|
||||
|
||||
await startClaudeFromNewTab(orcaPage)
|
||||
const prompt = orcaPage.getByRole('dialog', { name: /for agents\?$/ })
|
||||
await expect(prompt).toBeVisible({ timeout: 15_000 })
|
||||
await orcaPage.screenshot({ path: testInfo.outputPath('first-launch-prompt.png') })
|
||||
expect(await readRepoDecision(orcaPage, repoId)).toBeNull()
|
||||
|
||||
await prompt.getByRole('button', { name: 'Let agents ask', exact: true }).click()
|
||||
await expect(prompt).toBeHidden()
|
||||
await waitForAgentReady(orcaPage)
|
||||
expect(await readRepoDecision(orcaPage, repoId)).toBe('agent-asks')
|
||||
|
||||
// Another worktree of the same repo reuses the stored answer.
|
||||
const [sibling] = ids
|
||||
if (!sibling) {
|
||||
throw new Error('the repo needs a second worktree')
|
||||
}
|
||||
await switchToWorktree(orcaPage, sibling)
|
||||
await ensureTerminalVisible(orcaPage)
|
||||
await startClaudeFromNewTab(orcaPage)
|
||||
await waitForAgentReady(orcaPage)
|
||||
await expect(prompt).toHaveCount(0)
|
||||
|
||||
await orcaPage.evaluate((id) => {
|
||||
const state = window.__store?.getState()
|
||||
state?.setSettingsSearchQuery('')
|
||||
state?.openSettingsTarget({ pane: 'repo', repoId: id })
|
||||
state?.openSettingsPage()
|
||||
}, repoId)
|
||||
const trustControl = orcaPage.getByRole('radiogroup', { name: 'Agent Folder Trust' })
|
||||
await trustControl.scrollIntoViewIfNeeded()
|
||||
await expect(trustControl.getByRole('radio', { name: 'Let agents ask' })).toHaveAttribute(
|
||||
'aria-checked',
|
||||
'true'
|
||||
)
|
||||
await orcaPage.screenshot({ path: testInfo.outputPath('repo-setting.png') })
|
||||
|
||||
await trustControl.getByRole('radio', { name: 'Trust repository' }).click()
|
||||
await expect.poll(() => readRepoDecision(orcaPage, repoId)).toBe('pre-trust')
|
||||
})
|
||||
@@ -259,12 +259,8 @@ export const test = base.extend<OrcaTestFixtures, OrcaWorkerFixtures>({
|
||||
if (!repo) {
|
||||
return false
|
||||
}
|
||||
// Show external worktrees (hidden by default); pre-answer the first-launch trust prompt.
|
||||
const show = {
|
||||
externalWorktreeVisibility: 'show',
|
||||
agentWorkspaceTrust: 'pre-trust'
|
||||
} as const
|
||||
await store.getState().updateRepo(repo.id, show)
|
||||
// Show the fixture’s external Git worktrees, which newly added repos hide by default.
|
||||
await store.getState().updateRepo(repo.id, { externalWorktreeVisibility: 'show' })
|
||||
return true
|
||||
}, seededRepoId),
|
||||
{
|
||||
|
||||
@@ -245,11 +245,7 @@ export async function attachRepoAndOpenTerminal(page: Page, repoPath: string): P
|
||||
return false
|
||||
}
|
||||
// Show the seeded Git worktree external to Orca’s managed workspace root.
|
||||
await store.getState().updateRepo(repo.id, {
|
||||
externalWorktreeVisibility: 'show',
|
||||
// Restart specs model an existing repo, which keeps pre-trust.
|
||||
agentWorkspaceTrust: 'pre-trust'
|
||||
})
|
||||
await store.getState().updateRepo(repo.id, { externalWorktreeVisibility: 'show' })
|
||||
return true
|
||||
}, repoId)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user