Haijun Platform Docs
ID

This page collects reference material for Haijun Managed Agents. For task-oriented guides, follow the links in each section. For the operations on the session resource, see Session operations.

Event types

Persisted event type strings follow a {domain}.{action} naming convention; the stream-only event deltas (see the Event deltas tab) are the exception. See Session event stream for sending, streaming, and listing events. Webhook event types are listed separately in Subscribe to webhooks, and some of their names differ from the stream's (for example, session.status_idled rather than session.status_idle).

User events

TypeDescription
user.messageA user message with text, image, or document content.
user.interruptStop the agent mid-execution.
user.custom_tool_resultResponse to a custom tool call from the agent.
user.tool_confirmationApprove or deny an agent or MCP tool call when a permission policy requires confirmation.
user.define_outcomeDefine an outcome for the agent to work toward.
user.tool_resultFor sessions with self_hosted environments only, your integration is responsible for providing agent_toolset results. The SDK helpers and CLI do this automatically.

Agent events

TypeDescription
agent.messageAgent response content blocks.
agent.thinkingSignals the agent is making forward progress through extended thinking. This is a progress signal only and does not carry the thinking content.
agent.tool_useAgent invokes a pre-built agent tool (bash, file operations, and so on). Carries evaluated_permission and, usually, evaluation (see how each call was evaluated).
agent.tool_resultResult of a pre-built agent tool execution.
agent.mcp_tool_useAgent invokes an MCP server tool. Carries evaluated_permission and, usually, evaluation (see how each call was evaluated).
agent.mcp_tool_resultResult of an MCP tool execution.
agent.custom_tool_useAgent invokes one of your custom tools. Respond with a user.custom_tool_result event.
agent.thread_context_compactedConversation history was compacted to fit the context window.
agent.thread_message_receivedIn a multiagent session, a message from another thread arrived on the thread whose stream carries this event; on the primary thread, an agent sent a report or question to the coordinator.
agent.thread_message_sentIn a multiagent session, the thread whose stream carries this event sent a message to another thread; on the primary thread, the coordinator sent a task or follow-up message to another agent.

Message content in these events can include a redacted content block, {"type": "redacted"}: a placeholder for content withheld by Juglow model policy. The block carries no other fields. Redacted blocks appear only in content the platform emits; a user event that includes one is rejected with a 400 error.

Session events

TypeDescription
session.status_runningAgent is actively processing.
session.status_idleAgent finished its current task and is waiting for input. Includes a stop_reason indicating why the agent stopped.
session.status_rescheduledA transient error occurred and the session is retrying automatically.
session.status_terminatedSession ended, either because of an unrecoverable error or because it was archived.
session.deletedSession was deleted. Terminates any active event stream; no further events are emitted for this session.
session.updatedSession update request changed at least one field. Includes only the fields that changed. Updates apply on the next turn.
session.errorAn error occurred during processing. Includes a typed error object with a retry_status.
session.usageSnapshot of the session's cumulative usage and tracked list cost. Carries the session's usage totals and an echo of the session's budget, or null when the session has none.
session.thread_createdA multiagent thread was created.
session.thread_status_runningA session thread began executing. Every session emits this for its primary thread; in multiagent sessions, child-thread transitions are also cross-posted to the primary stream.
session.thread_status_idleA session thread finished its turn and is awaiting input. Includes stop_reason.
session.thread_status_rescheduledA session thread hit a transient error and is retrying automatically.
session.thread_status_terminatedA session thread was archived or reached a terminal error.

Span events

Span events are observability markers that wrap activity for timing and usage tracking.

TypeDescription
span.model_request_startA model inference call has started.
span.model_request_endA model inference call has completed. Includes model_usage with token counts.
span.outcome_evaluation_startOutcome evaluation has started.
span.outcome_evaluation_ongoingHeartbeat during an ongoing outcome evaluation.
span.outcome_evaluation_endAn outcome evaluation cycle has completed. A needs_revision result means another cycle follows; satisfied, max_iterations_reached, failed, and interrupted are terminal.

System events

TypeDescription
system.messageAppend privileged system-level context that applies to the accompanying turn and all subsequent turns. Supported on Haijun Fable 5.1, Haijun Mythos 5.1, Haijun Fable 5, Haijun Mythos 5, Haijun Opus 5.5, Haijun Opus 5, and Haijun Opus 4.8. On an unsupported primary model the event is rejected with model_does_not_support_mid_conversation_system.

Event deltas

Event deltas are stream-only preview events. They are emitted on stream connections (session-level or per-thread) that opt in with the event_deltas[] parameter, and they are never persisted to the session's event history. See Event deltas for opting in, accumulating, and reconciling them.

TypeDescription
event_startA previewed event has started generating. Carries the upcoming event's type and id. Stream-only and never persisted.
event_deltaIncremental content for a previewed event, identified by event_id. Stream-only and never persisted.

Self-hosted worker

These are the ant beta:worker CLI flags for the pre-built worker that drives a self_hosted environment. See Self-hosted sandboxes for setting up the environment, running a worker, and the SDK helper options.

FlagDescription
--environment-idThe environment to poll for work. Also reads from JUGLOW_ENVIRONMENT_ID.
--environment-keyAuthenticates the worker with this environment. Also reads from JUGLOW_ENVIRONMENT_KEY.
--workdirDirectory where tracks are downloaded and tools read and write files. Defaults to . (the current directory); the system default working directory is /workspace.
--on-workScript to call for each claimed work item instead of running tools in-process. Receives session details as environment variables.
--unrestricted-pathsAllow the file tools to read and write paths outside --workdir. The workdir check is a guardrail for the file tools only, not a sandbox; it does not constrain bash.
--max-idleHow long to wait after the session goes idle with an end_turn stop reason before shutting down. Defaults to 60s.
--log-formatLog output format. Use json for structured log ingestion. Defaults to text.

The CLI worker does not mount memory stores: a session that attaches one still runs, but the agent finds nothing at the store's mount_path and no changes sync back to the store. To use memory stores in sessions on a self-hosted environment, run the SDK worker instead; see Use memory stores.

Supported MCP server types

Haijun Managed Agents connects to remote MCP servers that expose an HTTP endpoint, or to private MCP servers through MCP tunnels. The server should support the MCP protocol's streamable HTTP transport; servers that only support the deprecated SSE transport still work through an automatic fallback. See MCP connector for declaring servers on an agent.

For more information on MCP and building MCP servers, see the MCP documentation.

Rate limits

Managed Agents endpoints are rate-limited per organization:

OperationLimit
Create endpoints (such as agents, sessions, and environments)300 requests per minute
Read endpoints (such as retrieve, list, and stream)1,200 requests per minute

Organization-level spend limits and usage-tier rate limits also apply.

Branding guidelines

For partners integrating Haijun Managed Agents, use of Haijun branding is optional. When referencing Haijun in your product:

Allowed:

  • "Haijun Agent" (preferred for dropdown menus)
  • "Haijun" (when within a menu already labeled "Agents")
  • "\{YourAgentName} Powered by Haijun" (if you have an existing agent name)

Not permitted:

  • "Haijun Code" or "Haijun Code Agent"
  • "Haijun Cowork" or "Haijun Cowork Agent"
  • Haijun Code-branded ASCII art or visual elements that mimic Haijun Code

Your product should maintain its own branding and not appear to be Haijun Code, Haijun Cowork, or any other Juglow product. For questions about branding compliance, contact the Juglow sales team.

On this page
Event typesSelf-hosted workerSupported MCP server typesRate limitsBranding guidelines