Skip to content

Add tool lifecycle extension contributor#23309

Merged
jif-oai merged 4 commits into
mainfrom
jif/contrib-tool-lifecycle
May 18, 2026
Merged

Add tool lifecycle extension contributor#23309
jif-oai merged 4 commits into
mainfrom
jif/contrib-tool-lifecycle

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

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

Why

Extensions that need to track runtime progress currently have no typed host signal for tool execution. The goal extension in particular needs to observe tool attempts without inspecting tool payloads, owning tool implementations, or staying coupled to core-only runtime plumbing.

This adds a narrow lifecycle contributor API for host-owned tool execution: extensions can observe when an accepted tool call starts and how it finishes, while policy hooks and tool handlers continue to own payload rewriting, blocking, and execution.

Relevant code:

What Changed

  • Added ToolLifecycleContributor to codex-extension-api, including:
    • ToolStartInput
    • ToolFinishInput
    • ToolCallSource
    • ToolCallOutcome
  • Added registration and lookup support on ExtensionRegistryBuilder / ExtensionRegistry.
  • Wired core tool dispatch to notify lifecycle contributors for:
    • accepted tool starts
    • completed tool calls, including the tool output success marker
    • pre-tool-use blocks
    • failures before or after the handler runs
    • cancellation/abort in the parallel tool path
  • Registered the goal extension as a lifecycle contributor and added the outcome filter it will use for goal progress accounting.

Test Coverage

  • Added dispatch_notifies_tool_lifecycle_contributors to cover lifecycle notification ordering and outcomes for successful and handler-failed tool calls.

@jif-oai jif-oai requested a review from a team as a code owner May 18, 2026 14:27
@jif-oai jif-oai changed the title feat: add ToolLifecycleContributor Add tool lifecycle extension contributor May 18, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 18, 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: 3e250c7fac

ℹ️ 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/core/src/tools/parallel.rs Outdated
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 18, 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: d0c284ab43

ℹ️ 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/core/src/tools/parallel.rs Outdated
Comment thread codex-rs/core/src/tools/parallel.rs Outdated
Comment thread codex-rs/core/src/tools/registry.rs Outdated
@jif-oai jif-oai merged commit c69cde3 into main May 18, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/contrib-tool-lifecycle branch May 18, 2026 19:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 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