Skip to content

fix: preserve custom name/description on SupervisorAgent#536

Open
nuthalapativarun wants to merge 1 commit into
2FastLabs:mainfrom
nuthalapativarun:fix/254-supervisor-agent-name-desc
Open

fix: preserve custom name/description on SupervisorAgent#536
nuthalapativarun wants to merge 1 commit into
2FastLabs:mainfrom
nuthalapativarun:fix/254-supervisor-agent-name-desc

Conversation

@nuthalapativarun

Copy link
Copy Markdown

Issue Link (REQUIRED)

Fixes #254

Summary

Changes

SupervisorAgent unconditionally overwrote options.name and options.description with 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):

# before
options.name = options.lead_agent.name
options.description = options.lead_agent.description

# after
options.name = options.name or options.lead_agent.name
options.description = options.description or options.lead_agent.description

TypeScript (typescript/src/agents/supervisorAgent.ts):

// before
super({ ...options, name: options.leadAgent.name, description: options.leadAgent.description });

// after
super({ ...options, name: options.name ?? options.leadAgent.name, description: options.description ?? options.leadAgent.description });

User experience

Before: passing name="My Supervisor" to SupervisorAgentOptions had no effect — the name was replaced by the lead agent's name.

After: user-supplied name/description are preserved; the lead agent's values are used only as defaults when none are provided.

Checklist

  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • I have linked this PR to an existing issue (required)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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
@cornelcroi

Copy link
Copy Markdown
Collaborator

Hey @nuthalapativarun,

Three things need to be fixed before this can merge. First, the TypeScript change in supervisorAgent.ts has no test coverage — please add a test equivalent to what the Python side has in test_supervisor_agent.py (lines 105–120), confirming that a caller-supplied name is preserved and that the lead agent name is used as fallback when none is given. Second, Python uses or which treats an empty string "" as falsy and falls through to the lead agent name, while TypeScript uses ?? which only falls back on null/undefined — passing name="" would behave differently between the two implementations. They need to be aligned, either both use or/|| or both use ??? with an explicit empty-string check. Third, CI has not run — no checks are reported on this branch. All checks must pass before merge.

One smaller thing: the checklist says "Changes are documented" but there is no update in docs/ showing the new behaviour. Not a hard blocker if you decide no doc page covers this, but worth double-checking.

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.

Bug: Supervisor Agent Name/Desc

2 participants