Skip to content

move plugin/skill instructions into dev msg and reorder#14609

Merged
charley-oai merged 7 commits intomainfrom
dev/sayan/plugin-instr-reorder
Mar 14, 2026
Merged

move plugin/skill instructions into dev msg and reorder#14609
charley-oai merged 7 commits intomainfrom
dev/sayan/plugin-instr-reorder

Conversation

@sayan-oai
Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai commented Mar 13, 2026

Move the general Apps, Skills and Plugins instructions blocks out of user_instructions and into the developer message, with new Apps -> Skills -> Plugins order for better clarity.

Also wrap those sections in stable XML-style instruction tags (like other sections) and update prompt-layout tests/snapshots. This makes the tests less brittle in snapshot output (we can parse the sections), and it consolidates the capability instructions in one place.

Tests

Updated snapshots, added tests.

<AGENTS_MD> disappearing in snapshots is expected: before this change, the wrapped user-instructions message was kept alive by Skills content. Now that Skills and Plugins are in the developer message, that wrapper only appears when there is real project-doc/user-instructions content.

@@ -241,6 +246,15 @@ fn canonicalize_snapshot_text(text: &str) -> String {
if text.starts_with("<permissions instructions>") {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one note-- the <permissions instructions> tag is the only one that doesn't use underscores, i.e., <permissions_instructions>. can bring inline, but didn't want to touch as part of these changes.

@sayan-oai sayan-oai force-pushed the dev/sayan/plugin-instr-reorder branch 3 times, most recently from 0e87352 to 232d829 Compare March 13, 2026 20:58
## Local Compaction Request
00:message/developer:<PERMISSIONS_INSTRUCTIONS>
01:message/user[2]:
[01] <AGENTS_MD>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshots dropping <AGENTS_MD> is expected; get_user_instructions() used to carry the general Skills/Plugins sections, so the wrapped user-instructions message often existed even when there was no real project doc content. After moving those sections into the developer message, that wrapper is now only present when there is actual user/project-doc-style content, so snapshots like this legitimately drop <AGENTS_MD>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah would be nice to update the test to still show legit agents.md but that's out of scope, I think we should update these tests to show every kind of fragment (and like auto fold over all of them so when a new on is added it gets auto tested) but anyways

let (mut session, mut turn) = crate::codex::make_session_and_context().await;
let temp_cwd = TempDir::new()?;
let mut config = (*turn.config).clone();
config.cwd = temp_cwd.path().to_path_buf();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make guardian tests hermetic; some platforms would find agents.md and others wouldnt. so now we pass a temp dir.

@sayan-oai
Copy link
Copy Markdown
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

## Local Compaction Request
00:message/developer:<PERMISSIONS_INSTRUCTIONS>
01:message/user[2]:
[01] <AGENTS_MD>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah would be nice to update the test to still show legit agents.md but that's out of scope, I think we should update these tests to show every kind of fragment (and like auto fold over all of them so when a new on is added it gets auto tested) but anyways

@sayan-oai sayan-oai force-pushed the dev/sayan/plugin-instr-reorder branch from a9dc8f2 to af55151 Compare March 13, 2026 23:16
@sayan-oai sayan-oai enabled auto-merge (squash) March 13, 2026 23:27
@charley-oai charley-oai disabled auto-merge March 14, 2026 03:50
@charley-oai charley-oai merged commit d272f45 into main Mar 14, 2026
31 of 32 checks passed
@charley-oai charley-oai deleted the dev/sayan/plugin-instr-reorder branch March 14, 2026 03:51
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants