Add tool lifecycle extension contributor#23309
Conversation
ToolLifecycleContributor|
@codex review |
There was a problem hiding this comment.
💡 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".
|
@codex review |
There was a problem hiding this comment.
💡 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".
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:
ToolLifecycleContributordefines the extension-facing observer contract.tool_lifecycle.rsdefines the typed start/finish inputs, source, and outcome enums.notify_tool_start/notify_tool_finishbridges core tool dispatch into the extension registry.What Changed
ToolLifecycleContributortocodex-extension-api, including:ToolStartInputToolFinishInputToolCallSourceToolCallOutcomeExtensionRegistryBuilder/ExtensionRegistry.Test Coverage
dispatch_notifies_tool_lifecycle_contributorsto cover lifecycle notification ordering and outcomes for successful and handler-failed tool calls.