Skip to content

Bug: adding a library skill for All bots gives it to one bot if any bot already has a skill by that name #367

Open

Description

@currentbits

From research round 11 (#347), code audit at 7abb0a3. Size: S + XS. Paths under crates/mimir-core/src unless noted.

skill_decide (db/skills.rs:194-206):

.find(|o| o.bot_id == p.bot_id || o.bot_id == 0 || p.bot_id == 0)
.map(|o| o.bot_id),
...
tx.execute("UPDATE skills SET bot_id=?2 WHERE id=?1", params![id, bot])?;

skill_from_library(scope, 0, …) (host.rs:869, bot_id 0 from the UI) inserts with bot 0, then accepts. When bot 5 has its own "Morning briefing", p.bot_id == 0 matches it: the proposal moves to bot 5 and replaces bot 5's version, and no other bot gets it. With two bots' copies, only the lowest id is replaced. Same for a taught or SKILL.md proposal made for all bots.

  • When p.bot_id == 0, keep 0 and retire every same-name active skill in the scope (shown on the card), or refuse with the clash message skill_share uses (skills.rs:183).
  • UI: a fix card for a skill shared after the fix was proposed shows no diff and no Replaces line: ui/src/views/skills.tsx:152 matches a.bot_id === k.bot_id only. Use the db's rule (|| a.bot_id === 0 || k.bot_id === 0), also in replaces() at skills.tsx:122.
  • Test: library add with bot 0 while a bot has its own skill of that name stays shared (imports.rs:840 covers only the no-clash case).

Activity

  1. added
    plan:todo
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:todo

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions