- Drop is_builtin column from tool_types table - Remove built-in tool seeding from startup - Remove is_builtin from API schemas and frontend types - Update tool-types spec to reflect removal of built-in concept - Add Alembic migration for column removal - Update tests to work without built-in distinction
2.1 KiB
Context
Currently, the system seeds built-in tool types (code-server, jupyter-notebook, opencode) on every startup via seed_builtin_tool_types() in main.py. These are marked with is_builtin=True in the database and have special protections preventing their deletion or modification. This creates a two-tier system.
Goals / Non-Goals
Goals:
- Remove
is_builtinfield from ToolType model and API - Remove startup seeding logic
- Make all tool types editable and deletable
- Preserve existing tool type data by converting built-ins to regular types
Non-Goals:
- Changing the actual tool type definitions (compose templates, ports, etc.)
- Adding new tool types
- Changing the tool type creation API schema
Decisions
1. Data Migration Over Runtime Seeding
Decision: Move built-in tool definitions from Python code to a database migration.
Rationale:
- Makes built-ins regular database records
- Eliminates special-case code paths
- Allows users to modify or delete them freely
- Simplifies the codebase
2. Drop is_builtin Column
Decision: Remove the is_builtin column entirely rather than setting all to False.
Rationale:
- Clean schema with no dead columns
- No confusion about what the flag means
- Simpler model
Risks / Trade-offs
[Risk] Users accidentally delete preconfigured tools → Mitigation: These are just regular tool types now; users can recreate them manually if needed. The system no longer auto-recreates them.
[Risk] Existing code depends on is_builtin flag → Mitigation: Comprehensive search and removal of all references.
Migration Plan
- Create Alembic migration to:
- Add
definition_typeanddockerfile_templatecolumns if not present (some built-ins use these) - Insert built-in tool types as regular records (if they don't exist)
- Drop
is_builtincolumn
- Add
- Remove
seed_builtin_tool_types()frommain.py - Update
ToolTypemodel to removeis_builtin - Update API to remove built-in checks
- Update frontend to remove built-in-specific UI
Open Questions
- Should we keep a seed script for fresh installations? (Yes, as a one-time migration)