mirror of
https://github.com/openai/codex.git
synced 2026-09-14 11:57:03 +00:00
Fix post-rebase test fallout
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -4303,6 +4303,10 @@ async fn rejects_escalated_permissions_when_policy_not_on_request() {
|
||||
network: None,
|
||||
sandbox_permissions,
|
||||
windows_sandbox_level: turn_context.windows_sandbox_level,
|
||||
windows_sandbox_private_desktop: turn_context
|
||||
.config
|
||||
.permissions
|
||||
.windows_sandbox_private_desktop,
|
||||
justification: Some("test".to_string()),
|
||||
arg0: None,
|
||||
};
|
||||
@@ -4315,6 +4319,10 @@ async fn rejects_escalated_permissions_when_policy_not_on_request() {
|
||||
env: HashMap::new(),
|
||||
network: None,
|
||||
windows_sandbox_level: turn_context.windows_sandbox_level,
|
||||
windows_sandbox_private_desktop: turn_context
|
||||
.config
|
||||
.permissions
|
||||
.windows_sandbox_private_desktop,
|
||||
justification: params.justification.clone(),
|
||||
arg0: None,
|
||||
};
|
||||
|
||||
@@ -8,16 +8,16 @@ fn render_plugin_instructions_returns_none_for_empty_plugins() {
|
||||
|
||||
#[test]
|
||||
fn render_plugins_section_includes_descriptions_and_skill_naming_guidance() {
|
||||
let rendered = render_plugins_section(&[PluginCapabilitySummary {
|
||||
let rendered = render_plugin_instructions(&[PluginCapabilitySummary {
|
||||
config_name: "sample@test".to_string(),
|
||||
display_name: "sample".to_string(),
|
||||
description: Some("inspect sample data".to_string()),
|
||||
has_skills: true,
|
||||
..PluginCapabilitySummary::default()
|
||||
}])
|
||||
.expect("plugin section should render");
|
||||
.unwrap_or_else(|| panic!("plugin section should render"));
|
||||
|
||||
let expected = "## Plugins\nA plugin is a local bundle of skills, MCP servers, and apps. Below is the list of plugins that are enabled and available in this session.\n### Available plugins\n- `sample`: inspect sample data\n### How to use plugins\n- Discovery: The list above is the plugins available in this session.\n- Skill naming: If a plugin contributes skills, those skill entries are prefixed with `plugin_name:` in the Skills list.\n- Trigger rules: If the user explicitly names a plugin, prefer capabilities associated with that plugin for that turn.\n- Relationship to capabilities: Plugins are not invoked directly. Use their underlying skills, MCP tools, and app tools to help solve the task.\n- Preference: When a relevant plugin is available, prefer using capabilities associated with that plugin over standalone capabilities that provide similar functionality.\n- Missing/blocked: If the user requests a plugin that is not listed above, or the plugin does not have relevant callable capabilities for the task, say so briefly and continue with the best fallback.";
|
||||
|
||||
assert_eq!(rendered, expected);
|
||||
assert_eq!(rendered.text, expected);
|
||||
}
|
||||
|
||||
@@ -73,9 +73,10 @@ fn assert_default_env_context(text: &str, cwd: &str, shell: &Shell) {
|
||||
}
|
||||
|
||||
fn message_input_texts(value: &serde_json::Value) -> Vec<&str> {
|
||||
value["content"]
|
||||
.as_array()
|
||||
.expect("message content array")
|
||||
let Some(content) = value["content"].as_array() else {
|
||||
panic!("message content array");
|
||||
};
|
||||
content
|
||||
.iter()
|
||||
.filter_map(|entry| entry["text"].as_str())
|
||||
.collect()
|
||||
|
||||
Reference in New Issue
Block a user