-
Notifications
You must be signed in to change notification settings - Fork 928
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
F/file queries: Add file sql queries #974
Conversation
Signed-off-by: Diwank Singh Tomer <[email protected]>
fix(memory-store): Change association structure of files and docs
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 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. |
CI Failure Feedback 🧐(Checks updated until commit 41739ee)
✨ 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 |
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.
❌ Changes requested. Reviewed everything up to cc2a5bf in 1 minute and 55 seconds
More details
- Looked at
5776
lines of code in67
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. agents-api/agents_api/queries/utils.py:111
- Draft comment:
asyncpg.NoDataFoundError
is not a standard exception in asyncpg. Ensure this exception is defined elsewhere in the codebase or replace it with a standard exception. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is technically correct that NoDataFoundError is not standard. However, this appears to be an intentional custom exception used to handle the specific case of no data being found in fetchrow queries. The code is consistently using this exception and handling it appropriately. The comment suggests replacing it but that would actually make the code worse by removing the semantic meaning.
I could be wrong about whether this is an intentional design choice - maybe it's actually a bug where they meant to use a different exception.
Even if they meant to use a different exception, suggesting to "ensure it's defined elsewhere" or "replace with standard exception" is not helpful - they clearly want some kind of "no data found" exception here for this specific case.
The comment should be deleted. The code is intentionally using a custom exception for semantic clarity, and the comment's suggestions would make the code worse.
2. agents-api/agents_api/queries/entries/create_entries.py:85
- Draft comment:
Therewrap_exceptions
decorator is commented out here. Ensure consistency in exception handling across the codebase to avoid unhandled exceptions. - Reason this comment was not posted:
Comment did not seem useful.
3. agents-api/agents_api/queries/agents/delete_agent.py:76
- Draft comment:
Theincrease_counter
decorator is removed. If metrics collection is intended, ensure this is added back or replaced with an alternative solution. - Reason this comment was not posted:
Comment did not seem useful.
4. agents-api/agents_api/queries/utils.py:75
- Draft comment:
Thematch-case
statement is a Python 3.10 feature. Ensure the project supports Python 3.10 or later, or refactor for compatibility with older versions. - Reason this comment was not posted:
Confidence changes required:50%
Theprepare_pg_query_args
function uses a match-case statement which is a Python 3.10 feature. Ensure compatibility if the project supports older Python versions.
Workflow ID: wflow_P1ix6oN8CQ1bdkDY
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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! Incremental review on c88e8d7 in 56 seconds
More details
- Looked at
269
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_hzpvy7u9Zhv0IDRE
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
PR Type
Enhancement, Tests
Description
Changes walkthrough 📝
47 files
Sessions.py
Add system template and tool call forwarding to session models
agents-api/agents_api/autogen/Sessions.py
prompts
utils.py
Improve SQL query utilities with type safety and batching
agents-api/agents_api/queries/utils.py
create_session.py
Add session creation with system template and participant lookup
agents-api/agents_api/queries/sessions/create_session.py
create_or_update_session.py
Add session upsert with system template support
agents-api/agents_api/queries/sessions/create_or_update_session.py
update_session.py
Add session update with system template support
agents-api/agents_api/queries/sessions/update_session.py
patch_session.py
Add session patch functionality with metadata merging
agents-api/agents_api/queries/sessions/patch_session.py
get_session.py
Add session retrieval with system template support
agents-api/agents_api/queries/sessions/get_session.py
list_sessions.py
Add paginated session listing with filtering
agents-api/agents_api/queries/sessions/list_sessions.py
create_file.py
Add file creation with ownership tracking
agents-api/agents_api/queries/files/create_file.py
get_file.py
Add file retrieval with ownership validation
agents-api/agents_api/queries/files/get_file.py
list_files.py
Add file listing with ownership filtering
agents-api/agents_api/queries/files/list_files.py
delete_file.py
Add file deletion with ownership cleanup
agents-api/agents_api/queries/files/delete_file.py
create_entries.py
Add entry creation with relations support
agents-api/agents_api/queries/entries/create_entries.py
delete_entries.py
Add entry deletion with relations cleanup
agents-api/agents_api/queries/entries/delete_entries.py
list_entries.py
Add entry listing with filtering options
agents-api/agents_api/queries/entries/list_entries.py
get_agent.py
Refactor agent query and remove unused code
agents-api/agents_api/queries/agents/get_agent.py
get_history.py
Add new entry history retrieval functionality
agents-api/agents_api/queries/entries/get_history.py
create_developer.py
Enhance developer creation with error handling
agents-api/agents_api/queries/developers/create_developer.py
get_user.py
Improve user query with better error handling
agents-api/agents_api/queries/users/get_user.py
delete_session.py
Add session deletion functionality
agents-api/agents_api/queries/sessions/delete_session.py
list_agents.py
Clean up agent listing query implementation
agents-api/agents_api/queries/agents/list_agents.py
get_developer.py
Improve developer query with better error handling
agents-api/agents_api/queries/developers/get_developer.py
patch_developer.py
Enhance developer patch functionality
agents-api/agents_api/queries/developers/patch_developer.py
update_user.py
Improve user update with better error handling
agents-api/agents_api/queries/users/update_user.py
update_developer.py
Enhance developer update with error handling
agents-api/agents_api/queries/developers/update_developer.py
patch_agent.py
Clean up agent patch query implementation
agents-api/agents_api/queries/agents/patch_agent.py
update_agent.py
Clean up agent update query implementation
agents-api/agents_api/queries/agents/update_agent.py
create_or_update_agent.py
Clean up agent create/update implementation
agents-api/agents_api/queries/agents/create_or_update_agent.py
count_sessions.py
Add session counting functionality
agents-api/agents_api/queries/sessions/count_sessions.py
__init__.py
Add sessions query module initialization
agents-api/agents_api/queries/sessions/init.py
app.py
Improve database connection handling
agents-api/agents_api/app.py
__init__.py
Add explicit exports to developers module
agents-api/agents_api/queries/developers/init.py
__init__.py
Add explicit exports to agents module
agents-api/agents_api/queries/agents/init.py
__init__.py
Add entries query module initialization
agents-api/agents_api/queries/entries/init.py
__init__.py
Add files query module initialization
agents-api/agents_api/queries/files/init.py
Entries.py
Add model field to entry definition
agents-api/agents_api/autogen/Entries.py
openapi_model.py
Update model input handling
agents-api/agents_api/autogen/openapi_model.py
Entries.py
Add model field to entry definition
integrations-service/integrations/autogen/Entries.py
openapi-1.0.0.yaml
Update OpenAPI schema with new fields
typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml
000006_docs.up.sql
Refactor document ownership schema
memory-store/migrations/000006_docs.up.sql
doc_owners table
000005_files.up.sql
Refactor file ownership schema
memory-store/migrations/000005_files.up.sql
file_owners table
000006_docs.down.sql
Update docs schema down migration
memory-store/migrations/000006_docs.down.sql
000015_entries.up.sql
Enhance entries schema with new features
memory-store/migrations/000015_entries.up.sql
models.tsp
Add new session model fields
typespec/sessions/models.tsp
000005_files.down.sql
Update files schema down migration
memory-store/migrations/000005_files.down.sql
000009_sessions.up.sql
Add updated_at field to sessions
memory-store/migrations/000009_sessions.up.sql
models.tsp
Add model field to entry type spec
typespec/entries/models.tsp
5 files
test_entry_queries.py
Update entry tests for PostgreSQL migration
agents-api/tests/test_entry_queries.py
test_session_queries.py
Add comprehensive session query tests
agents-api/tests/test_session_queries.py
test_files_queries.py
Add file management test suite
agents-api/tests/test_files_queries.py
fixtures.py
Update test fixtures for PostgreSQL support
agents-api/tests/fixtures.py
test_agent_queries.py
Improve agent deletion test coverage
agents-api/tests/test_agent_queries.py
1 files
web.py
Remove unused FastAPI import
agents-api/agents_api/web.py
1 files
env.py
Add database query timeout configuration
agents-api/agents_api/env.py
Important
Add comprehensive file management system with SQL queries, ownership tracking, and extensive test coverage.
create_file.py
), retrieval (get_file.py
), listing (list_files.py
), and deletion (delete_file.py
) with ownership tracking.file_owners
table for unified ownership management in000005_files.up.sql
.file_owners
anddoc_owners
tables in000005_files.up.sql
and000006_docs.up.sql
.test_files_queries.py
.fixtures.py
to support new file management features.This description was created by
for c88e8d7. It will automatically update as commits are pushed.