extension: move git attribution into an extension#21738
Conversation
a57a747 to
2eb48e8
Compare
…ribution # Conflicts: # codex-rs/Cargo.lock # codex-rs/Cargo.toml # codex-rs/app-server/src/extensions.rs # codex-rs/core/src/codex_delegate.rs # codex-rs/core/src/prompt_debug.rs # codex-rs/core/src/session/mod.rs # codex-rs/core/src/session/session.rs # codex-rs/core/src/session/tests.rs # codex-rs/core/src/session/tests/guardian_tests.rs # codex-rs/core/src/state/service.rs # codex-rs/core/src/thread_manager.rs # codex-rs/ext/extension-api/Cargo.toml
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7fd8171fa
ℹ️ 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".
| Arc::new(ExtensionRegistryBuilder::<Config>::new().build()) | ||
| Arc::new( | ||
| ExtensionRegistryBuilder::<Config>::new() | ||
| .with_extension(codex_git_attribution::extension()) |
There was a problem hiding this comment.
Register git attribution for every session host
Moving the prompt out of Session means hosts must install the extension. This helper only wires it into app-server; mcp-server still passes empty_extension_registry() to ThreadManager, so MCP-backed sessions with CodexGitCommit enabled no longer get the required commit trailer prompt, unlike the previous core-wide behavior.
Useful? React with 👍 / 👎.
Why
Git commit attribution is prompt policy, not session orchestration. After #21737 adds the extension-registry seam, this moves that prompt-only behavior out of
codex-coresoSessioncan consume extension-contributed prompt fragments instead of owning a one-off policy path itself.Before this PR,
Sessioninjected the trailer instruction directly fromcodex-core(session assembly, helper module). This branch moves that same responsibility intocodex-git-attribution.What changed
codex-git-attributionextension crate.CodexGitCommitpluscommit_attributionat thread start, then contribute the developer-policy fragment through the extension registry.codex-corehelper module and directSessioninjection path.This keeps the existing behavior intact: the prompt is only contributed when
CodexGitCommitis enabled, blank attribution still disables the trailer, and the default remainsCodex <noreply@openai.com>.Stack