feat: add serviceUrl validation and env parsing utilities…#1134
Open
matthewmeyer wants to merge 7 commits into
Open
feat: add serviceUrl validation and env parsing utilities…#1134matthewmeyer wants to merge 7 commits into
matthewmeyer wants to merge 7 commits into
Conversation
…onnectorClient - will come back and unify with envParser<K>` introduced in PR #1119 in a followup - Introduced `parseBooleanEnv` and `parseIntEnv` functions for robust environment variable parsing in `utils/env.ts`. - Replaced inline parsing logic in `ConnectorClient` with `parseIntEnv` for cleaner code and better maintainability. - Added comprehensive unit tests for environment variable utilities in `utils/env.test.ts`. - Implemented extensive tests for `CloudAdapter` options to ensure proper handling of environment variables and validation logic. - Enhanced logging for invalid activities and unknown environment variables in `CloudAdapter`.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds internal environment-variable parsing helpers and expands CloudAdapter runtime configuration to support .NET-parity options (serviceUrl host validation and stack-trace logging), along with new unit tests to cover these behaviors.
Changes:
- Introduced internal env helpers (
parseBooleanEnv,parseIntEnv,suggestClosest) and corresponding unit tests. - Added
CloudAdapterOptionssupport forvalidateServiceUrlandemitStackTrace, including env-var loading, unknown-key diagnostics, and invalid-activity logging. - Refactored
ConnectorClientto useparseIntEnvforMAX_APX_CONVERSATION_ID_LENGTH.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/agents-hosting/src/utils/env.ts | Adds internal env parsing and “did you mean” suggestion utilities. |
| packages/agents-hosting/test/utils/env.test.ts | Adds unit tests for env parsing + suggestion behavior. |
| packages/agents-hosting/src/connector-client/connectorClient.ts | Uses parseIntEnv for conversation-id max length parsing. |
| packages/agents-hosting/src/cloudAdapter.ts | Adds CloudAdapterOptions, env loading/diagnostics, serviceUrl validation, and enhanced logging. |
| packages/agents-hosting/test/hosting/adapter/cloudAdapter.options.test.ts | Adds extensive tests for new CloudAdapter option/env behaviors and logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ivity body and update environment warning diagnostics
…update related tests
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.
… and integrate into ConnectorClient
parseBooleanEnvandparseIntEnvfunctions for robust environment variable parsing inutils/env.ts.ConnectorClientwithparseIntEnvfor cleaner code and better maintainability.utils/env.test.ts.CloudAdapteroptions to ensure proper handling of environment variables and validation logic.CloudAdapter.