Skip to content

SoL-Pi cannot load, and Action Fusion publishes a parameterless tool, on Pi-compatible hosts with a reduced export surface #48

Description

@luw2007

Two independent failures when SoL-Pi is loaded by a Pi-compatible host that is not the official pi binary. I hit both on omp (oh-my-pi) 18.1.19, a Pi fork that re-exports @earendil-works/pi-coding-agent from its own bundle. Both are host-surface assumptions in SoL-Pi rather than host bugs, and both are distinct from #20/#22 (there the fused tool is registered but the model never calls it; here the fused tool is registered and is called).

Environment: omp 18.1.19 (Homebrew, single compiled binary), SoL-Pi 0.1.0 @ d7ecfc0, macOS arm64, Node 24 / Bun. Config: actionFusion: true, observationPack: true, other two false.

1. Install fails: two context APIs are imported as required named bindings

$ omp install git:github.com/NVlabs/SoL-Pi
✘ Failed to install: Plugin sol-pi extension validation failed:
  .../sol-pi/src/sol-pi/index.ts: Failed to load extension:
  Export named 'findCutPoint' not found in module '<host>:@oh-my-pi/pi-coding-agent'.

online-context-compact/extension.ts imports findCutPoint and sessionEntryToContextMessages statically. This host exports everything else SoL-Pi uses (buildSessionContext, estimateTokens, createEdit/Write/BashToolDefinition, getAgentDir, CONFIG_DIR_NAME, pi-tui Container/Text, pi-ai/compat#complete) but not those two — they were reworked out of its public surface.

Impact is larger than the mechanism: the failing import aborts module evaluation, so the package never loads and all four mechanisms are unavailable, even with onlineContextCompact: false. Both symbols are used only inside nativeCompactionFeasible().

Related to #11, but the failure here is a missing export inside an accepted version, not an out-of-range version.

2. Action Fusion publishes a fused tool with no built-in parameters

createActionFusionExtension() rebuilds the fused schema from template.parameters.properties. On Pi that is a TypeBox Type.Object and the read is exact. This host describes tool parameters with its own schema value, where:

  • typeof parameters === "function" (the schema is callable, not a plain object),
  • parameters.properties is undefined,
  • the contract is reachable only via parameters.toJsonSchema(){"type":"object","properties":{"path":{...},"content":{...}},"required":["path","content"]}.

So {...template.parameters.properties, then_run} collapses to {then_run}, and the published write tool no longer declares path or content. Two observable outcomes, depending on how strictly the host filters arguments against the published schema:

Verified on the host: before the fix, a write call carrying then_run returned only the plain success text; after the fix the same call returns

[fused.txt#BF2C]
Successfully wrote 5 bytes to fused.txt
[then_run:succeeded]
5 fused.txt

A second, smaller point in the same area: this host's edit tool takes a single multi-file patch string rather than path + edits, so a fused edit has no single target to key the file queue and the pre-command hash check on. Replacing it produces a tool that cannot work regardless of schema handling.

Suggested fix

Both are one-line-of-principle changes that are no-ops on Pi:

  1. resolve the two context APIs through the module namespace and fall back locally, so a reduced surface costs a pre-check refinement instead of the whole package;
  2. read the built-in properties through a helper that prefers parameters.properties and otherwise rebuilds them from parameters.toJsonSchema() (preserving optionality from required), and skip replacing a mutation tool whose contract has no path.

PR incoming with both, plus a test that covers the rebuild and fails without it. Existing suite stays green (143 tests).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions