Skip to content

agentserver: use FOUNDRY_HOSTED for hosted environment detection#46203

Merged
RaviPidaparthi merged 1 commit intoagentserver/responsesfrom
agentserver/foundry-hosted-env
Apr 8, 2026
Merged

agentserver: use FOUNDRY_HOSTED for hosted environment detection#46203
RaviPidaparthi merged 1 commit intoagentserver/responsesfrom
agentserver/foundry-hosted-env

Conversation

@ammaaradammicrosoft
Copy link
Copy Markdown
Member

Replace the heuristic three-var + FOUNDRY_ENVIRONMENT check with a simple opt-in: is_hosted returns True only when FOUNDRY_HOSTED=true, which the platform injects exclusively into hosted containers.

This prevents false-positive Foundry storage auto-activation when a developer sets FOUNDRY_PROJECT_ENDPOINT or other FOUNDRY_* vars locally (e.g. to use agent_framework features) without intending to run in a hosted environment.

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Replace the heuristic three-var + FOUNDRY_ENVIRONMENT check with a
simple opt-in: is_hosted returns True only when FOUNDRY_HOSTED=true,
which the platform injects exclusively into hosted containers.

This prevents false-positive Foundry storage auto-activation when a
developer sets FOUNDRY_PROJECT_ENDPOINT or other FOUNDRY_* vars locally
(e.g. to use agent_framework features) without intending to run in a
hosted environment.
@ammaaradammicrosoft ammaaradammicrosoft force-pushed the agentserver/foundry-hosted-env branch from 999f6a4 to ac7e459 Compare April 8, 2026 23:08
@RaviPidaparthi RaviPidaparthi merged commit 94227f8 into agentserver/responses Apr 8, 2026
2 of 3 checks passed
@RaviPidaparthi RaviPidaparthi deleted the agentserver/foundry-hosted-env branch April 8, 2026 23:21
@ammaaradammicrosoft ammaaradammicrosoft restored the agentserver/foundry-hosted-env branch April 8, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants