Function commitDeveloperMessage

  • Commits a developer-generated message to the active agent in the swarm system. Validates the agent, session, and swarm, ensuring the current agent matches the provided agent before committing the message. Runs within a beginContext wrapper for execution context management, logging operations via LoggerService. Integrates with AgentValidationService (agent validation), SessionValidationService (session and swarm retrieval), SwarmValidationService (swarm validation), SwarmPublicService (agent retrieval), SessionPublicService (message committing), and LoggerService (logging). Complements functions like commitSystemMessage by handling developer messages (e.g., user or developer instructions) rather than system-generated or assistant-generated responses.

    Parameters

    • content: string

      The content of the developer message to commit, typically related to user or developer instructions.

    • clientId: string

      The ID of the client associated with the session, validated against active sessions.

    • agentName: string

      The name of the agent to commit the message for, validated against registered agents.

    Returns Promise<void>

    A promise that resolves when the message is committed or skipped (e.g., agent mismatch).

    If agent, session, or swarm validation fails, propagated from respective validation services.