Rename explicit plugin instruction tag

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Charles Cunningham
2026-03-25 00:11:56 -07:00
co-authored by Codex
parent 8b05d1abeb
commit 88c2095fed
8 changed files with 16 additions and 16 deletions
@@ -961,7 +961,7 @@ fn drop_last_n_user_turns_trims_explicit_plugin_guidance_above_rolled_back_turn(
user_input_text_msg("turn 1 user"),
assistant_msg("turn 1 assistant"),
developer_msg(
"<explicit_plugin_instructions>\nCapabilities from the `sample` plugin:\n- Apps from this plugin available in this session: `Google Calendar`.\nUse these plugin-associated capabilities to help solve the task.\n</explicit_plugin_instructions>",
"<plugin_mention_instructions>\nCapabilities from the `sample` plugin:\n- Apps from this plugin available in this session: `Google Calendar`.\nUse these plugin-associated capabilities to help solve the task.\n</plugin_mention_instructions>",
),
user_input_text_msg(
"<environment_context><cwd>PRETURN_CONTEXT_DIFF_CWD</cwd></environment_context>",
+2 -2
View File
@@ -15,7 +15,7 @@ use codex_protocol::models::is_image_open_tag_text;
use codex_protocol::models::is_local_image_close_tag_text;
use codex_protocol::models::is_local_image_open_tag_text;
use codex_protocol::protocol::COLLABORATION_MODE_OPEN_TAG;
use codex_protocol::protocol::EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::REALTIME_CONVERSATION_OPEN_TAG;
use codex_protocol::user_input::UserInput;
use tracing::warn;
@@ -29,7 +29,7 @@ const CONTEXTUAL_DEVELOPER_PREFIXES: &[&str] = &[
"<permissions instructions>",
"<model_switch>",
COLLABORATION_MODE_OPEN_TAG,
EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG,
PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG,
REALTIME_CONVERSATION_OPEN_TAG,
"<personality_spec>",
];
+3 -3
View File
@@ -1,6 +1,6 @@
use crate::plugins::PluginCapabilitySummary;
use codex_protocol::protocol::EXPLICIT_PLUGIN_INSTRUCTIONS_CLOSE_TAG;
use codex_protocol::protocol::EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::PLUGIN_MENTION_INSTRUCTIONS_CLOSE_TAG;
use codex_protocol::protocol::PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::PLUGINS_INSTRUCTIONS_CLOSE_TAG;
use codex_protocol::protocol::PLUGINS_INSTRUCTIONS_OPEN_TAG;
@@ -88,7 +88,7 @@ pub(crate) fn render_explicit_plugin_instructions(
let body = lines.join("\n");
Some(format!(
"{EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG}\n{body}\n{EXPLICIT_PLUGIN_INSTRUCTIONS_CLOSE_TAG}"
"{PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG}\n{body}\n{PLUGIN_MENTION_INSTRUCTIONS_CLOSE_TAG}"
))
}
+1 -1
View File
@@ -36,7 +36,7 @@ fn render_explicit_plugin_instructions_wraps_turn_local_guidance_in_stable_tag()
)
.expect("explicit plugin instructions should render");
let expected = "<explicit_plugin_instructions>\nCapabilities from the `sample` plugin:\n- Skills from this plugin are prefixed with `sample:`.\n- Apps from this plugin available in this session: `Google Calendar`.\nUse these plugin-associated capabilities to help solve the task.\n</explicit_plugin_instructions>";
let expected = "<plugin_mention_instructions>\nCapabilities from the `sample` plugin:\n- Skills from this plugin are prefixed with `sample:`.\n- Apps from this plugin available in this session: `Google Calendar`.\nUse these plugin-associated capabilities to help solve the task.\n</plugin_mention_instructions>";
assert_eq!(rendered, expected);
}
@@ -4,7 +4,7 @@ use std::sync::OnceLock;
use crate::responses::ResponsesRequest;
use codex_protocol::protocol::APPS_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::PLUGINS_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::SKILLS_INSTRUCTIONS_OPEN_TAG;
@@ -282,8 +282,8 @@ fn canonicalize_snapshot_text(text: &str) -> String {
if text.starts_with(PLUGINS_INSTRUCTIONS_OPEN_TAG) {
return "<PLUGINS_INSTRUCTIONS>".to_string();
}
if text.starts_with(EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG) {
return "<EXPLICIT_PLUGIN_INSTRUCTIONS>".to_string();
if text.starts_with(PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG) {
return "<PLUGIN_MENTION_INSTRUCTIONS>".to_string();
}
if text.starts_with("# AGENTS.md instructions for ") {
return "<AGENTS_MD>".to_string();
+3 -3
View File
@@ -8,9 +8,9 @@ use std::time::Instant;
use anyhow::Result;
use codex_core::CodexAuth;
use codex_features::Feature;
use codex_protocol::protocol::EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::protocol::EventMsg;
use codex_protocol::protocol::Op;
use codex_protocol::protocol::PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG;
use codex_protocol::user_input::UserInput;
use core_test_support::apps_test_server::AppsTestServer;
use core_test_support::context_snapshot;
@@ -326,14 +326,14 @@ async fn explicit_plugin_mentions_inject_plugin_guidance() -> Result<()> {
assert!(
developer_messages
.iter()
.any(|text| text.contains(EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG)),
.any(|text| text.contains(PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG)),
"expected plugin mention guidance in developer messages: {developer_messages:?}"
);
let user_messages = request.message_input_texts("user");
assert!(
user_messages
.iter()
.all(|text| !text.contains(EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG)),
.all(|text| !text.contains(PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG)),
"expected plugin mention guidance to stay out of user messages: {user_messages:?}"
);
assert!(
@@ -7,6 +7,6 @@ Scenario: Explicit plugin mention request layout
## Plugin Mention Request
00:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <EXPLICIT_PLUGIN_INSTRUCTIONS>
[02] <PLUGIN_MENTION_INSTRUCTIONS>
01:message/user:<ENVIRONMENT_CONTEXT:cwd=<CWD>>
02:message/user:help me inspect the sample plugin
+2 -2
View File
@@ -95,8 +95,8 @@ pub const SKILLS_INSTRUCTIONS_OPEN_TAG: &str = "<skills_instructions>";
pub const SKILLS_INSTRUCTIONS_CLOSE_TAG: &str = "</skills_instructions>";
pub const PLUGINS_INSTRUCTIONS_OPEN_TAG: &str = "<plugins_instructions>";
pub const PLUGINS_INSTRUCTIONS_CLOSE_TAG: &str = "</plugins_instructions>";
pub const EXPLICIT_PLUGIN_INSTRUCTIONS_OPEN_TAG: &str = "<explicit_plugin_instructions>";
pub const EXPLICIT_PLUGIN_INSTRUCTIONS_CLOSE_TAG: &str = "</explicit_plugin_instructions>";
pub const PLUGIN_MENTION_INSTRUCTIONS_OPEN_TAG: &str = "<plugin_mention_instructions>";
pub const PLUGIN_MENTION_INSTRUCTIONS_CLOSE_TAG: &str = "</plugin_mention_instructions>";
pub const COLLABORATION_MODE_OPEN_TAG: &str = "<collaboration_mode>";
pub const COLLABORATION_MODE_CLOSE_TAG: &str = "</collaboration_mode>";
pub const REALTIME_CONVERSATION_OPEN_TAG: &str = "<realtime_conversation>";