Skip to content

Conversation

@brainless
Copy link
Owner

No description provided.

brainless and others added 6 commits February 3, 2026 10:01
- 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>
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

📊 Code Complexity Analysis

  • Lines added: 4340
  • Lines removed: 1088
  • Net change: 3252

💡 Suggestion: This is a large PR with 4340 added lines. Consider:

  • Breaking it into smaller, focused PRs
  • Adding comprehensive tests for the new functionality
  • Updating documentation as needed

Automated analysis by GitHub Actions

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🤖 Automated Code Review Summary

This automated review was generated to help ensure code quality and security standards.

Rust Code Analysis

  • ⚠️ Code formatting: Some Rust files are not formatted according to rustfmt standards.

    • Run cargo fmt to fix formatting issues.
  • ⚠️ Linting: Clippy found potential issues in Rust code.

    • Run cargo clippy --workspace --all-targets -- --deny warnings to see detailed warnings.

Security Analysis

  • ⚠️ Potential secrets: Found references to passwords, secrets, or tokens.

    • Please verify no hardcoded credentials are present.
  • ℹ️ Debug output: Found debug print statements.

    • Consider removing or replacing with proper logging.

Recommendations

  • Run the full CI pipeline to ensure all tests pass
  • Consider adding tests for any new functionality
  • Update documentation if API changes are involved
  • Follow the development workflow described in CLAUDE.md

This review was automatically generated. Please address any issues before merging.

@cloudflare-workers-and-pages
Copy link

Deploying nocodo with  Cloudflare Pages  Cloudflare Pages

Latest commit: f0b1666
Status: ✅  Deploy successful!
Preview URL: https://70e3557f.nocodo.pages.dev
Branch Preview URL: https://chore-refactor-storage.nocodo.pages.dev

View logs

@brainless brainless merged commit a35319c into main Feb 3, 2026
4 checks passed
@brainless brainless deleted the chore/refactor-storage branch February 3, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant