Skip to content

extension: move git attribution into an extension#21738

Merged
jif-oai merged 5 commits into
mainfrom
jif/extension-git-attribution
May 11, 2026
Merged

extension: move git attribution into an extension#21738
jif-oai merged 5 commits into
mainfrom
jif/extension-git-attribution

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 8, 2026

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-core so Session can consume extension-contributed prompt fragments instead of owning a one-off policy path itself.

Before this PR, Session injected the trailer instruction directly from codex-core (session assembly, helper module). This branch moves that same responsibility into codex-git-attribution.

What changed

  • Added the codex-git-attribution extension crate.
  • Snapshot CodexGitCommit plus commit_attribution at thread start, then contribute the developer-policy fragment through the extension registry.
  • Register the extension in app-server thread extensions.
  • Remove the old codex-core helper module and direct Session injection path.

This keeps the existing behavior intact: the prompt is only contributed when CodexGitCommit is enabled, blank attribution still disables the trailer, and the default remains Codex <noreply@openai.com>.

Stack

@jif-oai jif-oai requested a review from a team as a code owner May 8, 2026 12:45
@jif-oai jif-oai force-pushed the jif/extension-wiring branch from a57a747 to 2eb48e8 Compare May 11, 2026 09:20
Base automatically changed from jif/extension-wiring to main May 11, 2026 09:38
jif-oai added 2 commits May 11, 2026 10:49
…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
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 11, 2026

@codex review

Copy link
Copy Markdown
Contributor

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

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: 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())
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.

P1 Badge 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 👍 / 👎.

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.

It's all good

Comment thread codex-rs/app-server/Cargo.toml
@jif-oai jif-oai merged commit 569ff6a into main May 11, 2026
29 checks passed
@jif-oai jif-oai deleted the jif/extension-git-attribution branch May 11, 2026 10:53
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 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.

2 participants