Drop the pi-agent-core re-export from @onkernel/loop/pi - #87
Merged
Conversation
./pi now exports only loop-owned symbols: attach() and its types, model resolution, provider adapters/streaming, threading, retry, and api-key helpers. pi-agent-core is composed with, not wrapped: consumers install it and import Agent, AgentHarness, session/tool primitives directly, which the README examples and internal tests/examples now model. Declare pi-agent-core as a peer dependency alongside the regular dependency so consumers get an npm version-compatibility signal; the regular dep keeps internal resolution (attach/compile/tool-manager) working. Add a test pinning the ./pi export surface.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Release smoke still imports NodeExecutionEnv
- Updated the release smoke test to stop importing and asserting
NodeExecutionEnvfrom@onkernel/loop/pi, matching the current export surface.
- Updated the release smoke test to stop importing and asserting
Or push these changes by commenting:
@cursor push fa93020cdc
Preview (fa93020cdc)
diff --git a/.github/workflows/release-loop.yml b/.github/workflows/release-loop.yml
--- a/.github/workflows/release-loop.yml
+++ b/.github/workflows/release-loop.yml
@@ -74,9 +74,9 @@
npm install "$RUNNER_TEMP"/onkernel-loop-*.tgz
cat > smoke.mjs <<'NODE'
import { compileLoopToolCatalog, formatBrowserActResult, loop } from "@onkernel/loop";
- import { attach, getLoopModel, NodeExecutionEnv } from "@onkernel/loop/pi";
+ import { attach, getLoopModel } from "@onkernel/loop/pi";
- for (const [name, value] of Object.entries({ compileLoopToolCatalog, formatBrowserActResult, attach, getLoopModel, NodeExecutionEnv })) {
+ for (const [name, value] of Object.entries({ compileLoopToolCatalog, formatBrowserActResult, attach, getLoopModel })) {
if (typeof value !== "function") {
throw new Error(`expected ${name} to be a function, got ${typeof value}`);
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit cc2fd53. Configure here.
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.


What changed
packages/loop/src/pi/index.tsre-exported all of@earendil-works/pi-agent-coreplusNodeExecutionEnvfrom its/nodeentry — about 80 of the ~113 symbols on./piwere pi's, not loop's (Agent,AgentHarness,InMemorySessionRepo,createBashTool/createReadTool/createEditTool/createWriteTool, session/skill/prompt-template/compaction primitives). That made loop look like a wrapper around pi and silently pinned consumers to the pi version loop resolved. This removes the re-export: pi is imported from pi.New ./pi surface
Only loop-owned symbols remain:
attach()and its types, model resolution (getLoopModel,listLoopModels,parseLoopModelRef, quirks/capabilities/native-surface tables), provider adapters and streaming helpers (createLoopModels,loopModels,GOOGLE_INTERACTIONS_API,OPENAI_COMPUTER_USE_API, stream functions), response-threading helpers,LoopRetryOptions, and the api-key helpers. Type references to pi types in loop-owned signatures are unchanged. A new test (test/pi-export-surface.test.ts) pins the surface by assertingAgent/AgentHarness/InMemorySessionRepo/NodeExecutionEnv/create*Toolare not exported.Peer dependency
@earendil-works/pi-agent-core@0.83.0is now declared as a peer dependency in addition to the regular dependency. The regular dep keeps internal resolution working (attach/compile/tool-manager consume it); the peer gives consumers constructingAgent/AgentHarnessthemselves an npm version-compatibility signal.npm installin the workspace resolves cleanly with both declared.Docs and internal consumers
packages/loop/README.md: install line is nownpm install @onkernel/loop @onkernel/sdk @earendil-works/pi-agent-core; every example importsAgent/AgentHarness/InMemorySessionRepo/NodeExecutionEnv/tool factories from pi-agent-core directly; the "re-exports pi-agent-core's ... primitives" paragraph now states the opposite.README.md: the agent example importsAgentfrom pi-agent-core../pinow import from@earendil-works/pi-agent-core(and/node). The published-declarations downstream-consumer fixture models the same composition; it needed one explicitpathsentry for the/nodesubpath because the fixture's"*"fallback resolves package roots but not subpath exports.createLoopModelsfrom./pi— unchanged.files/exportsneed no change; nothing there referenced the re-export.Testing
npm run typecheckclean (loop and root).skipLibCheck: false.dist/pi/index.js: 30 runtime exports, all loop-owned.Note
Medium Risk
Breaking change for anyone importing
Agent/AgentHarnessfrom@onkernel/loop/pi; migration is straightforward but required on upgrade.Overview
@onkernel/loop/pino longer re-exports@earendil-works/pi-agent-core(includingNodeExecutionEnvfrom/node). The entrypoint now exposes only loop-owned bindings—attach, model/catalog helpers, provider streaming, API keys, and related types.Consumers must install
@earendil-works/pi-agent-core@0.83.0and importAgent,AgentHarness, session/tool factories, andNodeExecutionEnvfrom that package directly.@earendil-works/pi-agent-coreis added as a peer dependency (alongside the existing regular dependency) so npm surfaces version alignment for apps that construct agents themselves.Docs, examples, tests, and the published-declarations consumer fixture follow the new import pattern.
test/pi-export-surface.test.tsand the release ESM smoke test assert that symbols likeAgentandNodeExecutionEnvare not present on@onkernel/loop/pi.Reviewed by Cursor Bugbot for commit e1eecd6. Bugbot is set up for automated code reviews on this repo. Configure here.