diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index b0d345f8..d6a5c586 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -799,6 +799,12 @@ The Codex skill watcher is also a no-op marker now. Thread startup no longer registers skill roots with a file watcher, clears skill caches from watcher events, or starts a session listener that emits `SkillsUpdateAvailable`. +The model-turn skill pipeline is cold as well. Turns no longer collect skill +mentions, request skill env vars, install MCP dependencies for skills, inject +skill instruction fragments, or emit implicit skill invocation analytics from +shell/unified-exec commands. The old skill-MCP dependency installer module is +deleted. + The Phase 6 freshness slice is landed. It exposes read-only `thread/epiphany/freshness` from live retrieval summaries plus graph frontier/churn state and, for loaded threads, watcher-backed invalidation diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index db584ad4..9051780b 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 15d80fe5..4ad6db50 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -280,5 +280,5 @@ rejected_paths: reason: making Epiphany cleaner inside Codex still preserves the wrong organ; Codex must be starved down to OpenAI subscription auth/model transport, while Epiphany data and subsystem communication move to typed CultCache/CultNet. current_status: - summary: The Codex starvation pass has five typing receipts, thirty-six processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, watcher invalidation adaptation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin/skill cache invalidation on config writes is gone, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` returns empty compatibility entries without loading config layers, plugin roots, skill files, or conversion helpers, and the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. + summary: The Codex starvation pass has five typing receipts, thirty-seven processor/foundation cuts, a real physical extraction in `epiphany-codex-bridge`, a root `epiphany-state-model` crate for durable Epiphany state, a source-grounded Codex auth spine inventory, the native `epiphany-openai-adapter` document boundary, a buildable Codex auth/model wrapper in `epiphany-openai-codex-spine`, the first native runtime caller in `epiphany-openai-runtime`, native heartbeat launch planning/job opening in `epiphany-core`, native state-update contract/validation/application in `epiphany-core`, native exact retrieval path matching in `epiphany-core`, and the route-facing mutation/view/coordinator projection services in `epiphany-codex-bridge`. `codex-protocol` no longer defines the durable `Epiphany*` state structs; it re-exports the native model for legacy rollout/API compatibility while `epiphany-core` imports the native model directly. `epiphany-core` now has no direct vendored Codex dependency: pressure derivation accepts native `EpiphanyTokenUsageSnapshot`, Codex rollout replay moved to `codex-core::epiphany_rollout`, and exact retrieval search uses Epiphany-owned workspace walking/path scoring instead of `codex-file-search`. The bridge owns Codex-facing Epiphany adapters for scene, jobs, context/planning/graph query, retrieval/indexing projection, result projection, runtime-spine result adaptation, launch/prompt doctrine, mutation document mechanics, mutation service update/promote/role-accept/reorient-accept/role-launch/reorient-launch/job-launch/job-interrupt application, live-state projection, pressure/pre-compaction rendering, freshness/reorientation projection, CRRC/coordinator/role-board projection, watcher invalidation adaptation, full `thread/epiphany/view` response construction, freshness/context/graph-query response construction, role/reorient result response construction, distill/propose patch-response construction, coordinator status/view construction, and acceptance/evidence signal helpers. Vendored app-server no longer retains root Epiphany modules; `codex_message_processor.rs` still contains route dispatch, JSON-RPC response shaping, watcher registration/snapshotting calls, and notification emission, but its root no longer imports the evacuated Epiphany policy/protocol registry or owns the watcher invalidation manager. Codex product surfaces for apps, skills, plugins, marketplace, and external agent config import are now inert in the app-server compatibility path: list routes return empty lists, mutation/detail/import routes report disabled, `externalAgentConfig/detect` returns no import candidates, helper/import modules and stale implementation-shape tests were deleted, runtime feature enablement no longer supports `apps` or `plugins`, config writes no longer emit plugin-toggle analytics, plugin/skill cache invalidation on config writes is gone, plugin startup warmups and app-list refreshes were removed, and app-server no longer directly depends on `codex-plugin`, `codex-chatgpt`, or `codex-core-plugins`. `Config::to_mcp_config` now keeps user-declared MCP servers but no longer accepts `PluginsManager`, folds plugin MCP servers into the runtime, enables Codex apps, enables skill MCP dependency install, or advertises plugin capability summaries; `TurnContext::apps_enabled()` now returns false so model turns cannot awaken Codex Apps through ChatGPT auth or feature flags; session startup and per-turn context no longer load skills, turns receive an empty `SkillLoadOutcome`, internal `Op::ListSkills` returns empty compatibility entries without loading config layers, plugin roots, skill files, or conversion helpers, the Codex skill watcher has been collapsed to a no-op marker with no file watcher, skill-root registration, cache-clear task, or `SkillsUpdateAvailable` session listener, and model turns no longer run skill mention collection, skill env-var prompts, skill MCP dependency installation, skill instruction injection, or implicit skill invocation analytics from shell tools. `codex_message_processor.rs` is about 9,637 lines; root `message_processor.rs` is about 1,292 lines after the external-agent/config-product cuts; `epiphany_read_routes.rs` is about 579 lines after the full view and read-response extractions; `epiphany_mutation_routes.rs` is about 694 lines after route-load/notification helper cuts and product-surface starvation; `epiphany_state_helpers.rs` is down to a 19-line rollout-state loader; and `codex_thread.rs` is about 1,425 lines after state-update law moved native. `epiphany-openai-adapter` defines CultCache `DatabaseEntry` request/event/receipt/auth-status documents with no Codex app-server or generic JSON dependency. `epiphany-openai-codex-spine` owns all direct Codex auth/model-transport imports for the native OpenAI path: it exposes `default_codex_home` and `auth_manager`, projects `AuthManager` / `CodexAuth` into typed `EpiphanyOpenAiAdapterStatus`, maps typed `EpiphanyOpenAiModelRequest` into Codex API `ResponsesApiRequest`, resolves auth/provider through keeper Codex crates, opens HTTP Responses streams through `codex-api`, maps deltas / completion into typed stream events and receipts, and no longer directly depends on `codex-app-server-protocol` just to name auth mode. `epiphany-openai-runtime` no longer depends directly on `codex-login`; it writes OpenAI status/request/stream-event/receipt records plus runtime sessions/jobs/results/events into `epiphany-core::runtime_spine_cache`, can emit the assistant text artifact for legacy result consumers, is now the default executor for startup-only repo birth specialists, and now has `run-worker` to load a durable `EpiphanyRuntimeWorkerLaunchRequest`, call the typed OpenAI runtime through the spine, persist typed `EpiphanyRuntimeRoleWorkerResult` / `EpiphanyRuntimeReorientWorkerResult` documents, and complete the original heartbeat/specialist runtime job without Codex worker execution; `codex exec` survives only as explicit fallback in repo-birth startup. `epiphany-mvp-coordinator` now invokes `epiphany-openai-runtime run-worker` for launched runtime job ids and no longer creates a second coordinator-owned shadow runtime job/result as a compensator. `epiphany-core::plan_runtime_spine_heartbeat_launch` validates launch contracts/conflicts and projects durable job bindings/runtime links; `epiphany-core::open_runtime_spine_heartbeat_job` owns the initialize-runtime/ensure-session/create-job sequence and now persists `EpiphanyRuntimeWorkerLaunchRequest` CultCache records keyed by runtime job id, with indexed kind/contract fields plus MessagePack-encoded typed launch documents instead of discarding work intent after queue receipt creation; `roleResult` and `reorientResult` now prefer typed worker result documents and fall back only to generic job summaries for older receipts; `epiphany-core::EpiphanyStateUpdate`, `epiphany_state_update_validation_errors`, and `apply_epiphany_state_update` own state-update document shape and mutation law while `codex-core` calls them for compatibility. Vendored `CodexThread::epiphany_launch_job` is now mostly revision check, persistence validation, launch request handoff, and rollout/session writeback for the compatibility route. Vendored `codex-core` no longer has `epiphany_distillation`, `epiphany_promotion`, `epiphany_proposal`, or `epiphany_retrieval` husk modules; it re-exports native surfaces from `epiphany-core` directly, and now owns only the real Codex rollout adapter because it is a host seam. `epiphany-runtime-spine` advertises OpenAI adapter status/model-request/stream-event/receipt CultNet schemas and mutation contracts, so the native caller now has a real storage route instead of only JSON-RPC. MCP itself is correctly JSON at its protocol edge; the target is typed Epiphany intent/result/receipt wrappers around MCP, not replacing MCP JSON. The current OpenAI spine still pulls `codex-api` and a large transport dependency stack, so its next cut is dependency starvation after richer live callers move. next_action: Continue starving coordinator/runtime execution and operator surfaces off app-server JSON-RPC and out of `codex_message_processor.rs`; keep the vestigial Codex organ narrowed to subscription auth/model transport. diff --git a/vendor/codex/codex-rs/core/src/lib.rs b/vendor/codex/codex-rs/core/src/lib.rs index b59c7ece..9599d0dd 100644 --- a/vendor/codex/codex-rs/core/src/lib.rs +++ b/vendor/codex/codex-rs/core/src/lib.rs @@ -63,7 +63,6 @@ mod installation_id; pub(crate) mod landlock; pub use landlock::spawn_command_under_linux_sandbox; pub(crate) mod mcp; -mod mcp_skill_dependencies; mod mcp_tool_approval_templates; mod mcp_tool_exposure; mod network_policy_decision; @@ -107,20 +106,14 @@ mod session_prefix; mod session_startup_prewarm; mod shell_detect; pub mod skills; -pub(crate) use skills::SkillInjections; pub(crate) use skills::SkillLoadOutcome; pub(crate) use skills::SkillMetadata; pub(crate) use skills::SkillsManager; pub(crate) use skills::build_available_skills; -pub(crate) use skills::build_skill_injections; pub(crate) use skills::build_skill_name_counts; -pub(crate) use skills::collect_env_var_dependencies; -pub(crate) use skills::collect_explicit_skill_mentions; pub(crate) use skills::default_skill_metadata_budget; pub(crate) use skills::injection; pub(crate) use skills::manager; -pub(crate) use skills::maybe_emit_implicit_skill_invocation; -pub(crate) use skills::resolve_skill_dependencies_for_turn; mod skills_watcher; mod stream_events_utils; pub mod test_support; diff --git a/vendor/codex/codex-rs/core/src/mcp_skill_dependencies.rs b/vendor/codex/codex-rs/core/src/mcp_skill_dependencies.rs deleted file mode 100644 index c711d1a1..00000000 --- a/vendor/codex/codex-rs/core/src/mcp_skill_dependencies.rs +++ /dev/null @@ -1,470 +0,0 @@ -use std::collections::HashMap; -use std::collections::HashSet; - -use codex_config::ConfigEditsBuilder; -use codex_config::McpServerConfig; -use codex_config::McpServerTransportConfig; -use codex_config::load_global_mcp_servers; -use codex_login::default_client::is_first_party_originator; -use codex_login::default_client::originator; -use codex_protocol::request_user_input::RequestUserInputArgs; -use codex_protocol::request_user_input::RequestUserInputQuestion; -use codex_protocol::request_user_input::RequestUserInputQuestionOption; -use codex_protocol::request_user_input::RequestUserInputResponse; -use codex_rmcp_client::perform_oauth_login; -use tokio_util::sync::CancellationToken; -use tracing::warn; - -use crate::SkillMetadata; -use crate::session::session::Session; -use crate::session::turn_context::TurnContext; -use crate::skills::model::SkillToolDependency; -use codex_mcp::McpOAuthLoginSupport; -use codex_mcp::mcp_permission_prompt_is_auto_approved; -use codex_mcp::oauth_login_support; -use codex_mcp::resolve_oauth_scopes; -use codex_mcp::should_retry_without_scopes; - -const SKILL_MCP_DEPENDENCY_PROMPT_ID: &str = "skill_mcp_dependency_install"; -const MCP_DEPENDENCY_OPTION_INSTALL: &str = "Install"; -const MCP_DEPENDENCY_OPTION_SKIP: &str = "Continue anyway"; - -pub(crate) async fn maybe_prompt_and_install_mcp_dependencies( - sess: &Session, - turn_context: &TurnContext, - cancellation_token: &CancellationToken, - mentioned_skills: &[SkillMetadata], -) { - let originator_value = originator().value; - if !is_first_party_originator(originator_value.as_str()) { - // Only support first-party clients for now. - return; - } - - let config = turn_context.config.clone(); - if mentioned_skills.is_empty() - || !config - .features - .enabled(codex_features::Feature::SkillMcpDependencyInstall) - { - return; - } - - let installed = sess - .services - .mcp_manager - .configured_servers(config.as_ref()) - .await; - let missing = collect_missing_mcp_dependencies(mentioned_skills, &installed); - if missing.is_empty() { - return; - } - - let unprompted_missing = filter_prompted_mcp_dependencies(sess, &missing).await; - if unprompted_missing.is_empty() { - return; - } - - if should_install_mcp_dependencies(sess, turn_context, &unprompted_missing, cancellation_token) - .await - { - maybe_install_mcp_dependencies(sess, turn_context, config.as_ref(), mentioned_skills).await; - } -} - -pub(crate) async fn maybe_install_mcp_dependencies( - sess: &Session, - turn_context: &TurnContext, - config: &crate::config::Config, - mentioned_skills: &[SkillMetadata], -) { - if mentioned_skills.is_empty() - || !config - .features - .enabled(codex_features::Feature::SkillMcpDependencyInstall) - { - return; - } - - let codex_home = config.codex_home.clone(); - let installed = sess.services.mcp_manager.configured_servers(config).await; - let missing = collect_missing_mcp_dependencies(mentioned_skills, &installed); - if missing.is_empty() { - return; - } - - let mut servers = match load_global_mcp_servers(&codex_home).await { - Ok(servers) => servers, - Err(err) => { - warn!("failed to load MCP servers while installing skill dependencies: {err}"); - return; - } - }; - - let mut updated = false; - let mut added = Vec::new(); - for (name, config) in missing { - if servers.contains_key(&name) { - continue; - } - servers.insert(name.clone(), config.clone()); - added.push((name, config)); - updated = true; - } - - if !updated { - return; - } - - if let Err(err) = ConfigEditsBuilder::new(&codex_home) - .replace_mcp_servers(&servers) - .apply() - .await - { - warn!("failed to persist MCP dependencies for mentioned skills: {err}"); - return; - } - - for (name, server_config) in added { - let oauth_config = match oauth_login_support(&server_config.transport).await { - McpOAuthLoginSupport::Supported(config) => config, - McpOAuthLoginSupport::Unsupported => continue, - McpOAuthLoginSupport::Unknown(err) => { - warn!("MCP server may or may not require login for dependency {name}: {err}"); - continue; - } - }; - - sess.notify_background_event( - turn_context, - format!( - "Authenticating MCP {name}... Follow instructions in your browser if prompted." - ), - ) - .await; - - let resolved_scopes = resolve_oauth_scopes( - /*explicit_scopes*/ None, - server_config.scopes.clone(), - oauth_config.discovered_scopes.clone(), - ); - let first_attempt = perform_oauth_login( - &name, - &oauth_config.url, - config.mcp_oauth_credentials_store_mode, - oauth_config.http_headers.clone(), - oauth_config.env_http_headers.clone(), - &resolved_scopes.scopes, - server_config.oauth_resource.as_deref(), - config.mcp_oauth_callback_port, - config.mcp_oauth_callback_url.as_deref(), - ) - .await; - - if let Err(err) = first_attempt { - if should_retry_without_scopes(&resolved_scopes, &err) { - sess.notify_background_event( - turn_context, - format!( - "Retrying MCP {name} authentication without scopes after provider rejection." - ), - ) - .await; - - if let Err(err) = perform_oauth_login( - &name, - &oauth_config.url, - config.mcp_oauth_credentials_store_mode, - oauth_config.http_headers, - oauth_config.env_http_headers, - &[], - server_config.oauth_resource.as_deref(), - config.mcp_oauth_callback_port, - config.mcp_oauth_callback_url.as_deref(), - ) - .await - { - warn!("failed to login to MCP dependency {name}: {err}"); - } - } else { - warn!("failed to login to MCP dependency {name}: {err}"); - } - } - } - - // Refresh from the effective merged MCP map (global + repo + managed) and - // overlay the updated global servers so we don't drop repo-scoped servers. - let auth = sess.services.auth_manager.auth().await; - let mut refresh_servers = sess - .services - .mcp_manager - .effective_servers(config, auth.as_ref()) - .await; - for (name, server_config) in &servers { - refresh_servers - .entry(name.clone()) - .or_insert_with(|| server_config.clone()); - } - sess.refresh_mcp_servers_now( - turn_context, - refresh_servers, - config.mcp_oauth_credentials_store_mode, - ) - .await; -} - -async fn should_install_mcp_dependencies( - sess: &Session, - turn_context: &TurnContext, - missing: &HashMap, - cancellation_token: &CancellationToken, -) -> bool { - if mcp_permission_prompt_is_auto_approved( - turn_context.approval_policy.value(), - turn_context.sandbox_policy.get(), - ) { - return true; - } - - let server_list = format_missing_mcp_dependencies(missing); - let question = RequestUserInputQuestion { - id: SKILL_MCP_DEPENDENCY_PROMPT_ID.to_string(), - header: "Install MCP servers?".to_string(), - question: format!( - "The following MCP servers are required by the selected skills but are not installed yet: {server_list}. Install them now?" - ), - is_other: false, - is_secret: false, - options: Some(vec![ - RequestUserInputQuestionOption { - label: MCP_DEPENDENCY_OPTION_INSTALL.to_string(), - description: - "Install and enable the missing MCP servers in your global config." - .to_string(), - }, - RequestUserInputQuestionOption { - label: MCP_DEPENDENCY_OPTION_SKIP.to_string(), - description: "Skip installation for now and do not show again for these MCP servers in this session." - .to_string(), - }, - ]), - }; - let args = RequestUserInputArgs { - questions: vec![question], - }; - let sub_id = &turn_context.sub_id; - let call_id = format!("mcp-deps-{sub_id}"); - let response_fut = sess.request_user_input(turn_context, call_id, args); - let response = tokio::select! { - biased; - _ = cancellation_token.cancelled() => { - let empty = RequestUserInputResponse { - answers: HashMap::new(), - }; - sess.notify_user_input_response(sub_id, empty.clone()).await; - empty - } - response = response_fut => response.unwrap_or_else(|| RequestUserInputResponse { - answers: HashMap::new(), - }), - }; - - let install = response - .answers - .get(SKILL_MCP_DEPENDENCY_PROMPT_ID) - .is_some_and(|answer| { - answer - .answers - .iter() - .any(|entry| entry == MCP_DEPENDENCY_OPTION_INSTALL) - }); - - let prompted_keys = missing - .iter() - .map(|(name, config)| canonical_mcp_server_key(name, config)); - sess.record_mcp_dependency_prompted(prompted_keys).await; - - install -} - -async fn filter_prompted_mcp_dependencies( - sess: &Session, - missing: &HashMap, -) -> HashMap { - let prompted = sess.mcp_dependency_prompted().await; - if prompted.is_empty() { - return missing.clone(); - } - - missing - .iter() - .filter(|(name, config)| !prompted.contains(&canonical_mcp_server_key(name, config))) - .map(|(name, config)| (name.clone(), config.clone())) - .collect() -} - -fn format_missing_mcp_dependencies(missing: &HashMap) -> String { - let mut names = missing.keys().cloned().collect::>(); - names.sort(); - names.join(", ") -} - -fn canonical_mcp_key(transport: &str, identifier: &str, fallback: &str) -> String { - let identifier = identifier.trim(); - if identifier.is_empty() { - fallback.to_string() - } else { - format!("mcp__{transport}__{identifier}") - } -} - -fn canonical_mcp_server_key(name: &str, config: &McpServerConfig) -> String { - match &config.transport { - McpServerTransportConfig::Stdio { command, .. } => { - canonical_mcp_key("stdio", command, name) - } - McpServerTransportConfig::StreamableHttp { url, .. } => { - canonical_mcp_key("streamable_http", url, name) - } - } -} - -fn canonical_mcp_dependency_key(dependency: &SkillToolDependency) -> Result { - let transport = dependency.transport.as_deref().unwrap_or("streamable_http"); - if transport.eq_ignore_ascii_case("streamable_http") { - let url = dependency - .url - .as_ref() - .ok_or_else(|| "missing url for streamable_http dependency".to_string())?; - return Ok(canonical_mcp_key("streamable_http", url, &dependency.value)); - } - if transport.eq_ignore_ascii_case("stdio") { - let command = dependency - .command - .as_ref() - .ok_or_else(|| "missing command for stdio dependency".to_string())?; - return Ok(canonical_mcp_key("stdio", command, &dependency.value)); - } - Err(format!("unsupported transport {transport}")) -} - -fn mcp_dependency_to_server_config( - dependency: &SkillToolDependency, -) -> Result { - let transport = dependency.transport.as_deref().unwrap_or("streamable_http"); - if transport.eq_ignore_ascii_case("streamable_http") { - let url = dependency - .url - .as_ref() - .ok_or_else(|| "missing url for streamable_http dependency".to_string())?; - return Ok(McpServerConfig { - transport: McpServerTransportConfig::StreamableHttp { - url: url.clone(), - bearer_token_env_var: None, - http_headers: None, - env_http_headers: None, - }, - experimental_environment: None, - enabled: true, - required: false, - supports_parallel_tool_calls: false, - disabled_reason: None, - startup_timeout_sec: None, - tool_timeout_sec: None, - default_tools_approval_mode: None, - enabled_tools: None, - disabled_tools: None, - scopes: None, - oauth_resource: None, - tools: HashMap::new(), - }); - } - - if transport.eq_ignore_ascii_case("stdio") { - let command = dependency - .command - .as_ref() - .ok_or_else(|| "missing command for stdio dependency".to_string())?; - return Ok(McpServerConfig { - transport: McpServerTransportConfig::Stdio { - command: command.clone(), - args: Vec::new(), - env: None, - env_vars: Vec::new(), - cwd: None, - }, - experimental_environment: None, - enabled: true, - required: false, - supports_parallel_tool_calls: false, - disabled_reason: None, - startup_timeout_sec: None, - tool_timeout_sec: None, - default_tools_approval_mode: None, - enabled_tools: None, - disabled_tools: None, - scopes: None, - oauth_resource: None, - tools: HashMap::new(), - }); - } - - Err(format!("unsupported transport {transport}")) -} - -fn collect_missing_mcp_dependencies( - mentioned_skills: &[SkillMetadata], - installed: &HashMap, -) -> HashMap { - let mut missing = HashMap::new(); - let installed_keys: HashSet = installed - .iter() - .map(|(name, config)| canonical_mcp_server_key(name, config)) - .collect(); - let mut seen_canonical_keys = HashSet::new(); - - for skill in mentioned_skills { - let Some(dependencies) = skill.dependencies.as_ref() else { - continue; - }; - - for tool in &dependencies.tools { - if !tool.r#type.eq_ignore_ascii_case("mcp") { - continue; - } - let dependency_key = match canonical_mcp_dependency_key(tool) { - Ok(key) => key, - Err(err) => { - let dependency = tool.value.as_str(); - let skill_name = skill.name.as_str(); - warn!( - "unable to auto-install MCP dependency {dependency} for skill {skill_name}: {err}", - ); - continue; - } - }; - if installed_keys.contains(&dependency_key) - || seen_canonical_keys.contains(&dependency_key) - { - continue; - } - - let config = match mcp_dependency_to_server_config(tool) { - Ok(config) => config, - Err(err) => { - let dependency = dependency_key.as_str(); - let skill_name = skill.name.as_str(); - warn!( - "unable to auto-install MCP dependency {dependency} for skill {skill_name}: {err}", - ); - continue; - } - }; - - missing.insert(tool.value.clone(), config); - seen_canonical_keys.insert(dependency_key); - } - } - - missing -} diff --git a/vendor/codex/codex-rs/core/src/session/mcp.rs b/vendor/codex/codex-rs/core/src/session/mcp.rs index 129c8b36..ce79d684 100644 --- a/vendor/codex/codex-rs/core/src/session/mcp.rs +++ b/vendor/codex/codex-rs/core/src/session/mcp.rs @@ -288,16 +288,6 @@ impl Session { .await; } - pub(crate) async fn refresh_mcp_servers_now( - &self, - turn_context: &TurnContext, - mcp_servers: HashMap, - store_mode: OAuthCredentialsStoreMode, - ) { - self.refresh_mcp_servers_inner(turn_context, mcp_servers, store_mode) - .await; - } - #[cfg(test)] pub(crate) async fn mcp_startup_cancellation_token(&self) -> CancellationToken { self.services diff --git a/vendor/codex/codex-rs/core/src/session/mod.rs b/vendor/codex/codex-rs/core/src/session/mod.rs index 539b006b..7916d15e 100644 --- a/vendor/codex/codex-rs/core/src/session/mod.rs +++ b/vendor/codex/codex-rs/core/src/session/mod.rs @@ -2732,24 +2732,12 @@ impl Session { self.send_token_count_event(turn_context).await; } - pub(crate) async fn mcp_dependency_prompted(&self) -> HashSet { - let state = self.state.lock().await; - state.mcp_dependency_prompted() - } - - pub(crate) async fn record_mcp_dependency_prompted(&self, names: I) - where - I: IntoIterator, - { - let mut state = self.state.lock().await; - state.record_mcp_dependency_prompted(names); - } - pub async fn dependency_env(&self) -> HashMap { let state = self.state.lock().await; state.dependency_env() } + #[cfg(test)] pub async fn set_dependency_env(&self, values: HashMap) { let mut state = self.state.lock().await; state.set_dependency_env(values); diff --git a/vendor/codex/codex-rs/core/src/session/turn.rs b/vendor/codex/codex-rs/core/src/session/turn.rs index 15b48f39..d2710771 100644 --- a/vendor/codex/codex-rs/core/src/session/turn.rs +++ b/vendor/codex/codex-rs/core/src/session/turn.rs @@ -2,21 +2,16 @@ use std::collections::HashMap; use std::collections::HashSet; use std::sync::Arc; -use crate::SkillInjections; use crate::SkillLoadOutcome; -use crate::build_skill_injections; use crate::client::ModelClientSession; use crate::client_common::Prompt; use crate::client_common::ResponseEvent; -use crate::collect_env_var_dependencies; -use crate::collect_explicit_skill_mentions; use crate::compact::InitialContextInjection; use crate::compact::collect_user_messages; use crate::compact::run_inline_auto_compact_task; use crate::compact::should_use_remote_compact_task; use crate::compact_remote::run_inline_remote_auto_compact_task; use crate::connectors; -use crate::context::ContextualUserFragment; use crate::feedback_tags; use crate::hook_runtime::PendingInputHookDisposition; use crate::hook_runtime::emit_hook_completed_events; @@ -28,7 +23,6 @@ use crate::hook_runtime::run_user_prompt_submit_hooks; use crate::injection::ToolMentionKind; use crate::injection::app_id_from_path; use crate::injection::tool_kind_for_path; -use crate::mcp_skill_dependencies::maybe_prompt_and_install_mcp_dependencies; use crate::mcp_tool_exposure::build_mcp_tool_exposure; use crate::mentions::build_connector_slug_counts; use crate::mentions::build_skill_name_counts; @@ -37,7 +31,6 @@ use crate::mentions::collect_explicit_plugin_mentions; use crate::mentions::collect_tool_mentions_from_messages; use crate::parse_turn_item; use crate::plugins::build_plugin_injections; -use crate::resolve_skill_dependencies_for_turn; use crate::session::PreviousTurnSettings; use crate::session::session::Session; use crate::session::turn_context::TurnContext; @@ -163,8 +156,6 @@ pub(crate) async fn run_turn( client_session.reset_websocket_session(); } - let skills_outcome = Some(turn_context.turn_skills.outcome.as_ref()); - sess.record_context_updates_and_set_reference_context_item(turn_context.as_ref()) .await; @@ -209,65 +200,12 @@ pub(crate) async fn run_turn( } else { Vec::new() }; - let connector_slug_counts = build_connector_slug_counts(&available_connectors); - let skill_name_counts_lower = skills_outcome - .as_ref() - .map_or_else(HashMap::new, |outcome| { - build_skill_name_counts(&outcome.skills, &outcome.disabled_paths).1 - }); - let mentioned_skills = skills_outcome.as_ref().map_or_else(Vec::new, |outcome| { - collect_explicit_skill_mentions( - &input, - &outcome.skills, - &outcome.disabled_paths, - &connector_slug_counts, - ) - }); - let config = turn_context.config.clone(); - if config - .features - .enabled(Feature::SkillEnvVarDependencyPrompt) - { - let env_var_dependencies = collect_env_var_dependencies(&mentioned_skills); - resolve_skill_dependencies_for_turn(&sess, &turn_context, &env_var_dependencies).await; - } - - maybe_prompt_and_install_mcp_dependencies( - sess.as_ref(), - turn_context.as_ref(), - &cancellation_token, - &mentioned_skills, - ) - .await; - - let session_telemetry = turn_context.session_telemetry.clone(); let thread_id = sess.conversation_id.to_string(); let tracking = build_track_events_context( turn_context.model_info.slug.clone(), thread_id, turn_context.sub_id.clone(), ); - let SkillInjections { - items: skill_injections, - warnings: skill_warnings, - } = build_skill_injections( - &mentioned_skills, - skills_outcome, - Some(&session_telemetry), - &sess.services.analytics_events_client, - tracking.clone(), - ) - .await; - - for message in skill_warnings { - sess.send_event(&turn_context, EventMsg::Warning(WarningEvent { message })) - .await; - } - - let skill_items: Vec = skill_injections - .iter() - .map(|skill| ContextualUserFragment::into(crate::context::SkillInstructions::from(skill))) - .collect(); let plugin_items = build_plugin_injections(&mentioned_plugins, &mcp_tools, &available_connectors); @@ -276,12 +214,7 @@ pub(crate) async fn run_turn( .filter_map(crate::plugins::PluginCapabilitySummary::telemetry_metadata) .collect::>(); - let mut explicitly_enabled_connectors = collect_explicit_app_ids(&input); - explicitly_enabled_connectors.extend(collect_explicit_app_ids_from_skill_items( - &skill_items, - &available_connectors, - &skill_name_counts_lower, - )); + let explicitly_enabled_connectors = collect_explicit_app_ids(&input); let connector_names_by_id = available_connectors .iter() .map(|connector| (connector.id.as_str(), connector.name.as_str())) @@ -345,10 +278,6 @@ pub(crate) async fn run_turn( })) .await; } - if !skill_items.is_empty() { - sess.record_conversation_items(&turn_context, &skill_items) - .await; - } if !plugin_items.is_empty() { sess.record_conversation_items(&turn_context, &plugin_items) .await; @@ -356,7 +285,7 @@ pub(crate) async fn run_turn( track_turn_resolved_config_analytics(&sess, &turn_context, &input).await; - let skills_outcome = Some(turn_context.turn_skills.outcome.as_ref()); + let skills_outcome: Option<&SkillLoadOutcome> = None; sess.maybe_start_ghost_snapshot(Arc::clone(&turn_context), cancellation_token.child_token()) .await; let mut last_agent_message: Option = None; @@ -813,57 +742,6 @@ async fn run_auto_compact( Ok(()) } -pub(super) fn collect_explicit_app_ids_from_skill_items( - skill_items: &[ResponseItem], - connectors: &[connectors::AppInfo], - skill_name_counts_lower: &HashMap, -) -> HashSet { - if skill_items.is_empty() || connectors.is_empty() { - return HashSet::new(); - } - - let skill_messages = skill_items - .iter() - .filter_map(|item| match item { - ResponseItem::Message { content, .. } => { - content.iter().find_map(|content_item| match content_item { - ContentItem::InputText { text } => Some(text.clone()), - _ => None, - }) - } - _ => None, - }) - .collect::>(); - if skill_messages.is_empty() { - return HashSet::new(); - } - - let mentions = collect_tool_mentions_from_messages(&skill_messages); - let mention_names_lower = mentions - .plain_names - .iter() - .map(|name| name.to_ascii_lowercase()) - .collect::>(); - let mut connector_ids = mentions - .paths - .iter() - .filter(|path| tool_kind_for_path(path) == ToolMentionKind::App) - .filter_map(|path| app_id_from_path(path).map(str::to_string)) - .collect::>(); - - let connector_slug_counts = build_connector_slug_counts(connectors); - for connector in connectors { - let slug = codex_connectors::metadata::connector_mention_slug(connector); - let connector_count = connector_slug_counts.get(&slug).copied().unwrap_or(0); - let skill_count = skill_name_counts_lower.get(&slug).copied().unwrap_or(0); - if connector_count == 1 && skill_count == 0 && mention_names_lower.contains(&slug) { - connector_ids.insert(connector.id.clone()); - } - } - - connector_ids -} - pub(super) fn filter_connectors_for_input( connectors: &[connectors::AppInfo], input: &[ResponseItem], diff --git a/vendor/codex/codex-rs/core/src/session/turn_context.rs b/vendor/codex/codex-rs/core/src/session/turn_context.rs index 2e3f0ad9..891d78c6 100644 --- a/vendor/codex/codex-rs/core/src/session/turn_context.rs +++ b/vendor/codex/codex-rs/core/src/session/turn_context.rs @@ -14,15 +14,11 @@ pub(super) fn image_generation_tool_auth_allowed(auth_manager: Option<&AuthManag #[derive(Clone, Debug)] pub(crate) struct TurnSkillsContext { pub(crate) outcome: Arc, - pub(crate) implicit_invocation_seen_skills: Arc>>, } impl TurnSkillsContext { pub(crate) fn new(outcome: Arc) -> Self { - Self { - outcome, - implicit_invocation_seen_skills: Arc::new(Mutex::new(HashSet::new())), - } + Self { outcome } } } diff --git a/vendor/codex/codex-rs/core/src/skills.rs b/vendor/codex/codex-rs/core/src/skills.rs index 0909622b..23aac4d1 100644 --- a/vendor/codex/codex-rs/core/src/skills.rs +++ b/vendor/codex/codex-rs/core/src/skills.rs @@ -1,20 +1,3 @@ -use std::collections::HashMap; -use std::collections::HashSet; -use std::env; -use std::sync::Arc; - -use crate::session::session::Session; -use crate::session::turn_context::TurnContext; -use codex_analytics::InvocationType; -use codex_analytics::SkillInvocation; -use codex_analytics::build_track_events_context; -use codex_protocol::protocol::SkillScope; -use codex_protocol::request_user_input::RequestUserInputArgs; -use codex_protocol::request_user_input::RequestUserInputQuestion; -use codex_protocol::request_user_input::RequestUserInputResponse; -use codex_utils_absolute_path::AbsolutePathBuf; -use tracing::warn; - pub use codex_core_skills::SkillDependencyInfo; pub use codex_core_skills::SkillError; pub use codex_core_skills::SkillLoadOutcome; @@ -41,179 +24,3 @@ pub use codex_core_skills::remote; pub use codex_core_skills::render; pub use codex_core_skills::render::SkillRenderSideEffects; pub use codex_core_skills::system; - -pub(crate) async fn resolve_skill_dependencies_for_turn( - sess: &Arc, - turn_context: &Arc, - dependencies: &[SkillDependencyInfo], -) { - if dependencies.is_empty() { - return; - } - - let existing_env = sess.dependency_env().await; - let mut loaded_values = HashMap::new(); - let mut missing = Vec::new(); - let mut seen_names = HashSet::new(); - - for dependency in dependencies { - let name = dependency.name.clone(); - if !seen_names.insert(name.clone()) || existing_env.contains_key(&name) { - continue; - } - match env::var(&name) { - Ok(value) => { - loaded_values.insert(name.clone(), value); - } - Err(env::VarError::NotPresent) => { - missing.push(dependency.clone()); - } - Err(err) => { - warn!("failed to read env var {name}: {err}"); - missing.push(dependency.clone()); - } - } - } - - if !loaded_values.is_empty() { - sess.set_dependency_env(loaded_values).await; - } - - if !missing.is_empty() { - request_skill_dependencies(sess, turn_context, &missing).await; - } -} - -async fn request_skill_dependencies( - sess: &Arc, - turn_context: &Arc, - dependencies: &[SkillDependencyInfo], -) { - let questions = dependencies - .iter() - .map(|dependency| { - let requirement = dependency.description.as_ref().map_or_else( - || { - format!( - "The skill \"{}\" requires \"{}\" to be set.", - dependency.skill_name, dependency.name - ) - }, - |description| { - format!( - "The skill \"{}\" requires \"{}\" to be set ({}).", - dependency.skill_name, dependency.name, description - ) - }, - ); - RequestUserInputQuestion { - id: dependency.name.clone(), - header: "Skill requires environment variable".to_string(), - question: format!( - "{requirement} This is an experimental internal feature. The value is stored in memory for this session only." - ), - is_other: false, - is_secret: true, - options: None, - } - }) - .collect::>(); - if questions.is_empty() { - return; - } - - let response = sess - .request_user_input( - turn_context, - format!("skill-deps-{}", turn_context.sub_id), - RequestUserInputArgs { questions }, - ) - .await - .unwrap_or_else(|| RequestUserInputResponse { - answers: HashMap::new(), - }); - if response.answers.is_empty() { - return; - } - - let mut values = HashMap::new(); - for (name, answer) in response.answers { - let mut user_note = None; - for entry in &answer.answers { - if let Some(note) = entry.strip_prefix("user_note: ") - && !note.trim().is_empty() - { - user_note = Some(note.trim().to_string()); - } - } - if let Some(value) = user_note { - values.insert(name, value); - } - } - if values.is_empty() { - return; - } - - sess.set_dependency_env(values).await; -} - -pub(crate) async fn maybe_emit_implicit_skill_invocation( - sess: &Session, - turn_context: &TurnContext, - command: &str, - workdir: &AbsolutePathBuf, -) { - let Some(candidate) = detect_implicit_skill_invocation_for_command( - turn_context.turn_skills.outcome.as_ref(), - command, - workdir, - ) else { - return; - }; - let invocation = SkillInvocation { - skill_name: candidate.name, - skill_scope: candidate.scope, - skill_path: candidate.path_to_skills_md.to_path_buf(), - invocation_type: InvocationType::Implicit, - }; - let skill_scope = match invocation.skill_scope { - SkillScope::User => "user", - SkillScope::Repo => "repo", - SkillScope::System => "system", - SkillScope::Admin => "admin", - }; - let skill_path = invocation.skill_path.to_string_lossy(); - let skill_name = invocation.skill_name.clone(); - let seen_key = format!("{skill_scope}:{skill_path}:{skill_name}"); - let inserted = { - let mut seen_skills = turn_context - .turn_skills - .implicit_invocation_seen_skills - .lock() - .await; - seen_skills.insert(seen_key) - }; - if !inserted { - return; - } - - turn_context.session_telemetry.counter( - "codex.skill.injected", - /*inc*/ 1, - &[ - ("status", "ok"), - ("skill", skill_name.as_str()), - ("invoke_type", "implicit"), - ], - ); - sess.services - .analytics_events_client - .track_skill_invocations( - build_track_events_context( - turn_context.model_info.slug.clone(), - sess.conversation_id.to_string(), - turn_context.sub_id.clone(), - ), - vec![invocation], - ); -} diff --git a/vendor/codex/codex-rs/core/src/state/session.rs b/vendor/codex/codex-rs/core/src/state/session.rs index 2c8146c9..70a83e25 100644 --- a/vendor/codex/codex-rs/core/src/state/session.rs +++ b/vendor/codex/codex-rs/core/src/state/session.rs @@ -24,7 +24,6 @@ pub(crate) struct SessionState { pub(crate) latest_rate_limits: Option, pub(crate) server_reasoning_included: bool, pub(crate) dependency_env: HashMap, - pub(crate) mcp_dependency_prompted: HashSet, /// Settings used by the latest regular user turn, used for turn-to-turn /// model/realtime handling on subsequent regular turns (including full-context /// reinjection after resume or `/compact`). @@ -48,7 +47,6 @@ impl SessionState { latest_rate_limits: None, server_reasoning_included: false, dependency_env: HashMap::new(), - mcp_dependency_prompted: HashSet::new(), previous_turn_settings: None, startup_prewarm: None, active_connector_selection: HashSet::new(), @@ -172,17 +170,7 @@ impl SessionState { self.server_reasoning_included } - pub(crate) fn record_mcp_dependency_prompted(&mut self, names: I) - where - I: IntoIterator, - { - self.mcp_dependency_prompted.extend(names); - } - - pub(crate) fn mcp_dependency_prompted(&self) -> HashSet { - self.mcp_dependency_prompted.clone() - } - + #[cfg(test)] pub(crate) fn set_dependency_env(&mut self, values: HashMap) { for (key, value) in values { self.dependency_env.insert(key, value); diff --git a/vendor/codex/codex-rs/core/src/tools/handlers/shell.rs b/vendor/codex/codex-rs/core/src/tools/handlers/shell.rs index b9718173..bc78e859 100644 --- a/vendor/codex/codex-rs/core/src/tools/handlers/shell.rs +++ b/vendor/codex/codex-rs/core/src/tools/handlers/shell.rs @@ -9,7 +9,6 @@ use crate::exec::ExecParams; use crate::exec_env::create_env; use crate::exec_policy::ExecApprovalRequest; use crate::function_tool::FunctionCallError; -use crate::maybe_emit_implicit_skill_invocation; use crate::session::turn_context::TurnContext; use crate::shell::Shell; use crate::tools::context::FunctionToolOutput; @@ -360,14 +359,6 @@ impl ToolHandler for ShellCommandHandler { let cwd = resolve_workdir_base_path(&arguments, &turn.cwd)?; let params: ShellCommandToolCallParams = parse_arguments_with_base_path(&arguments, &cwd)?; - let workdir = turn.resolve_path(params.workdir.clone()); - maybe_emit_implicit_skill_invocation( - session.as_ref(), - turn.as_ref(), - ¶ms.command, - &workdir, - ) - .await; let prefix_rule = params.prefix_rule.clone(); let exec_params = Self::to_exec_params( ¶ms, diff --git a/vendor/codex/codex-rs/core/src/tools/handlers/unified_exec.rs b/vendor/codex/codex-rs/core/src/tools/handlers/unified_exec.rs index 813f4f86..461d7bc1 100644 --- a/vendor/codex/codex-rs/core/src/tools/handlers/unified_exec.rs +++ b/vendor/codex/codex-rs/core/src/tools/handlers/unified_exec.rs @@ -1,5 +1,4 @@ use crate::function_tool::FunctionCallError; -use crate::maybe_emit_implicit_skill_invocation; use crate::sandboxing::SandboxPermissions; use crate::shell::Shell; use crate::shell::get_shell_by_model_provided_path; @@ -203,14 +202,6 @@ impl ToolHandler for UnifiedExecHandler { let cwd = resolve_workdir_base_path(&arguments, &context.turn.cwd)?; let args: ExecCommandArgs = parse_arguments_with_base_path(&arguments, &cwd)?; let hook_command = args.cmd.clone(); - let workdir = context.turn.resolve_path(args.workdir.clone()); - maybe_emit_implicit_skill_invocation( - session.as_ref(), - context.turn.as_ref(), - &hook_command, - &workdir, - ) - .await; let process_id = manager.allocate_process_id().await; let command = get_command( &args,