-
Notifications
You must be signed in to change notification settings - Fork 2
Add Settings Management Agent with TOML Configuration System #196
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
Migrate from inline SQL to a proper migration framework using Refinery 0.9. Migrations are now defined as Rust modules that generate SQLite DDL on demand, providing a database-agnostic foundation that can support PostgreSQL, MySQL, and other databases in the future. Changes: - Add Refinery 0.9 dependency with rusqlite support - Create migration modules in database/migrations/: * V1__create_agent_sessions.rs * V2__create_agent_messages.rs * V3__create_agent_tool_calls.rs * V4__create_project_requirements_qna.rs - Remove ~200 lines of duplicate migration code from database/mod.rs - Replace inline SQL with Refinery's embed_migrations! macro - Move requirements_gathering data models to dedicated modules: * models.rs for ProjectRequirementQnA * database.rs for DB operations (store_questions, get_pending_questions, store_answers) - Add comprehensive migration tests with 100% pass rate - Add documentation in database/migrations/README.md Benefits: - Single source of truth: Rust types generate SQL, eliminating duplication - Database agnostic foundation ready for multi-database support - Automatic schema version tracking via Refinery - Idempotent migrations safe to run multiple times - Better separation between core and agent-specific tables Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds automatic detection and initialization of Refinery schema history for existing databases that were created before the migration system was updated. This fixes the api crate startup error where Refinery attempted to recreate tables that already existed. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Enable Password, FilePath, Url, Email question types in shared-types - Create SettingsManagementAgent similar to UserClarificationAgent - Add project_settings database table and migration - Update factory and lib.rs to include new agent - Add settings-management-runner binary for testing - Update manager-tools to handle new question types
The settings manager now writes to TOML configuration files instead of database tables, making settings portable and human-editable. Agents expose their settings requirements through a settings_schema() method on the Agent trait, allowing the settings manager to discover and collect settings dynamically. Key changes: - Add SettingsSchema trait system to Agent trait with SettingType, SettingDefinition, and AgentSettingsSchema types - Refactor SettingsManagementAgent to accept settings file path and agent schemas as constructor parameters - Implement TOML file writing with section-based organization (e.g., [sqlite_analysis], [api_client]) - Update settings collection to use namespaced question IDs that map to TOML sections (e.g., "sqlite_analysis.db_path") - Add settings_schema() implementation to SqliteAnalysisAgent as example - Update factory methods to require settings_file_path and agent_schemas The settings manager system prompt now includes available agent schemas, guiding the LLM to collect the right settings for each agent involved in the user's workflow. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Use database path from config file instead of hardcoded platform-specific paths
- Calculate proper u64 checksums for legacy database migrations to prevent ParseIntError
- Remove unused get_api_db_path function
Fixes crash: "checksum must be a valid u64: ParseIntError { kind: Empty }" when Refinery reads migration history with empty checksum strings.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds support for logging to a file without ANSI color codes while maintaining colored console output. The RUST_LOG env variable controls verbosity for both outputs. Usage: RUST_LOG=debug cargo run --bin nocodo-api -- --log-file-path /tmp/nocodo-api-debug.log
Rename user-clarification to requirements-gathering across all components to align with the nocodo-agents/src/requirements_gathering module path. The GUI now supports all 5 agents including workflow-creation (requires type_names and domain_description) and requirements-gathering (no config).
…prompt - Add static_settings_schema() to Agent trait for schema access without instantiation - Implement static_settings_schema() for SqliteAnalysisAgent - Update settings_management system prompt with explicit WHEN TO/WHEN NOT TO use ask_user tool - Update settings_management_runner to use static schema instead of duplicating definition
📊 Code Complexity Analysis
💡 Suggestion: This is a large PR with 2156 added lines. Consider:
Automated analysis by GitHub Actions |
Deploying nocodo with
|
| Latest commit: |
4730b5a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dc40215c.nocodo.pages.dev |
| Branch Preview URL: | https://feature-project-requirements.nocodo.pages.dev |
🤖 Automated Code Review SummaryThis automated review was generated to help ensure code quality and security standards. Rust Code Analysis
TypeScript/JavaScript Code AnalysisSecurity Analysis
Recommendations
This review was automatically generated. Please address any issues before merging. |
Summary
Adds a settings management agent that collects typed configuration values from users and saves them to TOML files. The system enables agents to define their settings requirements via trait-based schemas, avoiding circular dependencies while allowing for portable, human-editable configuration.
Key Changes
Core Settings Management
ask_usertool[sqlite_analysis],[api_client]) for portabilitysettings_schema()method on the Agent trait"section_name.setting_name"(e.g.,"sqlite_analysis.db_path") to map to TOML sectionsAgent Trait Enhancements
settings_schema()method toAgenttrait (returnsAgentSettingsSchema)static_settings_schema()method for schema access without instantiation (solves chicken-and-egg problem - can't instantiate agents that need settings before collecting those settings)SettingDefinition,SettingType, andAgentSettingsSchematypes to lib.rsAgent Implementations
settings_schema()andstatic_settings_schema()exposingdb_pathsetting (required file_path type)Integration
/agents/settings-management/executeendpoint with proper config parsingcreate_settings_management_agent()accepts settings_file_path and agent_schemasTesting
Commits
static_settings_schema()to avoid circular deps, improved LLM prompts with explicit WHEN TO/WHEN NOT TO use toolUsage Example
cargo run -p nocodo-agents --bin settings-management-runner -- --prompt "I want to analyze a SQLite database"This will prompt the user for the SQLite database path and save it to
workflow_settings.toml:Files Changed
nocodo-agents/src/lib.rs: Agent trait with schema methodsnocodo-agents/src/settings_management/mod.rs: Core settings management agentnocodo-agents/src/sqlite_analysis/mod.rs: Schema implementationnocodo-agents/bin/settings_management_runner.rs: Test runnernocodo-api/src/handlers/agent_execution/settings_management_agent.rs: API endpointgui/src/pages/Agents.tsx: UI integrationshared-types/src/agent.rs: Type definitions