From 9969444820c61f97602f9db5b9c287d2077f1541 Mon Sep 17 00:00:00 2001 From: Leonid Gorkin Date: Sun, 18 Oct 2026 11:14:21 -0400 Subject: [PATCH] chore: post-merge cleanup for #302 reviewer nits - test_skills: replace the vacuous name-vs-id assertion in test_workspace_roots_shadow_the_state_dir with a real check that the workspace-root copy shadows the state-dir one - migration 0022: correct the stale revision docstring (0021/0020 -> 0022/0021) - seed.py: restore two blank lines dropped by the skills commit --- .../openbot/db/migrations/versions/0022_bot_skill_names.py | 4 ++-- backend/openbot/seed.py | 2 ++ backend/tests/test_skills.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/openbot/db/migrations/versions/0022_bot_skill_names.py b/backend/openbot/db/migrations/versions/0022_bot_skill_names.py index c2edff4..160546f 100644 --- a/backend/openbot/db/migrations/versions/0022_bot_skill_names.py +++ b/backend/openbot/db/migrations/versions/0022_bot_skill_names.py @@ -1,7 +1,7 @@ """bot skill_names: which skills a bot may load on demand -Revision ID: 0021 -Revises: 0020 +Revision ID: 0022 +Revises: 0021 """ import sqlalchemy as sa diff --git a/backend/openbot/seed.py b/backend/openbot/seed.py index ba6e5ca..18480ae 100644 --- a/backend/openbot/seed.py +++ b/backend/openbot/seed.py @@ -183,6 +183,7 @@ async def seed_demo_bots(services) -> int: SYNCED_FIELDS = ("instructions", "tool_names", "approval_tools", "model_settings", "icon", "load_repository_instructions", "skill_names") + SCRATCHPAD_GRANT_DONE_KEY = "_scratchpad_grant_done" @@ -213,6 +214,7 @@ async def grant_scratchpad_to_existing_bots(services) -> None: if granted: log.info("granted the scratchpad tool to %d existing bots", granted) + async def sync_demo_bots(services) -> int: """Rewrite the demo bots' instructions, tools, approval tools and model settings from DEMO_BOTS. diff --git a/backend/tests/test_skills.py b/backend/tests/test_skills.py index aa785d6..1544083 100644 --- a/backend/tests/test_skills.py +++ b/backend/tests/test_skills.py @@ -86,7 +86,10 @@ def test_workspace_roots_shadow_the_state_dir(tmp_path): state = tmp_path / "state" write_skill(state, "deep") # same id, different content: first root wins (skills,) = discover_skills(tmp_path, state) - assert skills.id != "Deep Review" + # Same id in both roots: exactly one skill survives and it comes from the + # workspace root ("Deep Review" here), not the shadowed state-dir copy + # ("Git Rebasing"). + assert skills.name == "Deep Review" def test_discovery_prunes_junk_dirs(tmp_path):