Commit af600c8
committed
fix(routing): close root-fetch race + Starter editability + binding autosave
Five fixes pulled from a session-mapping debugging pass.
1. on_initialized retries list_roots(). The single-shot
peer.list_roots() in the spawned init task had no retry. A transient
transport blip left the session at PendingRoots forever, and
roots-capable sessions saw only the meta tools. Loop with backoffs
100ms / 300ms / 800ms / 2s / 5s = 6 attempts, ~8s budget, retrying
only on transport errors (Ok([]) is a valid 'no folder open' answer
the client will follow up with a roots/list_changed when it has one).
2. On-demand probe in list_tools / list_prompts / list_resources. If
a roots-capable session hits a list request before its init
list_roots() landed (the visible 'Claude shows only 4 meta tools
after opening a new workspace' bug), fire a 300ms-budget probe
here, populate session_roots, then resolve routing. SessionRootsRegistry
gains claim_probe(sid, throttle) so a burst of three list calls
doesn't fan out three upstream peer.list_roots() — only the first
in any 1s window wins.
3. Migration 015 rewrites the *other* legacy seeded copy. Migration
014 only caught the 'The fallback feature set for this space'
variant set by space_repository.rs. The Default Space's row was
seeded by migration 001 itself with 'Features automatically
granted to all connected clients in this space' — directly the
opposite of what's true under resolver v3. 015 rewrites that
string with the same is_builtin + name + description guard so
any operator-customized copy survives.
4. Starter FSes are editable. The two member-modification guards
in commands/feature_set.rs (add_feature_set_member,
set_feature_set_members) rejected feature_set_type='starter'
because they only accepted 'default' and 'custom'. Result: the
auto-seeded Starter FS was read-only — useless. Both guards now
accept 'starter' (and keep 'default' as a legacy alias for any
stale read pre-migration-013). Comment updated.
5. WorkspaceBinding autosave debounce + flush-on-close. Bumped
debounce 600ms to 1500ms to coalesce multi-FS toggle bursts into
one save. Stricter dedupe (compares against last-saved, not just
initial — re-toggling A → B → A is a true no-op). Most importantly,
pending edits now survive panel close: a separate unmount-only
useEffect reads pendingPayloadRef and posts the IPC immediately
if there's unsaved work, so closing the sheet right after typing
no longer drops the change. Latest onSubmit / onSaveStatusChange
are kept in refs so the unmount handler uses the freshest closures.
cargo check + clippy (-D warnings) + pnpm typecheck all clean.
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>1 parent 98bceb8 commit af600c8
6 files changed
Lines changed: 408 additions & 88 deletions
File tree
- apps/desktop
- src-tauri/src/commands
- src/features/workspaces
- crates
- mcpmux-gateway/src
- mcp
- services
- mcpmux-storage/src
- migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
318 | 323 | | |
319 | | - | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
456 | | - | |
457 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
458 | 464 | | |
459 | | - | |
| 465 | + | |
460 | 466 | | |
461 | | - | |
| 467 | + | |
462 | 468 | | |
463 | 469 | | |
464 | 470 | | |
| |||
Lines changed: 104 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
458 | 475 | | |
459 | 476 | | |
460 | 477 | | |
| |||
1638 | 1655 | | |
1639 | 1656 | | |
1640 | 1657 | | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
1644 | 1672 | | |
1645 | 1673 | | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
1646 | 1693 | | |
1647 | 1694 | | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | 1695 | | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1657 | 1716 | | |
1658 | 1717 | | |
1659 | 1718 | | |
1660 | 1719 | | |
1661 | 1720 | | |
1662 | 1721 | | |
1663 | 1722 | | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
| 1723 | + | |
1669 | 1724 | | |
| 1725 | + | |
| 1726 | + | |
1670 | 1727 | | |
1671 | 1728 | | |
1672 | 1729 | | |
| |||
1680 | 1737 | | |
1681 | 1738 | | |
1682 | 1739 | | |
1683 | | - | |
| 1740 | + | |
1684 | 1741 | | |
1685 | 1742 | | |
1686 | 1743 | | |
| |||
1694 | 1751 | | |
1695 | 1752 | | |
1696 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
1697 | 1784 | | |
1698 | 1785 | | |
1699 | 1786 | | |
| |||
0 commit comments