fix(opencode): preserve external_dir and deny parent permissions in task child sessions (#23290)
This commit is contained in:
@@ -64,12 +64,16 @@ export const TaskTool = Tool.define(
|
|||||||
const session = taskID
|
const session = taskID
|
||||||
? yield* sessions.get(SessionID.make(taskID)).pipe(Effect.catchCause(() => Effect.succeed(undefined)))
|
? yield* sessions.get(SessionID.make(taskID)).pipe(Effect.catchCause(() => Effect.succeed(undefined)))
|
||||||
: undefined
|
: undefined
|
||||||
|
const parent = yield* sessions.get(ctx.sessionID)
|
||||||
const nextSession =
|
const nextSession =
|
||||||
session ??
|
session ??
|
||||||
(yield* sessions.create({
|
(yield* sessions.create({
|
||||||
parentID: ctx.sessionID,
|
parentID: ctx.sessionID,
|
||||||
title: params.description + ` (@${next.name} subagent)`,
|
title: params.description + ` (@${next.name} subagent)`,
|
||||||
permission: [
|
permission: [
|
||||||
|
...(parent.permission ?? []).filter(
|
||||||
|
(rule) => rule.permission === "external_directory" || rule.action === "deny",
|
||||||
|
),
|
||||||
...(canTodo
|
...(canTodo
|
||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
|
|||||||
Reference in New Issue
Block a user