feat: agents apis#375
Merged
Natalia Markitantova (markitosha) merged 5 commits intomasterfrom Apr 15, 2026
Merged
Conversation
Copilot started reviewing on behalf of
Thijs van der Velden (tve-corti)
April 13, 2026 13:59
View session
There was a problem hiding this comment.
Pull request overview
This PR improves the SDK developer experience by adding (1) a helper for constructing the agent-card URL and (2) a helper for generating auth-related headers for custom requests.
Changes:
- Added
agents.getCardUrl(agentId)on a custom Agents client to construct/agents/{agentId}/agent-card.jsonagainst the environment-specific agents base URL. - Added
CortiClient.getAuthHeaders()to return aHeadersobject containingAuthorizationandTenant-Name. - Added unit tests covering these helpers across auth/environment scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/custom/CortiClient.ts |
Integrates CustomAgents into CortiClient and adds getAuthHeaders() helper. |
src/custom/agents/CustomAgents.ts |
Introduces CustomAgents extending the generated AgentsClient and adds getCardUrl(). |
tests/custom/agents.getCardUrl.test.ts |
Adds tests for the new agents.getCardUrl() helper. |
tests/custom/cortiClient.getAuthHeaders.test.ts |
Adds tests for the new CortiClient.getAuthHeaders() helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Natalia Markitantova (markitosha)
left a comment
There was a problem hiding this comment.
LGTM 👍
Only one comment about comment 😅 (and you have to fix linter anyway)
Ping me if you need instructions how to "release" a version (I believe I didn't update docs yet)!
Natalia Markitantova (markitosha)
approved these changes
Apr 15, 2026
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
This pull request adds two new helper methods to the SDK to improve developer experience when working with agent cards and authentication headers.
Changes
1. Add
agents.getCardUrl()methodIntroduces a new helper method
getCardUrl(agentId: string): Promise<URL>to the agents client that constructs the URL for retrieving an agent's card JSON file. The method automatically resolves the correct environment-specific base URL and builds the path/agents/{agentId}/agent-card.json.Implementation:
CustomAgentsclass extending the auto-generatedAgentsClientCortiClientTest coverage: Unit tests for various agent IDs, environments (eu, us, dev-eu), authentication methods (client credentials, bearer token), and URL encoding edge cases.
2. Add
getAuthHeaders()methodAdds a new public method
getAuthHeaders(): Promise<Headers>toCortiClientthat returns a Headers object containing the Authorization header with the current access token and the Tenant-Name header. This simplifies header construction for developers making custom API requests.Implementation:
Test coverage: Comprehensive tests covering client credentials, bearer tokens, async token retrieval, error propagation, and header structure validation.
Files Modified