Skip to content

Refactor agentStart.ts and agentMessage.ts to remove global agentStates #308

@bhouston

Description

@bhouston

Refactor agentStart.ts and agentMessage.ts to remove global agentStates

Description

The agent package currently uses a globally declared agentStates Map in agentStart.ts which is redundant since we already have the agentTracker that's passed into the execute function as part of the context. This refactor will remove the global agentStates and update both agentStart.ts and agentMessage.ts to use the agentTracker exclusively.

Why

  • Removes redundant state management
  • Simplifies the code
  • Makes the agent state management more consistent
  • Reduces potential for bugs from having state in two places

Implementation Details

  1. Remove the global agentStates Map from agentStart.ts
  2. Update agentStart.ts to use agentTracker exclusively
  3. Update agentMessage.ts to use agentTracker instead of importing agentStates
  4. Update any tests that rely on the global agentStates

Acceptance Criteria

  • All functionality remains the same
  • All tests pass
  • Build completes successfully
  • No global state is used for agent tracking

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions