-
Notifications
You must be signed in to change notification settings - Fork 2
Chore/refactor storage #203
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
Conversation
- Create storage types module (Session, Message, ToolCall) - Define AgentStorage trait with async storage operations - Create StorageError enum with thiserror - Refactor codebase_analysis agent to use AgentStorage trait - Refactor sqlite_reader agent to use AgentStorage trait - Refactor requirements_gathering agent with separate RequirementsStorage trait - Create InMemoryStorage implementation for testing - Add thiserror and uuid dependencies - Update lib.rs to export storage and types modules - Make agents generic over storage type - Add progress tracking documentation This allows consuming applications to provide custom storage implementations (PostgreSQL, files, etc.) instead of being tied to SQLite. Ref: refactor-storage-to-trait-based-interface.md
Complete the storage abstraction refactoring by updating all remaining agents to use the AgentStorage trait instead of concrete Database implementation. Changes: - Refactored SettingsManagementAgent to use AgentStorage trait - Refactored StructuredJsonAgent to use AgentStorage trait - Refactored TesseractAgent to use AgentStorage trait - Refactored ImapEmailAgent to use AgentStorage trait - Updated factory.rs to accept storage parameters and use InMemoryStorage - Removed rusqlite and refinery dependencies from Cargo.toml - Removed database module export from lib.rs - Implemented RequirementsStorage trait for InMemoryStorage - Made requirements_gathering storage module public All agents now use async trait-based storage, enabling consumers to implement their own storage backends (PostgreSQL, files, memory, etc.) without coupling to SQLite. Related to previous commit: refactor trait-based storage abstraction Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Refactor PdfToTextAgent to use AgentStorage trait (like TesseractAgent) - Remove old database extension modules (requirements_gathering/database.rs, settings_management/database.rs) - Update all 6 binary runners to use InMemoryStorage - Add RequirementsStorage bound to AgentFactory for UserClarificationAgent - Fix borrow issues in InMemoryStorage (clone session_id before use) All agents now use the storage trait abstraction instead of direct Database. Binary runners use in-memory storage with proper session creation via Session struct.
…rmance Completes the storage refactoring by switching all identifier types from String to i64 across both nocodo-agents library and nocodo-api application. This change eliminates runtime string parsing overhead and improves type safety. Changes in nocodo-agents: - Update AgentStorage trait to use i64 for all ID types - Update Session, Message, ToolCall types to use i64 for IDs - Update RequirementsStorage trait to use i64 - Replace UUID-based InMemoryStorage with atomic i64 counter - Update all 8 agent implementations to use i64 internally - Update all 6 binary runners to use i64 directly Changes in nocodo-api: - Implement SqliteAgentStorage with i64 native support - Add storage module with migrations - Update all 8 agent execution handlers to use i64 - Update sessions and requirements handling for i64 - Fix DirectRequirementsStorage implementation - Remove 150+ string conversion calls across codebase Benefits: - Zero runtime parsing overhead - Type-safe ID handling throughout - Simpler, cleaner code - Direct SQLite INTEGER ↔ i64 mapping Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add optional "sqlite" feature flag to both nocodo-tools and nocodo-agents to resolve rusqlite conflicts when integrating with PostgreSQL projects. Changes: - Make rusqlite and sqlparser optional dependencies in nocodo-tools - Add sqlite feature flag that conditionally compiles sqlite_reader and hackernews modules - Make SqliteReaderAgent and related code conditional on sqlite feature in nocodo-agents - Require sqlite feature for sqlite-reader-runner binary - Update tool schemas and executor to handle conditional sqlite support By default, neither crate pulls in rusqlite. Enable with features = ["sqlite"]. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📊 Code Complexity Analysis
💡 Suggestion: This is a large PR with 4340 added lines. Consider:
Automated analysis by GitHub Actions |
🤖 Automated Code Review SummaryThis automated review was generated to help ensure code quality and security standards. Rust Code Analysis
Security Analysis
Recommendations
This review was automatically generated. Please address any issues before merging. |
Deploying nocodo with
|
| Latest commit: |
f0b1666
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://70e3557f.nocodo.pages.dev |
| Branch Preview URL: | https://chore-refactor-storage.nocodo.pages.dev |
No description provided.