fix: Gateway Mode clientId and executePlan endpoint issues (v2.1.2)#43
Merged
Merged
Conversation
## Issues Fixed
1. **Gateway Mode clientId not sent in request body**
- `getPolicyApprovedContext()` now auto-populates `client_id` in request body from config
- Server requires `client_id` in JSON body for `/api/policy/pre-check` endpoint
- Previously only sent as header (X-Client-ID), causing "client_id field is required" errors
- Now matches Go SDK behavior
2. **executePlan() using non-existent endpoint**
- Changed from `/api/v1/orchestrator/plan/{planId}/execute` (404)
- Now uses `/api/request` with `request_type: "execute-plan"`
- Matches Go SDK pattern for plan execution
- Fixes MAP (Multi-Agent Planning) two-step execution
## Testing
- All 80 unit tests pass
- Fixed potential NPE in context null check
- Verified with live examples (PII, SQLi, MAP, Execution Replay)
b02059c to
bbec0a8
Compare
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
getPolicyApprovedContext()to auto-populateclient_idin request body from configexecutePlan()to use correct/api/requestendpoint instead of non-existent orchestrator endpointIssues Fixed
1. Gateway Mode clientId not sent in request body
client_idin JSON body for/api/policy/pre-checkendpointclientIdin request body from config when not explicitly provided (matches Go SDK behavior)2. executePlan() using non-existent endpoint
/api/v1/orchestrator/plan/{planId}/executewhich returns 404/api/requestwithrequest_type: "execute-plan"(matches Go SDK)Test plan