mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 08:21:50 +00:00
fix(opencode): preserve external_dir and deny parent permissions in task child sessions (#23290)
This commit is contained in:
parent
c49bf0b402
commit
d7701dbfb6
1 changed files with 4 additions and 0 deletions
|
|
@ -64,12 +64,16 @@ export const TaskTool = Tool.define(
|
|||
const session = taskID
|
||||
? yield* sessions.get(SessionID.make(taskID)).pipe(Effect.catchCause(() => Effect.succeed(undefined)))
|
||||
: undefined
|
||||
const parent = yield* sessions.get(ctx.sessionID)
|
||||
const nextSession =
|
||||
session ??
|
||||
(yield* sessions.create({
|
||||
parentID: ctx.sessionID,
|
||||
title: params.description + ` (@${next.name} subagent)`,
|
||||
permission: [
|
||||
...(parent.permission ?? []).filter(
|
||||
(rule) => rule.permission === "external_directory" || rule.action === "deny",
|
||||
),
|
||||
...(canTodo
|
||||
? []
|
||||
: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue