@tintinweb/pi-subagents 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.2] - 2026-03-26
11
+
12
+ ### Fixed
13
+ - **Extension `session_start` handlers now fire in subagent sessions** ([#20](https://github.com/tintinweb/pi-subagents/issues/20)) — `bindExtensions()` was never called on subagent sessions, so extensions that initialize state in `session_start` (e.g. loading credentials, setting up connections) silently failed at runtime. Tools appeared registered but were non-functional. Now calls `session.bindExtensions()` after tool filtering and before prompting, matching the lifecycle used by pi's interactive, print, and RPC modes. Also triggers `extendResourcesFromExtensions("startup")` so extension-provided skills and prompts are discovered.
14
+
10
15
  ## [0.5.1] - 2026-03-24
11
16
 
12
17
  ### Changed
@@ -340,6 +345,8 @@ Initial release.
340
345
  - **Thinking level** — per-agent extended thinking control
341
346
  - **`/agent` and `/agents` commands**
342
347
 
348
+ [0.5.2]: https://github.com/tintinweb/pi-subagents/compare/v0.5.1...v0.5.2
349
+ [0.5.1]: https://github.com/tintinweb/pi-subagents/compare/v0.5.0...v0.5.1
343
350
  [0.5.0]: https://github.com/tintinweb/pi-subagents/compare/v0.4.9...v0.5.0
344
351
  [0.4.9]: https://github.com/tintinweb/pi-subagents/compare/v0.4.8...v0.4.9
345
352
  [0.4.8]: https://github.com/tintinweb/pi-subagents/compare/v0.4.7...v0.4.8
@@ -213,6 +213,18 @@ export async function runAgent(ctx, type, prompt, options) {
213
213
  const activeTools = session.getActiveToolNames().filter(t => !disallowedSet.has(t));
214
214
  session.setActiveToolsByName(activeTools);
215
215
  }
216
+ // Bind extensions so that session_start fires and extensions can initialize
217
+ // (e.g. loading credentials, setting up state). Placed after tool filtering
218
+ // so extension-provided skills/prompts from extendResourcesFromExtensions()
219
+ // respect the active tool set. All ExtensionBindings fields are optional.
220
+ await session.bindExtensions({
221
+ onError: (err) => {
222
+ options.onToolActivity?.({
223
+ type: "end",
224
+ toolName: `extension-error:${err.extensionPath}`,
225
+ });
226
+ },
227
+ });
216
228
  options.onSessionCreated?.(session);
217
229
  // Track turns for graceful max_turns enforcement
218
230
  let turnCount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tintinweb/pi-subagents",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "A pi extension extension that brings smart Claude Code-style autonomous sub-agents to pi.",
5
5
  "author": "tintinweb",
6
6
  "license": "MIT",
@@ -292,6 +292,19 @@ export async function runAgent(
292
292
  session.setActiveToolsByName(activeTools);
293
293
  }
294
294
 
295
+ // Bind extensions so that session_start fires and extensions can initialize
296
+ // (e.g. loading credentials, setting up state). Placed after tool filtering
297
+ // so extension-provided skills/prompts from extendResourcesFromExtensions()
298
+ // respect the active tool set. All ExtensionBindings fields are optional.
299
+ await session.bindExtensions({
300
+ onError: (err) => {
301
+ options.onToolActivity?.({
302
+ type: "end",
303
+ toolName: `extension-error:${err.extensionPath}`,
304
+ });
305
+ },
306
+ });
307
+
295
308
  options.onSessionCreated?.(session);
296
309
 
297
310
  // Track turns for graceful max_turns enforcement