pub struct AgentResponse {
pub answer: String,
pub questions: Vec<QuestionItem>,
pub review_comment_outcomes: Vec<ReviewCommentOutcome>,
pub subtasks: Vec<SubtaskItem>,
pub summary: Option<AgentResponseSummary>,
pub verification_verdicts: Vec<VerificationVerdictItem>,
}Expand description
Wire-format protocol payload used for schema-driven provider output.
Providers that support output schemas (for example, Codex app-server) are asked to emit this object as the entire assistant response payload.
Fields§
§answer: StringMarkdown answer text emitted for this turn.
questions: Vec<QuestionItem>Ordered clarification questions emitted for this turn.
The canonical JSON Schema description for this field is produced by
[questions_field_description] and injected at schema generation time
by inject_dynamic_schema_guidance. The static schemars metadata
here only sets the field title; the description is intentionally
omitted so the helper is the single source of truth.
review_comment_outcomes: Vec<ReviewCommentOutcome>Per-thread outcomes for an agent-driven forge comment-resolution turn.
Ordinary session and utility turns leave this empty. Resolution workflows accept only identifiers explicitly allowlisted in the turn prompt before applying any forge-side effect.
subtasks: Vec<SubtaskItem>Proposed child-session subtasks for an orchestrator planning turn.
The canonical JSON Schema description is produced by
[subtasks_field_description] and injected at schema generation time,
so the static schemars metadata here only sets the field title.
Ordinary session and utility turns leave this empty, and orchestration
consumers ignore it unless the turn prompt asked for a plan.
summary: Option<AgentResponseSummary>Structured summary for session-discussion turns, or None for legacy
payloads and one-shot prompts.
verification_verdicts: Vec<VerificationVerdictItem>Per-task decisions emitted for an orchestration verification turn.
Ordinary turns leave this empty. The controller must copy task keys from the coordinator envelope so only explicit passes can proceed to integration.
Implementations§
Source§impl AgentResponse
impl AgentResponse
Sourcepub fn plain(text: impl Into<String>) -> Self
pub fn plain(text: impl Into<String>) -> Self
Creates a plain response from raw text as one answer string.
Sourcepub fn to_display_text(&self) -> String
pub fn to_display_text(&self) -> String
Returns display text by joining non-empty answer and question text with blank lines.
Sourcepub fn to_answer_display_text(&self) -> String
pub fn to_answer_display_text(&self) -> String
Returns transcript text for session output by joining non-empty
answer content with blank lines.
Sourcepub fn answers(&self) -> Vec<String>
pub fn answers(&self) -> Vec<String>
Returns the answer as one single-item vector when it is non-empty.
Sourcepub fn question_items(&self) -> Vec<QuestionItem>
pub fn question_items(&self) -> Vec<QuestionItem>
Returns up to [MAX_QUESTIONS] clarification questions in response
order.
Sourcepub fn subtask_items(&self) -> Vec<SubtaskItem>
pub fn subtask_items(&self) -> Vec<SubtaskItem>
Returns up to [MAX_SUBTASKS] proposed subtasks in response order.
Callers must still reject plans whose keys collide; this only bounds how much of a runaway plan is considered.
Sourcepub fn verification_verdict_items(&self) -> Vec<VerificationVerdictItem>
pub fn verification_verdict_items(&self) -> Vec<VerificationVerdictItem>
Returns up to [MAX_SUBTASKS] verification decisions in response
order.
Trait Implementations§
Source§impl Clone for AgentResponse
impl Clone for AgentResponse
Source§fn clone(&self) -> AgentResponse
fn clone(&self) -> AgentResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentResponse
impl Debug for AgentResponse
Source§impl<'de> Deserialize<'de> for AgentResponse
impl<'de> Deserialize<'de> for AgentResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AgentResponse
Source§impl JsonSchema for AgentResponse
impl JsonSchema for AgentResponse
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more