Skip to content

Align denied tool durable events - #437

Open
sethjuarez wants to merge 1 commit into
microsoft:mainfrom
sethjuarez:sejuare-microsoft/reconcile-denial-events
Open

Align denied tool durable events#437
sethjuarez wants to merge 1 commit into
microsoft:mainfrom
sethjuarez:sejuare-microsoft/reconcile-denial-events

Conversation

@sethjuarez

Copy link
Copy Markdown
Member

Summary

  • preserve the written contract that permission denial does not emit tool execution events
  • checkpoint denied results without claiming execution completion, then commit them in model-request order
  • pin the complete denial event sequence in the shared turn vector and Rust live-port test

Validation

  • cargo test --manifest-path runtime/rust/Cargo.toml -p prompty
  • cargo clippy --manifest-path runtime/rust/Cargo.toml -p prompty -- -D warnings
  • cargo fmt --manifest-path runtime/rust/Cargo.toml --all -- --check

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 07:04

Copilot AI left a comment

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.

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 eventKinds expectation 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 to tool_result_committed.
  • Refactor TurnEngine::execute_tool() to return a ToolExecution wrapper 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants