Skip to content

[DX] GAP-19: .env config values silently absent on Orchestrator causing mid-execution failures with stale defaults #1509

@AlexBizon

Description

@AlexBizon

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.py default: 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

  1. 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.
  2. SDK-level: When sdk.tasks.create() is about to be called, validate that the app exists in the specified folder before creating the task.
  3. Documentation: Document clearly that .env values 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions