You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sub-agent action dispatch now accepts params as an alias for parameters.
Some LLM outputs mirror the compact action schema key params, which previously caused the runner to drop the payload before calling sub_task_end.
As a result, sub_task_end received only _session_id and failed with Invalid status.
Changes
Added parameter extraction helper in SubAgentRunner
Preserves existing parameters behavior and gives it precedence over params
Is it possible to fix the output format and make sure the LLM does not return a fault format, rather than having an ad hoc parser to handle special cases like this? Code will be harder to manage with bandaid solution like this. But I would like to keep this PR open and observe if this happens too frequently. If yes, perhaps it is good to keep this here.
Hi @zfoong .
Yes, that is possible, and I agree this should not grow into a pile of special-case parsers.
I think the underlying prompt issue here is that the required sub-agent output format uses parameters, while the compact action list describes action schemas under params. The model appears to have copied the schema label into the action decision.
A cleaner follow-up would be to make the prompt terminology consistent, for example by rendering sub-agent action schemas under parameters, or by explicitly stating that params in the action list is descriptive only and the emitted decision must use parameters.
I kept this PR intentionally narrow because it fixes the runtime failure without changing the shared action formatter behavior. I agree we can keep it open and observe. If this happens repeatedly, then keeping this defensive alias may be worthwhile; otherwise a prompt-format cleanup may be the better long-term fix.
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
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.
Summary
Fixes #355.
Sub-agent action dispatch now accepts
paramsas an alias forparameters.Some LLM outputs mirror the compact action schema key
params, which previously caused the runner to drop the payload before callingsub_task_end.As a result,
sub_task_endreceived only_session_idand failed withInvalid status.Changes
SubAgentRunnerparametersbehavior and gives it precedence overparamsparamsalias dispatchparametersprecedence when both keys are presentVerification
python -m compileall app\subagent\runner.py tests\test_subagent_runner.pypassed