microsoft / microsoft/conductor
feat(schema): add max_tokens field to AgentDef for per-agent override
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 448
- Forks
- 65
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
Summary
AgentDef has no max_tokens field. The fallback logic in agent_builder.py already exists:
agent_max_tokens = getattr(agent, "max_tokens", None)
max_tokens = agent_max_tokens if agent_max_tokens is not None else default_max_tokens
But since AgentDef uses extra="forbid" and has no max_tokens field, specifying it in YAML causes a validation error, and getattr always returns None.
Use Case
In multi-agent workflows, different agents have different output length requirements:
・Creator agents: need large max_tokens(e.g. 32768) to generate long artifacts.
・Reviewer agents: only produce short reviews, a smaller max_tokens (e.g. 8192) suffices and reduces cost.
Proposal
Add max_tokens to AgentDef in schema.py
max_tokens: int | None = None
This enables per-agent configuration in YAML:
agents:
- name: creator
max_tokens: 32768
prompt: !file prompt_creator.md
- name: reviewer
max_tokens: 8192
prompt: !file prompt_reviewer.md
No logic change needed -- the fallback in agent_builder.py already handles it. Default behavior is unchanged (omitted -> inherits runtime.max_tokens).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading AgentDef in schema.py and the existing fallback logic in agent_builder.py. Add the field so YAML accepts per-agent max_tokens values, while confirming that omitted values still inherit runtime.max_tokens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100