Skip to content

feat: add serviceUrl validation and env parsing utilities…#1134

Open
matthewmeyer wants to merge 7 commits into
mainfrom
users/matthewm/serviceurl-check
Open

feat: add serviceUrl validation and env parsing utilities…#1134
matthewmeyer wants to merge 7 commits into
mainfrom
users/matthewm/serviceurl-check

Conversation

@matthewmeyer

Copy link
Copy Markdown
Contributor

… and integrate into ConnectorClient

  • Add add serviceUrl validation and env parsing as in Added optional Activity.ServiceUrl check against serviceurl claim Agents-for-net#838
  • will come back and unify with envParser` introduced in PR Simplify Authconfiguration loading by using EnvParser #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.

…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`.
Copilot AI review requested due to automatic review settings June 3, 2026 17:42
@matthewmeyer matthewmeyer requested a review from a team as a code owner June 3, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CloudAdapterOptions support for validateServiceUrl and emitStackTrace, including env-var loading, unknown-key diagnostics, and invalid-activity logging.
  • Refactored ConnectorClient to use parseIntEnv for MAX_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.

Comment thread packages/agents-hosting/src/cloudAdapter.ts Outdated
Comment thread packages/agents-hosting/src/cloudAdapter.ts Outdated
Comment thread packages/agents-hosting/src/cloudAdapter.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Comment thread packages/agents-hosting/src/cloudAdapter.ts Outdated
Comment thread packages/agents-hosting/src/cloudAdapter.ts Outdated
Comment thread packages/agents-hosting/src/cloudAdapter.ts Outdated
Comment thread packages/agents-hosting/test/hosting/adapter/cloudAdapter.options.test.ts Outdated
Comment thread packages/agents-hosting/test/hosting/adapter/cloudAdapter.options.test.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants