Skip to content

fix(pi-subagents): inherit models and finalize provider errors - #42

Merged
tasercake merged 1 commit into
mainfrom
worktree/fix-subagent-model-provider-errors-20260725084644
Jul 25, 2026
Merged

fix(pi-subagents): inherit models and finalize provider errors#42
tasercake merged 1 commit into
mainfrom
worktree/fix-subagent-model-provider-errors-20260725084644

Conversation

@tasercake

Copy link
Copy Markdown
Owner

Summary

  • inherit the active parent provider/model whenever spawn_subagent.model is omitted, while preserving explicit overrides
  • pass, persist, and report the effective model consistently
  • finalize terminal provider/model failures promptly and nonzero after Pi's canonical message_end + agent_settled lifecycle, preserving provider error text
  • synchronize schema, tool, skill, README, and Pi compatibility metadata

Root Cause

  1. An omitted model never reached child CLI args, so each fresh child independently selected the global default instead of the active parent model.
  2. The child fd 3 lifeline intentionally keeps its event loop alive. On a terminal provider error, print mode only set a nonzero exit code; the open lifeline prevented natural process exit, so the parent never observed OS close and never finalized the record.

Validation

  • strict TDD: added regression tests first and observed failures for missing model inheritance/contract and missing terminal-error lifecycle handlers
  • npm test in extensions/pi-subagents: 48 passed, 1 provider-backed integration skipped by its existing opt-in guard
  • npm run test:integration in extensions/pi-subagents: 0 tests, passed
  • npx tsc --noEmit in extensions/pi-subagents: passed
  • npm pack --dry-run in extensions/pi-subagents: passed
  • repository CI-equivalent package tests: agentmemory 67 passed; context-usage 18 passed; pi-hermes-memory checks passed; pi-subagents 48 passed / 1 opt-in skip
  • git diff --check: passed

Regression coverage includes inherited canonical model args and persistence, explicit override precedence, prompt-runtime nonzero provider failure exit, provider error/fallback/finalization and single notification, abort and success semantics, timeout notification-only behavior, and the existing recursive fd 3 lifeline suite.

Compatibility

  • requires Pi >=0.80.4, the release that introduced the supported agent_settled extension event
  • no Pi core, pi-connect, provider config, settings parsing, process groups, polling, or watchdog changes
  • success, abort, timeout notification-only semantics, recursive spawning, and the dedicated fd 3 lifeline remain unchanged

@tasercake
tasercake merged commit 70fe8e5 into main Jul 25, 2026
1 check passed
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.

1 participant