[PR #191] [MERGED] Introduce session concept to the control plane #308

Closed
opened 2026-02-16 01:16:50 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/191
Author: @logan-markewich
Created: 8/16/2024
Status: Merged
Merged: 8/20/2024
Merged by: @logan-markewich

Base: v0.1.0Head: logan/session_state


📝 Commits (5)

📊 Changes

19 files changed (+345 additions, -904 deletions)

View changed files

📝 .pre-commit-config.yaml (+1 -0)
📝 llama_agents/__init__.py (+1 -9)
📝 llama_agents/control_plane/base.py (+91 -24)
📝 llama_agents/control_plane/server.py (+116 -130)
📝 llama_agents/orchestrators/__init__.py (+0 -6)
llama_agents/orchestrators/agent.py (+0 -190)
📝 llama_agents/orchestrators/base.py (+2 -6)
llama_agents/orchestrators/orchestrator_router.py (+0 -109)
llama_agents/orchestrators/pipeline.py (+0 -276)
📝 llama_agents/orchestrators/simple.py (+5 -5)
📝 llama_agents/services/agent.py (+3 -1)
📝 llama_agents/services/component.py (+4 -3)
📝 llama_agents/services/human.py (+3 -1)
📝 llama_agents/services/workflow.py (+5 -5)
📝 llama_agents/types.py (+35 -3)
tests/orchestrators/test_agent_orchestrator.py (+0 -133)
tests/orchestrators/test_simple_orchestrator.py (+75 -0)
📝 tests/services/test_human_service.py (+2 -1)
📝 tests/services/test_workflow_service.py (+2 -2)

📄 Description

This PR turned out to be a decent refactor.

Basically, the idea is to link tasks together in a session, and have the session manage the state rather than the task itself.

The usecase here is the services can be stateful (like a workflow implementation of a react agent), and you need to maintain the state between runs.

So in order to let the service scale, the state is managed externally from the service in the control plane.

The UX here is that the user creates a session, and then can have several back/forths with the service, with the state for those interactions being managed by the session.

A (mostly?) full changelist

  • Removed the state attribute for TaskDefinition
  • Introduced SessionDefinition to hold the state and task ids for that session
  • Introduced NewTask to handle passing state + task to services (since the state is not directly attached to the task now)
  • Refactored the control plane interface to account for sessions
  • Removed the "tools" argument from the orchestrator base class
  • Deleted the old orchestrator classes (We can add these back in another form later if we think they are still helpful)
  • Added and fixed tests

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/191 **Author:** [@logan-markewich](https://github.com/logan-markewich) **Created:** 8/16/2024 **Status:** ✅ Merged **Merged:** 8/20/2024 **Merged by:** [@logan-markewich](https://github.com/logan-markewich) **Base:** `v0.1.0` ← **Head:** `logan/session_state` --- ### 📝 Commits (5) - [`012d12e`](https://github.com/run-llama/llama_deploy/commit/012d12e963fe01b1aec18c1a041dfc92f7a9d642) refactor control plane to account for sessions - [`07285f6`](https://github.com/run-llama/llama_deploy/commit/07285f65521f71926445024ee9f1d3ba69b92487) introduce sessions - [`251f085`](https://github.com/run-llama/llama_deploy/commit/251f08565dd53b79b11ff912a3acbbe99607fbcf) exclude examples from lint (temp) - [`dd4f4b9`](https://github.com/run-llama/llama_deploy/commit/dd4f4b92bbac1b2f0897e64e3033da8a4d10be7e) remove docstring - [`0a969cc`](https://github.com/run-llama/llama_deploy/commit/0a969cc94323298d26a8ec91a1d6cbe2236f48d6) remove print ### 📊 Changes **19 files changed** (+345 additions, -904 deletions) <details> <summary>View changed files</summary> 📝 `.pre-commit-config.yaml` (+1 -0) 📝 `llama_agents/__init__.py` (+1 -9) 📝 `llama_agents/control_plane/base.py` (+91 -24) 📝 `llama_agents/control_plane/server.py` (+116 -130) 📝 `llama_agents/orchestrators/__init__.py` (+0 -6) ➖ `llama_agents/orchestrators/agent.py` (+0 -190) 📝 `llama_agents/orchestrators/base.py` (+2 -6) ➖ `llama_agents/orchestrators/orchestrator_router.py` (+0 -109) ➖ `llama_agents/orchestrators/pipeline.py` (+0 -276) 📝 `llama_agents/orchestrators/simple.py` (+5 -5) 📝 `llama_agents/services/agent.py` (+3 -1) 📝 `llama_agents/services/component.py` (+4 -3) 📝 `llama_agents/services/human.py` (+3 -1) 📝 `llama_agents/services/workflow.py` (+5 -5) 📝 `llama_agents/types.py` (+35 -3) ➖ `tests/orchestrators/test_agent_orchestrator.py` (+0 -133) ➕ `tests/orchestrators/test_simple_orchestrator.py` (+75 -0) 📝 `tests/services/test_human_service.py` (+2 -1) 📝 `tests/services/test_workflow_service.py` (+2 -2) </details> ### 📄 Description This PR turned out to be a decent refactor. Basically, the idea is to link tasks together in a session, and have the session manage the state rather than the task itself. The usecase here is the services can be stateful (like a workflow implementation of a react agent), and you need to maintain the state between runs. So in order to let the service scale, the state is managed externally from the service in the control plane. The UX here is that the user creates a session, and then can have several back/forths with the service, with the state for those interactions being managed by the session. A (mostly?) full changelist - Removed the `state` attribute for `TaskDefinition` - Introduced `SessionDefinition` to hold the state and task ids for that session - Introduced `NewTask` to handle passing state + task to services (since the state is not directly attached to the task now) - Refactored the control plane interface to account for sessions - Removed the "tools" argument from the orchestrator base class - Deleted the old orchestrator classes (We can add these back in another form later if we think they are still helpful) - Added and fixed tests --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:50 -05:00
yindo closed this issue 2026-02-16 01:16:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#308