fix(child-session): align inherited tools with blocked package provenance - #528
Merged
tt-a1i merged 6 commits intoSep 12, 2026
Merged
Conversation
…ild inheritance (openpi-dev#483) pi-intercom is excluded from child sessions via blockedPackageSources to prevent concurrent process.env session cross-wiring (openpi-dev#128). However, when pi-intercom was active in the parent session, inheritedChildToolAllowlist projected its tools into child sessions, causing subagent_spawn and workflow child sessions to fail preflight checks. Rather than hardcoding foreign tool names into OpenPI's CHILD_EXCLUDED_TOOL_NAMES (which is strictly reserved for OpenPI-owned parent-only tools and enforced by the fail-closed drift guard), dynamically drop tools from blocked packages during child inheritance: - Inspect tool.sourceInfo in inheritedChildToolAllowlist against blocked child package matchers - Pass pi.getAllTools() and cwd context from subagents/index.ts and workflows/index.ts - Preserve CHILD_EXCLUDED_TOOL_NAMES and bidirectional drift guards strictly for OpenPI tools - Add regression coverage verifying dynamic exclusion of tools from blocked packages while preserving ordinary tools and passing child preflight
tt-a1i
previously approved these changes
Sep 12, 2026
tt-a1i
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed 48bc587 after current-main integration. Standards: no remaining actionable blocker identified. Spec: Authoritative Pi tool provenance and one shared blocked-package policy fail closed across Direct and Workflow child acquisition. No P0/P1 found. This supersedes findings against older implementations where stated; merge remains conditional on current required CI and branch protection.
tt-a1i
approved these changes
Sep 12, 2026
tt-a1i
left a comment
Collaborator
There was a problem hiding this comment.
仅为现有测试 fixture 提供新增的 Pi provenance 参数,无运行时策略变化。 bun run check 已通过;完整测试已执行或正在串行验证,本机部分测试存在资源竞争超时,最终状态以最新 CI 为准。未发现 P0/P1。此账户推送了修复,仍需另一位维护者满足最后一次推送后的独立批准。
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.
Problem
Fixes #483. Fixes #493.
With
pi-intercomactive in the parent, Direct Subagents and Workflow children inherit its tool names even though child resource loading excludes the package. Startup then fails before the first model turn.This builds on #494 and retains naivezip's original commit/attribution. It incorporates the requested provenance and caller-test changes in a separate reviewable PR, rebased onto
mainat5bf2fe2. The original PR remains untouched.Value
Restore delegation while preserving the parent-only package boundary and unrelated third-party tools, including ordinary tools also named
intercom.Approach
ToolInfoprovenance and requiredgetAllTools()at both production callers; remove the partial descriptor, optional metadata path, and array shorthand.originandscope. Resolve local sources through Pi's scopedgetInstalledPath(): a nested single-file extension must be checked as a file so its owning manifest can be found above its containing directory.agent()using actual parent package metadata and the existing child-session injection seams.Validation
On the final rebased head, Node
22.23.1, Bun1.3.14, Pi SDK0.85.1:bun run check: passed, including Web build, formatting, lint, and type checks.bun run test: Node 1527 passed / 1 skipped; Vitest 130 passed across 9 files.git diff --check: passed.88531a1and passes after this correction.Tests execute real package loading and shared child preflight; caller tests inject model/session responses. No live provider generation or installed interactive Pi acceptance is claimed. Existing bundle-size and jsdom scroll warnings remain.
Impact