Skip to content

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Sep 15, 2025

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner September 15, 2025 22:06
Copy link

vercel bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
internal-search Ready Ready Preview Comment Sep 15, 2025 10:08pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a migration issue in the tool seeding process by adding special handling for a historical tool rename. The migration d09fc20a3c66_seed_builtin_tools.py now includes logic to detect when InternetSearchTool exists in the database but WebSearchTool doesn't, indicating an older installation. Instead of creating a duplicate tool entry, the migration updates the existing InternetSearchTool row in place, changing its in_code_tool_id from "InternetSearchTool" to "WebSearchTool" while also updating the name, display name, and description fields.

This change preserves existing relationships (like persona associations) that may reference the old tool ID while ensuring the database schema aligns with the current codebase naming conventions. The migration uses explicit transaction management with BEGIN/COMMIT/ROLLBACK statements and maintains a local sync of existing tool IDs to prevent duplicate insertions later in the migration process.

Confidence score: 2/5

  • This PR has significant risk due to manual transaction management within an Alembic migration that already runs in a transaction
  • Score lowered because explicit BEGIN/COMMIT/ROLLBACK in Alembic migrations can cause nested transaction issues and potential deadlocks
  • Pay close attention to the transaction management code and consider testing with existing databases that have the old InternetSearchTool

1 file reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Contributor

@joachim-danswer joachim-danswer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@Weves Weves merged commit 01e0ba6 into main Sep 15, 2025
54 of 57 checks passed
@Weves Weves deleted the fix-migration branch September 15, 2025 23:46
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.

2 participants