Reviewer · Code Style
Prefer keyword arguments
When calling functions or constructors that take more than one or two parameters, pass arguments by keyword rather than position. This makes call sites self-documenting and prevents silent bugs when a signature's parameter order changes later. For example, prefer:
When calling functions or constructors that take more than one or two parameters, pass arguments by keyword rather than position. This makes call sites self-documenting and prevents silent bugs when a signature’s parameter order changes later. For example, prefer:
swarm_arrangement = SwarmRearrange(
name=name,
description=description,
swarms=swarms,
output_type=output_type,
)
over the positional form, which previously bound output_type to the wrong parameter after the constructor’s argument order changed.
This same “keep things tidy after a refactor” discipline applies to related code organization concerns: when you remove or change parameters, types, or annotations, immediately clean up anything left dangling — unused imports (e.g. a Dict import left over after removing typed parameters), class-level annotations that duplicate an assignment already made in __init__, or ad-hoc inline literal expressions (Literal[get_reasoning_efforts()]) that should instead be a single named type alias reused everywhere it’s needed. Keeping call sites explicit and removing stale artifacts after refactors makes the codebase easier to read, review, and safely evolve.