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

1 participant