Skip to content

Comments

Fix first migration failure on new project setup#5

Merged
nsuruguay05 merged 1 commit intocogsol:mainfrom
fioreagui:issue-2/fix-migration-ordering
Feb 12, 2026
Merged

Fix first migration failure on new project setup#5
nsuruguay05 merged 1 commit intocogsol:mainfrom
fioreagui:issue-2/fix-migration-ordering

Conversation

@fioreagui
Copy link
Contributor

Description

Fix first migration failure after creating a new project and agent. Operations were generated in wrong dependency order and ExampleTool was commented out in the startproject template.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #2

Changes Made

  • Fixed entity iteration order in diff_states() to respect dependency chain: tools -> agents -> lessons/faqs/fixed_responses
  • Uncommented ExampleTool in startproject template so new projects work out of the box with startagent
  • Added try/except for __version__ import in makemigrations
  • Added TestOperationOrdering test class with two tests verifying correct operation ordering

Testing Done

  • Unit tests pass locally
  • Added new tests for new functionality
  • Tested manually

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

… in startproject template

Migration operations were generated with lessons/FAQs before agents,
causing "Lesson did not include an id" errors on first migrate.
The startproject template also had ExampleTool commented out while
startagent referenced it, breaking the default setup flow.

Closes cogsol#2
@nsuruguay05 nsuruguay05 merged commit c407a7f into cogsol:main Feb 12, 2026
13 checks passed
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.

[BUG] First migration fails after creating a new project and agent

2 participants