Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/goose-providers/src/conversation/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,11 @@ pub struct MessageMetadata {
pub agent_visible: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub inference: Option<InferenceMetadata>,
/// Whether this message is a steer injected into an active run. UI-only:
/// surfaced as `_meta.goose.steer` so clients can mark the steer boundary
/// without matching user-visible text. Never sent to providers.
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
pub steer: bool,
}

impl Default for MessageMetadata {
Expand All @@ -675,6 +680,7 @@ impl Default for MessageMetadata {
user_visible: true,
agent_visible: true,
inference: None,
steer: false,
}
}
}
Expand Down Expand Up @@ -743,6 +749,11 @@ impl MessageMetadata {
self.inference = Some(inference);
self
}

pub fn with_steer(mut self) -> Self {
self.steer = true;
self
}
}

#[derive(ToSchema, Clone, PartialEq, Serialize, Deserialize, Debug)]
Expand Down Expand Up @@ -1028,6 +1039,11 @@ impl Message {
self
}

pub fn with_steer(mut self) -> Self {
self.metadata.steer = true;
self
}

pub fn with_inference_if_assistant(self, inference: InferenceMetadata) -> Self {
if self.role == Role::Assistant && self.metadata.inference.is_none() {
self.with_inference(inference)
Expand Down
26 changes: 25 additions & 1 deletion crates/goose-sdk-types/src/custom_requests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use agent_client_protocol::schema::McpServer;
use agent_client_protocol::schema::{ContentBlock, McpServer};
use agent_client_protocol::{JsonRpcRequest, JsonRpcResponse};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -140,6 +140,30 @@ pub struct SetSessionSystemPromptRequest {
pub text: String,
}

/// Add user input to the currently active prompt without starting a new prompt.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(
method = "_goose/unstable/session/steer",
response = SteerSessionResponse
)]
#[serde(rename_all = "camelCase")]
pub struct SteerSessionRequest {
pub session_id: String,
#[serde(default)]
pub prompt: Vec<ContentBlock>,
pub expected_run_id: String,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcResponse)]
#[serde(rename_all = "camelCase")]
pub struct SteerSessionResponse {
pub run_id: String,
/// Stable id of the queued steer message. The same id later appears as
/// `messageId` on the streamed `UserMessageChunk` (with `_meta.goose.steer`),
/// letting clients correlate a queued steer with its pickup.
pub message_id: String,
}

/// Delete a session.
#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema, JsonRpcRequest)]
#[request(method = "session/delete", response = EmptyResponse)]
Expand Down
5 changes: 5 additions & 0 deletions crates/goose/acp-meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"requestType": "SetSessionSystemPromptRequest_unstable",
"responseType": "EmptyResponse"
},
{
"method": "_goose/unstable/session/steer",
"requestType": "SteerSessionRequest_unstable",
"responseType": "SteerSessionResponse_unstable"
},
{
"method": "session/delete",
"requestType": "DeleteSessionRequest",
Expand Down
Loading
Loading