Skip to content

AgentGateway

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api/src/agent/agent.gateway.ts

Implements: OnGatewayConnection, OnGatewayDisconnect

Methods

MethodSignatureReturns
handleConnectionhandleConnection(client: Socket)void
handleDisconnecthandleDisconnect(client: Socket)void
handleStarthandleStart(client: Socket, payload: AgentStartPayload)Promise<void>
handleSendhandleSend(client: Socket, payload: AgentSendPayload)Promise<void>
handleInjecthandleInject(client: Socket, payload: AgentInjectPayload)void
handleCancelhandleCancel(client: Socket)void
handleEndhandleEnd(client: Socket)void
handleGetTodohandleGetTodo(client: Socket)void
handleVerboseTogglehandleVerboseToggle(client: Socket, payload: { enabled?: boolean })void
handleStatushandleStatus(client: Socket)void

Properties

PropertyType
serverServer

Where it refuses work

  • AgentGateway stops the work with an early return when !managed, in 2 places.
  • AgentGateway stops the work with an early return when !err.
  • AgentGateway stops the work with an early return when err.constructor?.name === 'ModelBehaviorError'.
  • AgentGateway stops the work with an early return when typeof err.message === 'string' && err.message.includes('Model did not produce a final re….

When something fails

  • AgentGateway handles failure in 3 places: it logs it and continues in all 3.

Referenced By

  • AgentModule (MODULE_PROVIDES)
  • AgentModule (MODULE_EXPORTS)

Was this page helpful?

Download as PDF