Skip to content

fix(tool): let TaskList and TaskGet report read-only so explore mode allows them - #3579

Open
konlue wants to merge 1 commit into
agentscope-ai:mainfrom
konlue:fix/task-tools-read-only
Open

konlue wants to merge 1 commit into
agentscope-ai:mainfrom
konlue:fix/task-tools-read-only

Conversation

@konlue

@konlue konlue commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #3567.

AgentScope Version

2.0.12dev (main @ 2f8c029)

Description

TaskList and TaskGet only read the task list, but they inherit is_read_only: bool = False from _TaskToolBase (src/agentscope/tool/_task/_task_tool_base.py:23). EXPLORE (plan) mode decides entirely through check_read_only (src/agentscope/permission/_engine.py:683), so both tools fall through to the deny fallback — while the toolkit keeps advertising them as planning tools ("Planning tools — always on.", app/_service/_toolkit.py:142) and the agent prompts the model to call them ("Use TaskList to view them...", agent/_agent.py:1548-1553). Net effect: in plan mode the agent is told to use tools it is not allowed to call. #3567 has the details and a no-network repro.

Changes — declare is_read_only: bool = True on TaskList and TaskGet, matching how Read and SkillViewer already mark themselves (_builtin/_read.py:126, _builtin/_skill.py:54). The base class default stays False since TaskCreate / TaskUpdate mutate state.

tool EXPLORE before EXPLORE after
TaskList denied allowed
TaskGet denied allowed
TaskCreate denied unchanged (denied)
TaskUpdate denied unchanged (denied)

How to test

Regression cases added to the existing tests/permission_mode_test.py (EXPLORE suite):

  • test_explore_task_readers_allow — fails on main (<PermissionBehavior.DENY> != <PermissionBehavior.ALLOW> : TaskList should be allowed in EXPLORE), passes with this fix;
  • test_explore_task_writers_deny — pins that TaskCreate / TaskUpdate stay denied, guarding against overcorrecting.
python -m pytest tests/permission_mode_test.py tests/permission_engine_test.py tests/task_tool_test.py tests/toolkit_task_test.py
# 75 passed.

Checklist

  • An issue has been created for this PR
  • I have read the CONTRIBUTING.md
  • Docstrings are in Google style
  • Related documentation has been updated (e.g. links, examples, etc.) in documentation repository
  • Code is ready for review

This branch has not been deployed

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

Labels

pr/awaiting-review Waiting for maintainers to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TaskList and TaskGet are denied in EXPLORE (plan) mode although they only read state

1 participant