Skip to content

Conversation

@brainless
Copy link
Owner

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

  • SettingsManagementAgent: New agent that collects settings using typed question types (password, file_path, url, email, text, boolean) via the ask_user tool
  • TOML File Storage: Settings are written to sectioned TOML files (e.g., [sqlite_analysis], [api_client]) for portability
  • Dynamic Schema Discovery: Agents expose their settings requirements through settings_schema() method on the Agent trait
  • Namespaced Question IDs: Questions use format "section_name.setting_name" (e.g., "sqlite_analysis.db_path") to map to TOML sections

Agent Trait Enhancements

  • Added settings_schema() method to Agent trait (returns AgentSettingsSchema)
  • Added 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)
  • Introduced SettingDefinition, SettingType, and AgentSettingsSchema types to lib.rs

Agent Implementations

  • SqliteAnalysisAgent: Implements settings_schema() and static_settings_schema() exposing db_path setting (required file_path type)

Integration

  • API Handler: /agents/settings-management/execute endpoint with proper config parsing
  • GUI Support: Added settings-management to Agents page with settings file path input
  • Factory Methods: create_settings_management_agent() accepts settings_file_path and agent_schemas

Testing

  • settings_management_runner: Binary for testing with SQLite schema included
  • Migrations: Added project_settings table (V5) with tool call tracking

Commits

  1. Add settings management agent for collecting workflow settings - Initial implementation with database storage
  2. Refactor settings management to use TOML files with trait-based schemas - Switch to TOML files and schema-based discovery
  3. Enable settings-management agent in API and GUI - API handler and GUI integration
  4. Add static settings schema to agents and improve settings management prompt - Add static_settings_schema() to avoid circular deps, improved LLM prompts with explicit WHEN TO/WHEN NOT TO use tool

Usage 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:

[sqlite_analysis]
db_path = "/path/to/database.db"

Files Changed

  • nocodo-agents/src/lib.rs: Agent trait with schema methods
  • nocodo-agents/src/settings_management/mod.rs: Core settings management agent
  • nocodo-agents/src/sqlite_analysis/mod.rs: Schema implementation
  • nocodo-agents/bin/settings_management_runner.rs: Test runner
  • nocodo-api/src/handlers/agent_execution/settings_management_agent.rs: API endpoint
  • gui/src/pages/Agents.tsx: UI integration
  • shared-types/src/agent.rs: Type definitions

brainless and others added 10 commits January 18, 2026 23:56
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
@github-actions
Copy link

📊 Code Complexity Analysis

  • Lines added: 2156
  • Lines removed: 444
  • Net change: 1712

💡 Suggestion: This is a large PR with 2156 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

@cloudflare-workers-and-pages
Copy link

Deploying nocodo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4730b5a
Status: ✅  Deploy successful!
Preview URL: https://dc40215c.nocodo.pages.dev
Branch Preview URL: https://feature-project-requirements.nocodo.pages.dev

View logs

@github-actions
Copy link

🤖 Automated Code Review Summary

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

Rust Code Analysis

  • Code formatting: All Rust files are properly formatted.

  • ⚠️ Linting: Clippy found potential issues in Rust code.

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

TypeScript/JavaScript Code Analysis

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.

@brainless brainless merged commit 0800d0a into main Jan 19, 2026
6 checks passed
@brainless brainless deleted the feature/project-requirements-settings branch January 19, 2026 14:49
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