Skip to content

fix: 6017 link manually-selected tool on policy/tool import#6018

Open
Pyatakov wants to merge 3 commits intodevelopfrom
fix/policy-import-manual-tool-override
Open

fix: 6017 link manually-selected tool on policy/tool import#6018
Pyatakov wants to merge 3 commits intodevelopfrom
fix/policy-import-manual-tool-override

Conversation

@Pyatakov
Copy link
Copy Markdown
Contributor

@Pyatakov Pyatakov commented May 1, 2026

Description

When importing a policy or tool, if a nested tool is not found by message ID the user can manually select a local equivalent via the import dialog. Previously the override was ignored, the policy config and schema references still pointed at the foreign tool, causing import errors and Validate failures.

  • Resolve manually-overridden tools from the local database instead of re-fetching from IPFS
  • Rewrite tool block messageId and hash in policy config to point at the locally-selected tool
  • Rewrite policy schema $defs IRIs to reference the local tool's schemas
  • Extract shared resolveToolOverrides helper used by both policy-import and tool-import paths
  • Re-run updateToolConfig after config rewrite so nested tool descriptors reflect updated references

Related issue(s)

Fixes #6017

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Pyatakov added 3 commits May 1, 2026 21:13
Resolve the user-picked tool from the local DB instead of round-tripping through importSubTools, which silently failed and left policy.config and schema $defs pointing at the foreign tool.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Apply the same override-resolution to importToolByFile, and refresh tool.tools after replaceConfig so nested-tool schemas are populated in the local DB.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Both policy- and tool-import paths share the same override-resolution path.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
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.

2 participants