# PR #1730: agents.md path shown at tui launch
- URL: https://github.com/openai/codex/pull/1730
- Author: pap-openai
- Created: 2025-07-29 21:28:05 UTC
- Updated: 2025-08-06 22:53:44 UTC
- Changes: +278/-14, Files changed: 9, Commits: 14
## Description
show agents.md on login, decouple function to find and load agents.md, add unit tests for agents.md discovery
Preview:
with an agents.md
without
## Full Diff
```diff
diff --git a/codex-rs/common/src/config_summary.rs b/codex-rs/common/src/config_summary.rs
index 39d524731f..616030a85a 100644
--- a/codex-rs/common/src/config_summary.rs
+++ b/codex-rs/common/src/config_summary.rs
@@ -1,4 +1,5 @@
use codex_core::WireApi;
+use codex_core::agents_doc_path_string;
use codex_core::config::Config;
use crate::sandbox_summary::summarize_sandbox_policy;
@@ -7,6 +8,10 @@ use crate::sandbox_summary::summarize_sandbox_policy;
pub fn create_config_summary_entries(config: &Config) -> Vec<(&'static str, String)> {
let mut entries = vec![
("workdir", config.cwd.display().to_string()),
+ (
+ "agents.md",
+ agents_doc_path_string(config).unwrap_or_else(|| "none".to_string()),
+ ),
("model", config.model.clone()),
("provider", config.model_provider_id.clone()),
("approval", config.approval_policy.to_string()),
diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs
index 98d13b4cd6..64f0cb2bab 100644
--- a/codex-rs/core/src/codex.rs
+++ b/codex-rs/core/src/codex.rs
@@ -857,6 +857,7 @@ async fn submission_loop(
msg: EventMsg::SessionConfigured(SessionConfiguredEvent {
session_id,
model,
+ agents_doc_path: crate::project_doc::agents_doc_path_string(&config),
history_log_id,
history_entry_count,
}),
diff --git a/codex-rs/core/src/lib.rs b/codex-rs/core/src/lib.rs
index c728bd3125..037476be0c 100644
--- a/codex-rs/core/src/lib.rs
+++ b/codex-rs/core/src/lib.rs
@@ -39,6 +39,8 @@ mod openai_model_info;
mod openai_tools;
pub mod plan_tool;
mod project_doc;
+pub use project_doc::agents_doc_path_string;
+pub use project_doc::discover_project_doc_path;
pub mod protocol;
mod rollout;
pub(crate) mod safety;
diff --git a/codex-rs/core/src/project_doc.rs b/codex-rs/core/src/project_doc.rs
index 9f46159d1d..56807da1ce 100644
--- a/codex-rs/core/src/project_doc.rs
+++ b/codex-rs/core/src/project_doc.rs
@@ -12,7 +12,10 @@
//! exists, the search stops – we do **not** walk past the Git root.
use crate::config::Config;
+use std::fs;
+use std::io::Read as _;
use std::path::Path;
+use std::path::PathBuf;
use tokio::io::AsyncReadExt;
use tracing::error;
@@ -49,6 +52,10 @@ pub(crate) async fn get_user_instructions(config: &Config) -> Option {
/// the function returns `Ok(None)`. Unexpected I/O failures bubble up as
/// `Err` so callers can decide how to handle them.
async fn find_project_doc(config: &Config) -> std::io::Result