Improve openai_ask tool-use behavior#719
Open
iangmaia wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens and hardens openai_ask’s Chat Completions + tool-use loop behavior, with a focus on safer logging, stricter tool validation, and clearer iteration limiting semantics.
Changes:
- Switch Chat Completions requests to
max_completion_tokensand opt out of request storage viastore: false. - Add validation for tool definitions and returned tool-call payloads, preventing malformed/unsupported tool calls from invoking local handlers.
- Adjust the tool-use loop to cap local tool execution rounds while still allowing one final model turn to produce an answer; reduce sensitive data exposure in logs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/openai_ask_action.rb |
Updates request parameters, adds tool/max-iteration validation, hardens tool-call execution and logging, and refines loop termination semantics. |
spec/openai_ask_action_spec.rb |
Adds/updates specs for new request fields, iteration cap behavior, tool validation, and sensitive logging guarantees. |
CHANGELOG.md |
Documents the openai_ask tool-use behavior improvements under Trunk bug fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Improves
openai_askfollow-up behavior after the initial tool-use support:max_completion_tokensfor Chat Completions requests.store: falseto opt out of OpenAI request storage.Checklist before requesting a review
bundle exec rubocopto test for code style violations and recommendations.specs/*_spec.rb) if applicable.bundle exec rspecto run the whole test suite and ensure all your tests pass.CHANGELOG.mdfile to describe your changes under the appropriate existing###subsection of the existing## Trunksection.MIGRATION.mdfile to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.