fix(tom): read messages from config (#12634)

This commit is contained in:
Douwe Osinga
2026-10-02 15:03:24 +00:00
committed by GitHub
parent aa294302fe
commit 591edd47cf
@@ -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() {