-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Summary
Config values present in a local .env file are silently absent on Orchestrator (because .env is not loaded on Orchestrator), causing the agent to fall back to hardcoded defaults that may be stale or wrong. The mismatch is only discovered mid-execution after expensive tool calls have already completed.
Root Cause
pydantic-settings reads from .env locally (via load_dotenv()) but on Orchestrator only reads from the process's actual environment variables. If a value exists in .env locally but is not declared as an Orchestrator env var, the production code falls back to the hardcoded Config default — which may not match the production deployment.
Observed Behaviour
- Local
.env:ACTION_CENTER_APP_NAME=App config.pydefault:action_center_app_name: str = "Invoicereviewform"- Orchestrator env var: not set
- Result: agent uses
"Invoicereviewform", fails with"App 'Invoicereviewform' was not found in folder 'Shared/Solution Invoice App'"— after all expensive tool calls (DU extraction, Salesforce queries, budget checks) have already completed
Workaround
Either set the env var explicitly in the Orchestrator process configuration, or update the hardcoded default in config.py to match the production value.
Suggested Fix
- Dry-run validation at startup: Before the first
interrupt()call, attempt a schema lookup for the Action Center app (or equivalent existence check). Surface the mismatch at job start rather than mid-execution. - SDK-level: When
sdk.tasks.create()is about to be called, validate that the app exists in the specified folder before creating the task. - Documentation: Document clearly that
.envvalues are not automatically available on Orchestrator and that all production config must be declared as Orchestrator env vars.
Impact
- Severity: Medium
- Failure happens mid-execution after expensive operations, wasting compute and time
- The error message (
"App not found") does not hint at the env var mismatch root cause