Repository navigation
Action Gateway Tools in Responses Endpoint - #207
Open
tgillam-do wants to merge 9 commits into
Open
tgillam-do wants to merge 9 commits into
tgillam-do wants to merge 9 commits into
Conversation
Bring the feature branch onto the latest generated client baseline while preserving its Action Gateway API additions. Co-authored-by: Cursor <cursoragent@cursor.com>
Make the Responses provider easy to select and stop advertising legacy compatibility aliases that produce invalid or confusing tool schemas. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds Action Gateway support across generated APIs, inference providers, documentation, examples, and tests.
Changes:
- Adds session-bound tool handling for Chat Completions, Messages, and Responses.
- Exposes generated Action Gateway resources for sessions, tools, toolbelts, connections, and users.
- Adds package exports, documentation, examples, and mocked tests.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/mocked/action-gateway.test.ts |
Tests Action Gateway workflows. |
src/dots/v2/index.ts |
Exposes Action Gateway under V2. |
src/dots/v2/actionGateway/users/item/index.ts |
Adds user lookup API. |
src/dots/v2/actionGateway/users/index.ts |
Adds user listing API. |
src/dots/v2/actionGateway/tools/toolkits/index.ts |
Adds toolkit listing API. |
src/dots/v2/actionGateway/tools/providers/index.ts |
Adds provider listing API. |
src/dots/v2/actionGateway/tools/item/index.ts |
Adds per-tool navigation. |
src/dots/v2/actionGateway/tools/item/definition/index.ts |
Adds tool-definition retrieval. |
src/dots/v2/actionGateway/tools/index.ts |
Adds tool registry APIs. |
src/dots/v2/actionGateway/toolbelts/item/tools/remove/index.ts |
Adds toolbelt removal operation. |
src/dots/v2/actionGateway/toolbelts/item/tools/index.ts |
Adds membership navigation. |
src/dots/v2/actionGateway/toolbelts/item/tools/add/index.ts |
Adds toolbelt membership operation. |
src/dots/v2/actionGateway/toolbelts/item/index.ts |
Adds toolbelt item operations. |
src/dots/v2/actionGateway/toolbelts/index.ts |
Adds toolbelt collection APIs. |
src/dots/v2/actionGateway/sessions/item/index.ts |
Adds session deletion API. |
src/dots/v2/actionGateway/sessions/index.ts |
Adds session collection APIs. |
src/dots/v2/actionGateway/index.ts |
Defines generated gateway navigation. |
src/dots/v2/actionGateway/connections/item/index.ts |
Adds connection item operations. |
src/dots/v2/actionGateway/connections/index.ts |
Adds connection collection APIs. |
src/dots/kiota-lock.json |
Updates Kiota generation metadata. |
src/action-gateway/index.ts |
Implements the high-level gateway client. |
README.md |
Introduces Action Gateway usage. |
package.json |
Exports the Action Gateway module. |
examples/action-gateway/toolbelt-policy.ts |
Demonstrates toolbelt policies. |
examples/action-gateway/session-controls.ts |
Demonstrates session controls. |
examples/action-gateway/responses.ts |
Demonstrates Responses integration. |
examples/action-gateway/public-api.ts |
Demonstrates generated APIs. |
examples/action-gateway/messages.ts |
Demonstrates Messages integration. |
examples/action-gateway/direct-tools.ts |
Demonstrates direct invocation. |
examples/action-gateway/create-toolbelt.ts |
Demonstrates toolbelt management. |
examples/action-gateway/chat-completions.ts |
Demonstrates Chat Completions. |
examples/action-gateway/async.ts |
Demonstrates parallel tool loading. |
docs/action-gateway.md |
Documents gateway workflows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| function stringifyResult(value: unknown): string { | ||
| return typeof value === "string" ? value : JSON.stringify(value); |
| } | ||
|
|
||
| function externalSessionId(sessionUrn: string): string { | ||
| return sessionUrn.split(":").at(-1) ?? sessionUrn; |
Comment on lines
+470
to
+477
| const envelope = parseMCPEnvelope(text); | ||
| if (!response.ok) { | ||
| throw new GatewayError( | ||
| String(asObject(envelope).message ?? response.statusText ?? "request failed"), | ||
| response.status, | ||
| envelope, | ||
| ); | ||
| } |
Comment on lines
+59
to
+65
| const response = await gateway.responses.create({ | ||
| model: "openai-gpt-4o", | ||
| input: "Find the latest DigitalOcean news and summarize it.", | ||
| tools: await session.tools(), | ||
| }); | ||
|
|
||
| const toolOutputs = await session.handleToolCalls(response); |
Comment on lines
+16
to
+22
| const response = await gateway.responses.create({ | ||
| model: "openai-gpt-4o", | ||
| input: "Find the latest DigitalOcean news and summarize it.", | ||
| tools: await session.tools(), | ||
| }); | ||
|
|
||
| console.dir(await session.handleToolCalls(response), { depth: null }); |
This branch has not been deployed
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.
Resolves issues with the Responses endpoint when using Action Gateway tools.