fix: defer built-in tool overrides until session lifecycle - #34
Open
RaviTharuma wants to merge 1 commit into
Open
fix: defer built-in tool overrides until session lifecycle#34RaviTharuma wants to merge 1 commit into
RaviTharuma wants to merge 1 commit into
Conversation
Built-in tool overrides (including bash) were still registered at extension load time. That races with packages like pi-patty-bg-tasks that also own bash and produces a hard Pi startup conflict: Tool "bash" conflicts with .../pi-tool-display/index.ts Queue built-in overrides at load and only register them from session_start / before_agent_start after re-checking pi.getAllTools() ownership. Yield any tool already owned by a non-builtin source. Updates README ownership docs and adds regression coverage for late bash ownership (pi-patty-bg-tasks load order).
Author
|
Tracked by #35 (repro with pi-patty-bg-tasks). Companion note on the other package: patty-io/pi-patty-bg-tasks#3 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read/grep/find/ls/bash/edit/write) were still registered at extension load time.bash(notablypi-patty-bg-tasks) and produces a hard Pi startup diagnostic:read/edit/etc. #29 / ownership docs), but the implementation still calledregisterIfOwned(...)immediately during load.session_start/before_agent_startafter re-checkingpi.getAllTools(). If a non-builtin owner already claimed the tool, pi-tool-display yields.Local workaround (already documented)
{ "registerToolOverrides": { "bash": false } }Test plan
npx tsx --test tests/tool-overrides-registration.test.tstests/reload-behavior.test.ts)bashownership (pi-patty-bg-tasks load order)registerToolOverrides.bash: true, Pi starts without a tool conflict diagnostic once this landsFixes coexistence with
pi-patty-bg-taskswithout requiring package reordering.