-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip(agents-api): Add session sql queries #970
Conversation
Signed-off-by: Diwank Singh Tomer <[email protected]>
CI Failure Feedback 🧐(Checks updated until commit 619f973)
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
where Configuration options
See more information about the |
Signed-off-by: Diwank Singh Tomer <[email protected]>
Signed-off-by: Diwank Singh Tomer <[email protected]>
feat(agents-api): Add entry queries
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
14144715 | Triggered | Generic Password | c85c2fe | memory-store/docker-compose.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Signed-off-by: Diwank Singh Tomer <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me! Reviewed everything up to 619f973 in 1 minute and 34 seconds
More details
- Looked at
4858
lines of code in58
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. agents-api/agents_api/app.py:10
- Draft comment:
Consider usinggetattr
to safely accessapp.state.postgres_pool
to avoid potentialAttributeError
if the attribute is not initialized.
if not getattr(app.state, 'postgres_pool', None):
- Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
FastAPI's state object is designed for storing arbitrary state and is initialized by default. The .state attribute always exists and is safe to access. The current code's null check is checking if the pool exists, not if the attribute exists. Using getattr() wouldn't provide additional safety since AttributeError isn't actually a risk here.
Maybe I'm wrong about FastAPI's state behavior. Maybe there are edge cases where state isn't initialized.
FastAPI's documentation and source code confirm that state is always initialized as a simple object. The current code's intention is clearly to check for the pool's existence, not handle attribute errors.
The comment should be deleted as it suggests a change that doesn't provide real value and misunderstands the purpose of the null check.
2. agents-api/agents_api/queries/agents/create_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Thecreate_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
3. agents-api/agents_api/queries/agents/create_or_update_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Thecreate_or_update_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
4. agents-api/agents_api/queries/agents/delete_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Thedelete_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
5. agents-api/agents_api/queries/agents/get_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Theget_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
6. agents-api/agents_api/queries/agents/list_agents.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Thelist_agents.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
7. agents-api/agents_api/queries/agents/patch_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Thepatch_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
8. agents-api/agents_api/queries/agents/update_agent.py:15
- Draft comment:
The variableagent_query
is defined but not used. Consider removing it to clean up the code. - Reason this comment was not posted:
Confidence changes required:50%
Theupdate_agent.py
file has a variableagent_query
that is defined but not used. This might be a leftover from refactoring and should be removed to clean up the code.
Workflow ID: wflow_kEmSVhruL4I4QDhV
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Signed-off-by: Diwank Singh Tomer [email protected]
PR Type
Enhancement, Tests
Description
system_template
andforward_tool_calls
Changes walkthrough 📝
20 files
Sessions.py
Add system template and tool call forwarding to session models
agents-api/agents_api/autogen/Sessions.py
system_template
field to session-related modelsforward_tool_calls
boolean field to control tool call forwardingutils.py
Add PostgreSQL query utilities and type definitions
agents-api/agents_api/queries/utils.py
create_entries.py
Add PostgreSQL entry creation queries
agents-api/agents_api/queries/entries/create_entries.py
delete_entries.py
Add PostgreSQL entry deletion queries
agents-api/agents_api/queries/entries/delete_entries.py
create_or_update_session.py
Add PostgreSQL session upsert queries
agents-api/agents_api/queries/sessions/create_or_update_session.py
create_session.py
Add PostgreSQL session creation queries
agents-api/agents_api/queries/sessions/create_session.py
Sessions.py
Update session models in integrations service
integrations-service/integrations/autogen/Sessions.py
system_template
field to session modelsforward_tool_calls
boolean fieldlist_sessions.py
Add PostgreSQL session listing queries
agents-api/agents_api/queries/sessions/list_sessions.py
list_entries.py
Add PostgreSQL entry listing queries
agents-api/agents_api/queries/entries/list_entries.py
get_session.py
Add PostgreSQL session retrieval queries
agents-api/agents_api/queries/sessions/get_session.py
patch_session.py
Add PostgreSQL session patch queries
agents-api/agents_api/queries/sessions/patch_session.py
delete_session.py
Add PostgreSQL session deletion queries
agents-api/agents_api/queries/sessions/delete_session.py
count_sessions.py
Add PostgreSQL session counting queries
agents-api/agents_api/queries/sessions/count_sessions.py
__init__.py
Initialize session queries module
agents-api/agents_api/queries/sessions/init.py
app.py
Improve database connection pool handling
agents-api/agents_api/app.py
__init__.py
Create new entries query module
agents-api/agents_api/queries/entries/init.py
Entries.py
Add model field to BaseEntry class
agents-api/agents_api/autogen/Entries.py
model
field to BaseEntry with default value "gpt-4o-mini"000015_entries.up.sql
Enhance entries table schema and triggers
memory-store/migrations/000015_entries.up.sql
000016_entry_relations.up.sql
Improve entry relations leaf node handling
memory-store/migrations/000016_entry_relations.up.sql
models.tsp
Add system template and tool call forwarding to Session
typespec/sessions/models.tsp
system_template
field to Session modelforward_tool_calls
boolean field3 files
test_session_queries.py
Migrate session tests from CozoDB to PostgreSQL
tests/test_session_queries.py
test_entry_queries.py
Migrate entry tests from CozoDB to PostgreSQL
tests/test_entry_queries.py
fixtures.py
Update test fixtures for PostgreSQL database
agents-api/tests/fixtures.py
2 files
__init__.py
Add explicit exports for developer queries
agents-api/agents_api/queries/developers/init.py
__init__.py
Add explicit exports for agent queries
agents-api/agents_api/queries/agents/init.py
1 files
env.py
Add query timeout environment configuration
agents-api/agents_api/env.py
query_timeout
configuration with default value of 90.0