Align denied tool durable events - #437
Open
sethjuarez wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the Rust turn engine’s durability event stream for denied tool requests with the established contract that permission denial must not emit tool execution events, while still checkpointing the denied result and later committing tool results in model-request order. It also pins the expected event-kind sequence in the spec vector and the Rust live-port test to prevent regressions.
Changes:
- Add an explicit
eventKindsexpectation to the permission-denial turn vector. - Tighten the Rust live-port test to assert the absence of
tool_execution_started/tool_execution_completed, and to order denial relative totool_result_committed. - Refactor
TurnEngine::execute_tool()to return aToolExecutionwrapper so persistence can distinguish “denied before execution started” vs “execution occurred”, and conditionally emit/persist tool execution completion events accordingly.
Show a summary per file
| File | Description |
|---|---|
| spec/vectors/engine/turn_vectors.json | Pins the full ordered eventKinds sequence for permission-denial behavior. |
| runtime/rust/prompty/tests/live_turn_ports.rs | Updates the denial test assertions to require no tool execution events and to validate ordering against tool_result_committed. |
| runtime/rust/prompty/src/engine/turn.rs | Introduces ToolExecution to track whether execution started and conditionally persists tool execution completion events while still checkpointing denied results. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
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.
Summary
Validation