Skip to content

fix: decorate late tools before registration - #32

Open
neumie wants to merge 1 commit into
MasuRii:mainfrom
neumie:fix/decorate-late-tools-before-registration
Open

fix: decorate late tools before registration#32
neumie wants to merge 1 commit into
MasuRii:mainfrom
neumie:fix/decorate-late-tools-before-registration

Conversation

@neumie

@neumie neumie commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • decorate configured tools registered by later-loaded extensions before Pi snapshots their definitions
  • optionally preserve a tool's native call/header renderer while replacing only result rendering
  • track decorated tools by object identity, bound pending decorations, and clean interception state across reloads

Why

customToolOverrides can target tools registered after pi-tool-display (for example hypa_shell). The interceptor previously forwarded a tool to Pi before decorating it. If Pi copied the definition during registerTool, the configured renderer never reached the runtime.

The new order decorates first and remains fail-open: if decoration fails, the original tool is still registered.

Scope

  • one squashed commit
  • no fork branding, package-version change, repository URL change, or CI configuration
  • documentation and tests are limited to the affected runtime/API behavior

Validation

  • npm run typecheck
  • affected API/registration suites: 28/28 passed
  • npm pack --dry-run --ignore-scripts
  • full local suite: 723/728 passed; the five existing macOS fixture failures reproduce on unmodified upstream main (/var vs /private/var paths and the ignored local config.json fixture)

@neumie
neumie marked this pull request as draft July 15, 2026 08:47
@neumie
neumie marked this pull request as ready for review July 15, 2026 08:49
- decorate configured late tools before Pi snapshots registration
- preserve native call renderers when explicitly configured
- harden object-identity tracking, pending queues, and reload cleanup
@neumie
neumie force-pushed the fix/decorate-late-tools-before-registration branch from f1a8fa1 to ca77a05 Compare July 21, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant