mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Remove step-scoped data from extension contributors (#34734)
## What changed - Remove the step-scoped `ExtensionData` argument from context, turn-input, and tool contributors. - Pass the host's optional `McpResourceClient` through `ThreadStartInput` so extensions can retain session capabilities explicitly. - Keep the MCP resource client in skills-owned session state for catalog loading and skill tools. GitOrigin-RevId: bafa77bcd998aff408d6a396c5fd9ac268c4cce4
This commit is contained in:
1 parent
84d2b203ed
commit
fd51e50540
30 files changed
+70
-135
No files matched your search
@@ -52,7 +52,6 @@ impl ContextContributor for MemoriesExtension {
|
||||
&'a self,
|
||||
_session_store: &'a ExtensionData,
|
||||
thread_store: &'a ExtensionData,
|
||||
_step_store: &'a ExtensionData,
|
||||
) -> std::pin::Pin<Box<dyn std::future::Future<Output = Vec<PromptFragment>> + Send + 'a>> {
|
||||
Box::pin(async move {
|
||||
let Some(config) = thread_store.get::<MemoriesExtensionConfig>() else {
|
||||
@@ -101,7 +100,6 @@ impl ToolContributor for MemoriesExtension {
|
||||
&self,
|
||||
_session_store: &ExtensionData,
|
||||
thread_store: &ExtensionData,
|
||||
_step_store: &ExtensionData,
|
||||
) -> Vec<Arc<dyn codex_extension_api::ToolExecutor<codex_extension_api::ToolCall>>> {
|
||||
let Some(config) = thread_store.get::<MemoriesExtensionConfig>() else {
|
||||
return Vec::new();
|
||||
|
||||
@@ -42,7 +42,6 @@ fn tools_are_not_contributed_without_thread_config() {
|
||||
.tools(
|
||||
&ExtensionData::new("session"),
|
||||
&ExtensionData::new("thread"),
|
||||
&ExtensionData::new("step")
|
||||
)
|
||||
.is_empty()
|
||||
);
|
||||
@@ -60,11 +59,7 @@ fn tools_are_not_contributed_when_disabled() {
|
||||
|
||||
assert!(
|
||||
extension
|
||||
.tools(
|
||||
&ExtensionData::new("session"),
|
||||
&thread_store,
|
||||
&ExtensionData::new("step"),
|
||||
)
|
||||
.tools(&ExtensionData::new("session"), &thread_store)
|
||||
.is_empty()
|
||||
);
|
||||
}
|
||||
@@ -81,11 +76,7 @@ fn tools_are_not_contributed_when_dedicated_tools_disabled() {
|
||||
|
||||
assert!(
|
||||
extension
|
||||
.tools(
|
||||
&ExtensionData::new("session"),
|
||||
&thread_store,
|
||||
&ExtensionData::new("step"),
|
||||
)
|
||||
.tools(&ExtensionData::new("session"), &thread_store)
|
||||
.is_empty()
|
||||
);
|
||||
}
|
||||
@@ -101,11 +92,7 @@ fn tools_are_contributed_when_enabled_with_dedicated_tools() {
|
||||
});
|
||||
|
||||
let tool_names = extension
|
||||
.tools(
|
||||
&ExtensionData::new("session"),
|
||||
&thread_store,
|
||||
&ExtensionData::new("step"),
|
||||
)
|
||||
.tools(&ExtensionData::new("session"), &thread_store)
|
||||
.into_iter()
|
||||
.map(|tool| tool.tool_name())
|
||||
.collect::<Vec<_>>();
|
||||
@@ -136,13 +123,7 @@ fn install_registers_dedicated_tool_contributor() {
|
||||
let tool_names = registry
|
||||
.tool_contributors()
|
||||
.iter()
|
||||
.flat_map(|contributor| {
|
||||
contributor.tools(
|
||||
&ExtensionData::new("session"),
|
||||
&thread_store,
|
||||
&ExtensionData::new("step"),
|
||||
)
|
||||
})
|
||||
.flat_map(|contributor| contributor.tools(&ExtensionData::new("session"), &thread_store))
|
||||
.map(|tool| tool.tool_name())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
@@ -200,11 +181,7 @@ async fn prompt_contribution_uses_memory_summary_when_enabled() {
|
||||
});
|
||||
|
||||
let fragments = extension
|
||||
.contribute_thread_context(
|
||||
&ExtensionData::new("session"),
|
||||
&thread_store,
|
||||
&ExtensionData::new("step"),
|
||||
)
|
||||
.contribute_thread_context(&ExtensionData::new("session"), &thread_store)
|
||||
.await;
|
||||
|
||||
assert_eq!(fragments.len(), 1);
|
||||
|
||||
Reference in new issue
Block a user