fix(tom): read messages from config (#12634)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::agents::extension::PlatformExtensionContext;
|
||||
use crate::agents::mcp_client::{Error, McpClientTrait};
|
||||
use crate::agents::tool_execution::ToolCallContext;
|
||||
use crate::config::Config;
|
||||
use anyhow::Result;
|
||||
use async_trait::async_trait;
|
||||
use rmcp::model::{
|
||||
@@ -64,13 +65,13 @@ impl McpClientTrait for TomClient {
|
||||
async fn get_moim(&self, _session_id: &str) -> Option<String> {
|
||||
let mut parts = Vec::new();
|
||||
|
||||
if let Ok(text) = std::env::var("GOOSE_MOIM_MESSAGE_TEXT") {
|
||||
if let Ok(text) = Config::global().get_param::<String>("GOOSE_MOIM_MESSAGE_TEXT") {
|
||||
if !text.trim().is_empty() {
|
||||
parts.push(truncate_utf8(text));
|
||||
}
|
||||
}
|
||||
|
||||
if let Ok(path) = std::env::var("GOOSE_MOIM_MESSAGE_FILE") {
|
||||
if let Ok(path) = Config::global().get_param::<String>("GOOSE_MOIM_MESSAGE_FILE") {
|
||||
let expanded = shellexpand::tilde(&path);
|
||||
if let Some(content) = read_bounded(&expanded).await {
|
||||
if !content.trim().is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user