pi-dashboard icon indicating copy to clipboard operation
pi-dashboard copied to clipboard

bug: extension tool name conflicts crash all pi RPC sessions

Open samfoy opened this issue 7 months ago • 0 comments

Description

When two pi extensions register a tool with the same name (e.g. code_search), pi-web-access throws a fatal error during registerTool(), crashing the entire pi --mode rpc process at startup. This kills all dashboard chat sessions.

Steps to reproduce

  1. Install both pi-lsp-extension and pi-web-access
  2. Both register a tool named code_search
  3. Open any chat in the dashboard
  4. pi process crashes immediately:
    Error: Failed to load extension "pi-web-access": Tool "code_search" conflicts with pi-lsp-extension
    
  5. No sessions work until the conflict is resolved

Expected behavior

Tool name conflicts should be non-fatal — log a warning, skip the duplicate registration, and keep running.

Actual behavior

Fatal crash. All pi functionality lost.

Root cause

pi-web-access does its own tool name conflict check in registerTool() and throws instead of logging. Pi's built-in conflict detection (in resource-loader.js) is non-fatal and runs after extension loading, but the extension's own check runs first.

Fix applied

Renamed pi-lsp-extension's code_search → ast_search (v0.1.2).

Upstream fix needed

pi-web-access (third-party) should not throw fatally on conflicts. This is also a resilience gap in the dashboard — if any extension crashes pi, all sessions die silently (see #1).

Mitigation for dashboard

The dashboard's PiManager should handle pi startup failures gracefully and report them to the user instead of silently leaving the slot in a broken state.

samfoy avatar Apr 19 '26 05:04 samfoy