Skip to content

Rename MainLoop to AgentLoop throughout codebase#6

Closed
andreisavu wants to merge 2 commits intomainfrom
claude/rename-mainloop-agentloop-oVn63
Closed

Rename MainLoop to AgentLoop throughout codebase#6
andreisavu wants to merge 2 commits intomainfrom
claude/rename-mainloop-agentloop-oVn63

Conversation

@andreisavu
Copy link
Member

Summary

This PR renames all references to MainLoop to AgentLoop throughout the trivia agent codebase to better reflect its purpose as a production agent processing loop. This is a comprehensive refactoring that updates documentation, type aliases, imports, and all usage sites.

Key Changes

  • Type aliases: Created import aliases in dispatch.py, mailboxes.py, and worker.py to map MainLoop* types to AgentLoop* names:

    • MainLoopRequestAgentLoopRequest
    • MainLoopResultAgentLoopResult
    • MainLoopConfigAgentLoopConfig
    • MainLoopAgentLoop
  • Class renaming: Updated TriviaAgentLoop class to extend the aliased AgentLoop type instead of MainLoop

  • Documentation updates: Updated all docstrings, comments, and markdown files (AGENTS.md, README.md) to reference AgentLoop instead of MainLoop

  • Test updates: Updated test file imports and mock patches to use the new AgentLoopRequest and AgentLoopResult aliases

Implementation Details

  • Used import aliases rather than modifying the upstream weakincentives library, maintaining compatibility while improving local naming clarity
  • All type hints and mailbox definitions updated consistently across the codebase
  • Documentation diagrams and examples updated to reflect the new terminology
  • No functional changes—this is purely a naming/documentation refactor

- Update imports to use aliasing (MainLoop as AgentLoop, etc.)
- Update all code references to use AgentLoop naming
- Update docstrings and comments throughout the codebase
- Update documentation in AGENTS.md and README.md
- Update test files to use the new naming

This terminology change makes the code more relatable and aligns
with mainstream agent terminology, combining well with EvalLoop.
@andreisavu andreisavu closed this Jan 26, 2026
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.

2 participants