mirror of
https://github.com/block/goose.git
synced 2026-06-02 06:19:33 +02:00
Build summon instructions per turn (#9329)
Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -428,11 +428,8 @@ impl Drop for SummonClient {
|
||||
|
||||
impl SummonClient {
|
||||
pub fn new(context: PlatformExtensionContext) -> Result<Self> {
|
||||
let instructions = build_subagent_instructions(context.session.as_deref());
|
||||
|
||||
let info = InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
|
||||
.with_server_info(Implementation::new(EXTENSION_NAME, "1.0.0").with_title("Summon"))
|
||||
.with_instructions(instructions);
|
||||
.with_server_info(Implementation::new(EXTENSION_NAME, "1.0.0").with_title("Summon"));
|
||||
|
||||
Ok(Self {
|
||||
info,
|
||||
@@ -1744,6 +1741,15 @@ impl McpClientTrait for SummonClient {
|
||||
Some(&self.info)
|
||||
}
|
||||
|
||||
fn get_instructions(&self) -> Option<String> {
|
||||
let instructions = build_subagent_instructions(self.context.session.as_deref());
|
||||
if instructions.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(instructions)
|
||||
}
|
||||
}
|
||||
|
||||
async fn subscribe(&self) -> mpsc::Receiver<ServerNotification> {
|
||||
let (tx, rx) = mpsc::channel(16);
|
||||
self.notification_subscribers.lock().await.push(tx);
|
||||
|
||||
Reference in New Issue
Block a user