Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Python: Core: rename TodoListContextProvider to TodoProvider
Match the .NET TodoProvider class name for cross-language consistency.
Other public types (TodoStore, TodoSessionStore, TodoFileStore,
TodoItem, TodoInput) are unchanged. Construction stays Pythonic
(kwargs, not an options object).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
eavanvalkenburg and Copilot committed May 5, 2026
commit 751db405fc1ed18bd3ab17b16300ac3d618ba2d1
4 changes: 2 additions & 2 deletions python/packages/core/agent_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
TodoFileStore,
TodoInput,
TodoItem,
TodoListContextProvider,
TodoProvider,
TodoSessionStore,
TodoStore,
)
Expand Down Expand Up @@ -423,7 +423,7 @@
"TodoFileStore",
"TodoInput",
"TodoItem",
"TodoListContextProvider",
"TodoProvider",
"TodoSessionStore",
"TodoStore",
"TokenBudgetComposedStrategy",
Expand Down
11 changes: 5 additions & 6 deletions python/packages/core/agent_framework/_harness/_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,13 @@ def save_state(self, session: AgentSession, items: list[TodoItem], *, next_id: i


@experimental(feature_id=ExperimentalFeature.HARNESS)
class TodoListContextProvider(ContextProvider):
class TodoProvider(ContextProvider):
"""Provide todo management tools and instructions to an agent.

The ``TodoListContextProvider`` enables agents to create, complete, remove, and query todo items as part of
their planning and execution workflow. Todo state is stored in the configured ``TodoStore`` and persists across
agent invocations within the same session. By default, state is stored in ``AgentSession.state`` with
``TodoSessionStore``; callers can provide ``TodoFileStore`` or another store implementation for file-backed or
custom persistence.
The ``TodoProvider`` enables agents to create, complete, remove, and query todo items as part of their planning
and execution workflow. Todo state is stored in the configured ``TodoStore`` and persists across agent invocations
within the same session. By default, state is stored in ``AgentSession.state`` with ``TodoSessionStore``; callers
can provide ``TodoFileStore`` or another store implementation for file-backed or custom persistence.

This provider exposes the following tools to the agent:
- ``add_todos``: Add one or more todo items, each with a title and optional description.
Expand Down
14 changes: 7 additions & 7 deletions python/packages/core/tests/core/test_harness_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
TodoFileStore,
TodoInput,
TodoItem,
TodoListContextProvider,
TodoProvider,
TodoSessionStore,
TodoStore,
)
Expand Down Expand Up @@ -153,12 +153,12 @@ def test_todo_file_store_rejects_session_path_traversal(tmp_path: Path) -> None:
assert list(tmp_path.rglob("*")) == []


async def test_todo_context_provider_tools_manage_session_state(
async def test_todo_provider_tools_manage_session_state(
chat_client_base: SupportsChatGetResponse,
) -> None:
"""Todo provider tools should add, complete, remove, and list session-backed todos."""
session = AgentSession(session_id="session-1")
provider = TodoListContextProvider()
provider = TodoProvider()
agent = Agent(client=chat_client_base, context_providers=[provider])

_, options = await agent._prepare_session_and_messages( # type: ignore[reportPrivateUsage]
Expand Down Expand Up @@ -204,12 +204,12 @@ async def test_todo_context_provider_tools_manage_session_state(
]


async def test_todo_context_provider_serializes_concurrent_mutations(
async def test_todo_provider_serializes_concurrent_mutations(
chat_client_base: SupportsChatGetResponse,
) -> None:
"""Concurrent todo mutations should not duplicate IDs or lose updates."""
session = AgentSession(session_id="session-1")
provider = TodoListContextProvider()
provider = TodoProvider()
agent = Agent(client=chat_client_base, context_providers=[provider])

_, options = await agent._prepare_session_and_messages( # type: ignore[reportPrivateUsage]
Expand Down Expand Up @@ -258,5 +258,5 @@ def test_todo_harness_classes_are_marked_experimental() -> None:
assert TodoInput.__feature_id__ == ExperimentalFeature.HARNESS.value
assert TodoSessionStore.__feature_id__ == ExperimentalFeature.HARNESS.value
assert TodoFileStore.__feature_id__ == ExperimentalFeature.HARNESS.value
assert TodoListContextProvider.__feature_id__ == ExperimentalFeature.HARNESS.value
assert ".. warning:: Experimental" in TodoListContextProvider.__doc__
assert TodoProvider.__feature_id__ == ExperimentalFeature.HARNESS.value
assert ".. warning:: Experimental" in TodoProvider.__doc__