Skip to content

fix(task): preserve subagent todo permissions#18202

Open
armin1024 wants to merge 1 commit intoanomalyco:devfrom
armin1024:fix/fix-subagent-todo-tools
Open

fix(task): preserve subagent todo permissions#18202
armin1024 wants to merge 1 commit intoanomalyco:devfrom
armin1024:fix/fix-subagent-todo-tools

Conversation

@armin1024
Copy link

@armin1024 armin1024 commented Mar 19, 2026

Issue for this PR

Closes #12938

Type of change

  • Bug fix

What does this PR do?

Fixes a subagent permissions bug where todowrite / todoread became unavailable
inside child sessions created through task, even when the subagent explicitly
allowed them.

Root cause:

  • TaskTool passed todowrite: false and todoread: false into SessionPrompt.prompt()
  • those overrides were persisted into the child session permission set
  • todoread was also missing from ToolRegistry

Changes:

  • stop hard-disabling todowrite / todoread in packages/opencode/src/tool/task.ts
  • register TodoReadTool in packages/opencode/src/tool/registry.ts
  • add regression coverage for both cases

How did you verify your code works?

  • added a regression test for subagent todo permissions through task
  • added a registry test to verify todoread is registered
  • ran the targeted tests locally
  • ran typecheck for packages/opencode

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 19, 2026
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

I found one potentially related PR that may be addressing a similar issue:

Related PR:

The current PR (18202) appears to be fixing a specific regression where todowrite/todoread permissions were being clobbered by overrides in TaskTool's SessionPrompt.prompt() call. While PR #12584 is about propagating parent permissions, it's addressing the same general area of subagent permission handling, so it's worth checking if they're addressing related root causes.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 19, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subagents can't use 'todowrite' tool

1 participant