feat: team model and deployment improvements#918
Conversation
… writes, and blobs.
There was a problem hiding this comment.
Pull request overview
This is a comprehensive pull request that introduces team collaboration features, improves checkpoint management, enhances testing capabilities, and fixes several bugs. The PR updates numerous dependencies and makes organizational changes by moving the checker functionality into the core module.
Key Changes:
- Introduces team model for multi-user collaboration with team ownership for agents
- Adds checkpoint cleanup functionality to manage LangGraph database size
- Adds Ollama provider support for local LLM execution
- Fixes critical bugs in string concatenation and message streaming
- Disables autonomous, telegram, and checker deployments in testnet-dev environment
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Updates multiple dependencies including anthropic (0.73.0→0.75.0), asyncpg (0.30.0→0.31.0), boto3, fastapi, langchain packages, numpy, and various other libraries |
pyproject.toml |
Adds langchain-ollama>=0.2.0 to dev dependencies |
intentkit/models/team.py |
New file introducing Team, TeamMember, and TeamRole models with database tables for multi-user team collaboration |
intentkit/models/agent.py |
Adds optional team_id field to AgentTable and AgentCreate models |
intentkit/models/draft.py |
Adds team_id field to AgentDraftTable |
intentkit/models/credit.py |
Adds TEAM owner type to OwnerType enum and team_id field to CreditEventTable |
intentkit/models/llm.py |
Adds OLLAMA provider support with OllamaLLM class for local model execution |
intentkit/models/db.py |
Adds cleanup_checkpoints() function and assertion checks for initialized engine |
intentkit/core/engine.py |
Fixes streaming bugs, improves tuple unpacking, and adds better attribute checking with getattr |
intentkit/core/middleware.py |
Fixes string concatenation bug in error message |
intentkit/core/scheduler.py |
Moves account checking jobs from separate checker to core scheduler, adds checkpoint cleanup job |
intentkit/abstracts/graph.py |
Changes AgentState import from langgraph.prebuilt to langchain.agents |
tests/core/test_agent_local.py |
New comprehensive tests for local agent execution with tool calling |
scripts/cleanup_checkpoints.py |
New script for batch checkpoint cleanup with progress tracking |
scripts/inspect_checkpoints.py |
New utility script to inspect checkpoint database statistics |
app/checker.py |
Deleted - functionality moved to core scheduler |
.github/workflows/build.yml |
Disables autonomous, telegram, and checker deployments in testnet-dev |
Comments suppressed due to low confidence (7)
intentkit/core/middleware.py:54
- The string concatenation is incomplete. This creates a string literal
"Found AIMessages with tool_calls that do not have a corresponding ToolMessage. "without including the f-string that follows it. The fix correctly combines them into a single string expression.
intentkit/models/credit.py:491 - Variable amount_left is not used.
amount_left = Decimal("0")
intentkit/models/credit.py:500
- Variable amount_left is not used.
amount_left = Decimal("0")
intentkit/core/engine.py:540
- Variable last is not used.
last = this_time
intentkit/core/engine.py:788
- Variable last is not used.
last = this_time
intentkit/models/agent.py:739
- This import of module re is redundant, as it was previously imported on line 6.
import re
app/services/discord/bot/pool.py:130
- 'except' clause does nothing but pass and there is no explanatory comment.
except asyncio.CancelledError:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from typing import Any, NotRequired | ||
|
|
||
| from langgraph.prebuilt.chat_agent_executor import AgentState as BaseAgentState | ||
| from langchain.agents import AgentState as BaseAgentState |
There was a problem hiding this comment.
The import path for AgentState has changed from langgraph.prebuilt.chat_agent_executor to langchain.agents. Please verify that this import path is correct and that the AgentState class in langchain.agents has the same interface and behavior as expected. This could be a breaking change if the classes are not compatible.
|
|
||
| model_config = ConfigDict( | ||
| from_attributes=True, | ||
| json_encoders={datetime: lambda v: v.isoformat(timespec="milliseconds")}, |
There was a problem hiding this comment.
This method requires 1 positional argument, whereas overridden TeamCreate.lambda requires 0.
This PR includes several improvements: