mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
fix(devin): migrate existing workspace trust defaults
This commit is contained in:
@@ -12,4 +12,17 @@ describe('migrateAgentYoloDefaults', () => {
|
||||
expect(migrated.agentDefaultArgs?.droid).toBe('')
|
||||
expect(migrated.agentDefaultEnv?.goose).toEqual({})
|
||||
})
|
||||
|
||||
it('updates the previous Devin default for existing profiles', () => {
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: This test only supplies the settings fields consumed by this migration.
|
||||
const migrated = migrateAgentYoloDefaults({
|
||||
agentYoloDefaultsMigrated: true,
|
||||
agentDefaultArgs: { devin: '--permission-mode bypass' },
|
||||
agentDefaultEnv: {}
|
||||
} as never)
|
||||
|
||||
expect(migrated.agentDefaultArgs?.devin).toBe(
|
||||
'--permission-mode bypass --respect-workspace-trust false'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -126,6 +126,9 @@ export function migrateAgentYoloDefaults(
|
||||
): Pick<GlobalSettings, 'agentDefaultArgs' | 'agentDefaultEnv' | 'agentYoloDefaultsMigrated'> {
|
||||
const existingArgs = normalizeTuiAgentArgsRecord(settings?.agentDefaultArgs)
|
||||
const existingEnv = normalizeTuiAgentEnvRecord(settings?.agentDefaultEnv)
|
||||
if (existingArgs.devin === '--permission-mode bypass') {
|
||||
existingArgs.devin = DEFAULT_TUI_AGENT_ARGS.devin
|
||||
}
|
||||
if (settings?.agentYoloDefaultsMigrated === true) {
|
||||
// Keep newly added agents manual for profiles migrated by an older build.
|
||||
// Missing keys otherwise fall through to the current (possibly yolo) defaults.
|
||||
|
||||
@@ -252,12 +252,12 @@ describe('buildAgentStartupPlan', () => {
|
||||
})
|
||||
).toEqual({
|
||||
agent: 'devin',
|
||||
launchCommand: "devin '--permission-mode' 'bypass'",
|
||||
launchCommand: "devin '--permission-mode' 'bypass' '--respect-workspace-trust' 'false'",
|
||||
expectedProcess: 'devin',
|
||||
followupPrompt: 'Trace the failing test',
|
||||
launchConfig: {
|
||||
agentCommand: "devin '--permission-mode' 'bypass'",
|
||||
agentArgs: '--permission-mode bypass',
|
||||
agentCommand: "devin '--permission-mode' 'bypass' '--respect-workspace-trust' 'false'",
|
||||
agentArgs: '--permission-mode bypass --respect-workspace-trust false',
|
||||
agentEnv: {}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user