fix: preserve custom name/description on SupervisorAgent#536
fix: preserve custom name/description on SupervisorAgent#536nuthalapativarun wants to merge 2 commits into
Conversation
Options-provided name and description were unconditionally overwritten with the lead_agent's values. Use them as fallback only when the caller did not supply their own. Fixes 2FastLabs#254
|
Hey @nuthalapativarun, Three things need to be fixed before this can merge. First, the TypeScript change in One smaller thing: the checklist says "Changes are documented" but there is no update in |
Use `||` instead of `??` so an empty string also falls back to the lead_agent's name/description, matching the Python implementation's `or` semantics. Adds a TS test mirroring test_supervisor_agent_preserves_custom_name_and_description in python/src/tests/agents/test_supervisor_agent.py. Addresses review feedback on 2FastLabs#536.
|
Thanks for the review, @cornelcroi — addressed both points in 5eaa10e:
Full TS jest suite passes locally (12 suites / 99 tests, including the new file), and |
Issue Link (REQUIRED)
Fixes #254
Summary
Changes
SupervisorAgentunconditionally overwroteoptions.nameandoptions.descriptionwith the lead agent's values, even when the caller supplied their own. Changed both Python and TypeScript implementations to use the caller-provided values and fall back to the lead agent's values only when none were given.Python (
python/src/agent_squad/agents/supervisor_agent.py):TypeScript (
typescript/src/agents/supervisorAgent.ts):User experience
Before: passing
name="My Supervisor"toSupervisorAgentOptionshad no effect — the name was replaced by the lead agent's name.After: user-supplied
name/descriptionare preserved; the lead agent's values are used only as defaults when none are provided.Checklist
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.