fix: forward modelRegistry and model to workflow subagents - #15
Merged
Michaelliv merged 1 commit intoMay 31, 2026
Merged
Conversation
Subagents created by the workflow tool fail silently because createAgentSession() receives no modelRegistry or model, so the LLM provider cannot authenticate. This passes the parent session's modelRegistry and model from the tool execution context through to the WorkflowAgent, matching how @tintinweb/pi-subagents handles the same case. Fixes: subagents returning null/empty output despite appearing to complete successfully.
Michaelliv
force-pushed
the
fix/forward-modelregistry-to-subagents
branch
from
May 31, 2026 06:12
3fda335 to
33f7285
Compare
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
Subagents spawned by the workflow tool fail silently -- they return
nullor empty strings even for trivial tasks likeecho "test". The workflow tool reports "N agent(s) completed" but produces no usable output.Root Cause
The
WorkflowAgentcreates subagent sessions viacreateAgentSession()withSettingsManager.inMemory()but never passesmodelRegistryormodel. WithoutmodelRegistry, the subagent session cannot authenticate to the LLM provider --session.prompt()either fails silently or returns empty responses.By contrast, the
Agenttool from@tintinweb/pi-subagentsworks correctly because it explicitly passes:Fix
In
src/workflow-tool.ts, passmodelRegistryandmodelfrom the tool execution context into therunWorkflowoptions as asessionproperty. This flows through:Verification
Tested with a minimal workflow (echo test with structured output schema) -- subagents now produce correct JSON output instead of returning null. A 5-agent inspection workflow on a real project also completed successfully with all agents returning structured results.