Skip to content

fix: only require TodoWrite when it is actually available#19057

Open
Haohao-end wants to merge 1 commit intoanomalyco:devfrom
Haohao-end:fix/18061-todowrite-availability-v2
Open

fix: only require TodoWrite when it is actually available#19057
Haohao-end wants to merge 1 commit intoanomalyco:devfrom
Haohao-end:fix/18061-todowrite-availability-v2

Conversation

@Haohao-end
Copy link
Copy Markdown

@Haohao-end Haohao-end commented Mar 25, 2026

Issue for this PR

Closes #18061

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This fixes a prompt/tooling mismatch around TodoWrite.

Before this change, the provider prompt could still tell the model to use TodoWrite even when todowrite was not actually available.

This change makes TodoWrite-specific prompt instructions conditional on the resolved tool set, so they are only included when todowrite is available.

This should work because the prompt now matches the tools the model can actually use.

How did you verify your code works?

I ran:

  • bun test test/session/system.test.ts from packages/opencode

I also checked:

  • git diff --check

Screenshots / recordings

N/A

Checklist

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

@github-actions
Copy link
Copy Markdown
Contributor

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

Based on my search, I found one potentially related PR:

PR #18202 - "fix(task): preserve subagent todo permissions"

The current PR (19057) appears to be addressing a newer/refined version of this issue, closing #18061, but PR #18202 is worth reviewing to ensure there's no overlap or conflict.

@Haohao-end Haohao-end force-pushed the fix/18061-todowrite-availability-v2 branch from ac6efa7 to dc14a84 Compare March 25, 2026 05:05
@Haohao-end
Copy link
Copy Markdown
Author

Scoped to #18061 only.

This PR only changes provider prompt generation so TodoWrite instructions are included only when todowrite is actually in the resolved tool set.

I intentionally dropped the subagent permission changes from this branch because that area overlaps with #18202.

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.

Agents confuses about the TodoWrite tools usage since the developer instruction prohibit this tool

1 participant