Trace global user instruction loading (#45496)

## What changed

Add an `instructions.load` tracing span with `provider = "global"` around loading user instructions from the Codex home directory. Skip recording function arguments and add the `tracing` dependency to `codex-home`.

GitOrigin-RevId: 1b11e4b18f7a0dbee742a092aba580a184dc5fbf
This commit is contained in:
vkg-oai
2026-09-14 19:00:05 +00:00
committed by copyberry
parent a20092a7a2
commit afaad7cdc0
3 changed files with 3 additions and 0 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -3658,6 +3658,7 @@ dependencies = [
"pretty_assertions",
"tempfile",
"tokio",
"tracing",
]
[[package]]

View File

@@ -14,6 +14,7 @@ workspace = true
codex-extension-api = { workspace = true }
codex-utils-absolute-path = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
tracing = { workspace = true }
[dev-dependencies]
pretty_assertions = { workspace = true }

View File

@@ -37,6 +37,7 @@ impl CodexHomeUserInstructionsProvider {
}
}
#[tracing::instrument(name = "instructions.load", skip_all, fields(provider = "global"))]
async fn load_from_codex_home(&self) -> LoadedUserInstructions {
let mut warnings = Vec::new();
for candidate in [LOCAL_AGENTS_MD_FILENAME, DEFAULT_AGENTS_MD_FILENAME] {