fix(opencode): preserve safe parent permissions in task child sessions#23290
fix(opencode): preserve safe parent permissions in task child sessions#23290remorses wants to merge 1 commit intoanomalyco:devfrom
Conversation
Carry forward only transitive-safe session rules when `task` creates a child session. This keeps parent `external_directory` approvals and deny rules so subagents stop re-prompting for trusted paths, while avoiding broad allow-rule inheritance that could accidentally grant write access to restrictive agents like `explore`. Verification: - bunx prettier --write packages/opencode/src/tool/task.ts packages/opencode/test/tool/task.test.ts - bun test --timeout 30000 test/tool/task.test.ts - bun typecheck Session: ses_25fac94daffeLwJ8p3cQRCI5pF
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found related PRs that address similar permission and restriction preservation issues in task child sessions: Related PRs:
These PRs are related to the same codebase area (task tool, permissions, subagent sessions) but don't appear to be direct duplicates of PR #23290. Your PR is specifically addressing the narrow issue of preserving only safe parent permissions (external_directory and deny rules) when task creates child sessions. |
Issue for this PR
Closes #20549
Type of change
What does this PR do?
When
taskcreates a child session, it now carries over only the parent session'sexternal_directoryrules and deny rules.That fixes repeated prompts for trusted external paths while avoiding broad allow-rule inheritance that could make restrictive subagents like
explorewritable.How did you verify your code works?
bunx prettier --write packages/opencode/src/tool/task.ts packages/opencode/test/tool/task.test.tsbun test --timeout 30000 test/tool/task.test.tsbun typecheckScreenshots / recordings
Not applicable.
Checklist