implementing mcp invocation approvals#2769
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This seems like multiple PRs bundled together Regarding the approval design - is the approval gate in the right layer? Currently, it lives inside the tool execution engine (tools.py), where each worker independently checks policy, emits events, and blocks waiting for a decision. But the orchestrator (_process_tool_calls_for_round) already makes other pre-execution decisions at this level (token budget checks, duplicate tool filtering). Approval is the same kind of gate. Proposed flow: In other words, just collect all tools needing approval, emit them together, wait for all decisions (or timeout and exit). |
Why. What is implemented is cleaner and faster. What you are suggesting will require an extra loop to collect approval requests. That will make the overall logic slower and more complex |
Faster = this executes tools without approval need right away. That is the only speed difference. The turn is blocked either way on user approvals. It can be done in docsummarizer layer too. It is also using polling and not Cleaner = approval logic lives in the tool execution engine, which was stateless (tool in, result out). It now reads config.tools_approval and config.pending_approval_store, generates UUIDs, and polls for decisions. Also streaming_ols.py now has to inspect item.data.get("event") != "approval_required" to filter approval events from stored tool calls - that's approval semantics leaking into a layer that shouldn't need to know about it. Can we at least isolate the config dependency? |
11336f4 to
35804a2
Compare
It also delivers approval requests faster and in parallel. Doing this in doc-summarizer seems quite wrong - approval is part of tools invocation, thats why it is done the way it is |
This is a different issue. Fixed most of it by introducing an additional type. It's cleaner because approval is done where it belongs - in the tools invocation. Except for yield, the code looks similar to sequential code, which is quite simple. Tools execution is still stateless, its just longer. |
145ecdc to
fe25c38
Compare
fe25c38 to
8a43dac
Compare
8a43dac to
6464e1f
Compare
|
/test "ci/prow/verify" |
|
/test verify |
2abe6b9 to
32ff351
Compare
|
/retest |
32ff351 to
02d9b6e
Compare
02d9b6e to
5d04729
Compare
|
/retest |
1 similar comment
|
/retest |
5d04729 to
b792350
Compare
8b532ae to
769ff88
Compare
769ff88 to
6d6004c
Compare
|
/retest |
6d6004c to
f3bc8d9
Compare
f3bc8d9 to
b78d564
Compare
Made-with: Cursor
b78d564 to
fcb8a62
Compare
|
@blublinsky: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
Implementing MCP approvals for streaming query only
Type of change
Related Tickets & Documents
OLS-2659
OLS-2659
Checklist before requesting a review
Testing