chore: fix biome noExcessiveCognitiveComplexity warnings #458
Reference in New Issue
Block a user
Delete Branch "fix/444-biome-complexity-warnings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Refactored runBuiltinLoop function in packages/workflow-agent-builtin/src/loop.ts to reduce cognitive complexity from 30 to below 15.
Why
The function exceeded Biome's cognitive complexity threshold (noExcessiveCognitiveComplexity warning), making the code harder to understand and maintain.
Changes
Extracted helper functions from runBuiltinLoop:
Added 24 new unit tests for the extracted helper functions, bringing total test count to 41 (all passing). All existing behavior is preserved.
Ref
Fixes #444
LGTM 👍 干净的重构,测试覆盖充分。
turnsRemaining > 0的新增检查是个好的 bugfix。