Skip to content

Use templates for goal steering prompts#25576

Merged
jif-oai merged 1 commit into
mainfrom
jif/prompting-template-2
Jun 1, 2026
Merged

Use templates for goal steering prompts#25576
jif-oai merged 1 commit into
mainfrom
jif/prompting-template-2

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Why

Goal steering prompts have grown into long inline Rust strings, which makes the authored prompt text hard to review and easy to damage while changing the surrounding plumbing. Moving those prompts into embedded Markdown templates keeps the policy text in the shape reviewers actually read, while preserving the existing runtime substitution and objective escaping behavior.

What changed

  • Added ext/goal/templates/goals/continuation.md, budget_limit.md, and objective_updated.md for the three goal steering prompts.
  • Updated ext/goal/src/steering.rs to parse those embedded templates once with codex-utils-template and render the existing goal values into them.
  • Kept user objectives XML-escaped before rendering and converted budget counters into template variables.
  • Added the template directory to ext/goal/BUILD.bazel compile_data so Bazel has the same embedded prompt inputs as Cargo.

Testing

  • Not run locally.

@jif-oai

jif-oai commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@jif-oai jif-oai changed the title feat: use templating for goal prompting Use templates for goal steering prompts Jun 1, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9872f65d9

ℹ️ 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".

Comment thread codex-rs/ext/goal/src/steering.rs
@jif-oai jif-oai merged commit c875bc8 into main Jun 1, 2026
30 checks passed
@jif-oai jif-oai deleted the jif/prompting-template-2 branch June 1, 2026 08:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant