Protocol
Pydantic models for the harness↔agent message protocol.
Task (harness → agent) and Decision (agent → harness) message contracts, plus supporting types.
| CLASS | DESCRIPTION |
|---|---|
ActionItem |
A single action to be executed by the harness after a decision. |
DecisionMessage |
Decision returned from an agent to the harness. |
DecisionType |
Valid agent decision values. |
LLMBackendRef |
Reference to the LLM backend the agent should use. |
TaskContext |
Context injected by the harness into each task. |
TaskMessage |
Task sent from the harness to an agent container. |
Classes¶
ActionItem
pydantic-model
¶
Bases: BaseModel
A single action to be executed by the harness after a decision.
Extra fields are allowed to support future action types without schema changes.
| PARAMETER | DESCRIPTION |
|---|---|
type
|
Action type identifier (e.g.
TYPE:
|
Show JSON schema:
{
"additionalProperties": true,
"description": "A single action to be executed by the harness after a decision.\n\nExtra fields are allowed to support future action types without schema changes.",
"properties": {
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "ActionItem",
"type": "object"
}
Config:
default:{'extra': 'allow'}
Fields:
DecisionMessage
pydantic-model
¶
Bases: BaseModel
Decision returned from an agent to the harness.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
Must match the
TYPE:
|
decision
|
The agent's decision on how to handle the task.
TYPE:
|
rationale
|
Human-readable explanation of the decision.
TYPE:
|
actions
|
Ordered list of actions for the harness to execute.
TYPE:
|
Show JSON schema:
{
"$defs": {
"ActionItem": {
"additionalProperties": true,
"description": "A single action to be executed by the harness after a decision.\n\nExtra fields are allowed to support future action types without schema changes.",
"properties": {
"type": {
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "ActionItem",
"type": "object"
},
"DecisionType": {
"description": "Valid agent decision values.",
"enum": [
"label_and_respond",
"close",
"escalate",
"skip"
],
"title": "DecisionType",
"type": "string"
}
},
"description": "Decision returned from an agent to the harness.",
"properties": {
"task_id": {
"title": "Task Id",
"type": "string"
},
"decision": {
"$ref": "#/$defs/DecisionType"
},
"rationale": {
"title": "Rationale",
"type": "string"
},
"actions": {
"default": [],
"items": {
"$ref": "#/$defs/ActionItem"
},
"title": "Actions",
"type": "array"
}
},
"required": [
"task_id",
"decision",
"rationale"
],
"title": "DecisionMessage",
"type": "object"
}
Fields:
-
task_id(str) -
decision(DecisionType) -
rationale(str) -
actions(list[ActionItem])
Attributes¶
actions
pydantic-field
¶
actions: list[ActionItem] = []
Ordered list of actions for the harness to execute.
LLMBackendRef
pydantic-model
¶
TaskContext
pydantic-model
¶
Bases: BaseModel
Context injected by the harness into each task.
| PARAMETER | DESCRIPTION |
|---|---|
llm_backend
|
LLM backend the agent should use for this task.
TYPE:
|
memory_summary
|
LLM-generated summary of prior actions on this issue/repo, if any.
TYPE:
|
Show JSON schema:
{
"$defs": {
"LLMBackendRef": {
"description": "Reference to the LLM backend the agent should use.",
"properties": {
"provider": {
"title": "Provider",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
}
},
"required": [
"provider",
"model"
],
"title": "LLMBackendRef",
"type": "object"
}
},
"description": "Context injected by the harness into each task.",
"properties": {
"llm_backend": {
"$ref": "#/$defs/LLMBackendRef"
},
"memory_summary": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Memory Summary"
}
},
"required": [
"llm_backend"
],
"title": "TaskContext",
"type": "object"
}
Fields:
-
llm_backend(LLMBackendRef) -
memory_summary(str | None)
Attributes¶
llm_backend
pydantic-field
¶
llm_backend: LLMBackendRef
LLM backend the agent should use for this task.
TaskMessage
pydantic-model
¶
Bases: BaseModel
Task sent from the harness to an agent container.
The harness generates a task_id automatically if not supplied.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
Unique identifier for this task (UUID4).
TYPE:
|
type
|
Task type (e.g.
TYPE:
|
repo
|
Repository in
TYPE:
|
payload
|
Raw GitHub event payload. |
context
|
Harness-injected context (memory summary, LLM backend).
TYPE:
|
Show JSON schema:
{
"$defs": {
"LLMBackendRef": {
"description": "Reference to the LLM backend the agent should use.",
"properties": {
"provider": {
"title": "Provider",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
}
},
"required": [
"provider",
"model"
],
"title": "LLMBackendRef",
"type": "object"
},
"TaskContext": {
"description": "Context injected by the harness into each task.",
"properties": {
"llm_backend": {
"$ref": "#/$defs/LLMBackendRef"
},
"memory_summary": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Memory Summary"
}
},
"required": [
"llm_backend"
],
"title": "TaskContext",
"type": "object"
}
},
"description": "Task sent from the harness to an agent container.\n\nThe harness generates a ``task_id`` automatically if not supplied.",
"properties": {
"task_id": {
"title": "Task Id",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"repo": {
"title": "Repo",
"type": "string"
},
"payload": {
"additionalProperties": true,
"title": "Payload",
"type": "object"
},
"context": {
"$ref": "#/$defs/TaskContext"
}
},
"required": [
"type",
"repo",
"payload",
"context"
],
"title": "TaskMessage",
"type": "object"
}
Fields:
Attributes¶
context
pydantic-field
¶
context: TaskContext
Harness-injected context (memory summary, LLM backend).