Skip to content

[Bug] TypeScript quickstart samples broken: outdated SDK, hardcoded values, incorrect module config #734

@haoozhang

Description

@haoozhang

Problem

The TypeScript quickstart samples (agent-service, chat-with-agent, create-agent, responses) have several
issues that prevent users from running them successfully:

  1. Outdated SDK version@azure/ai-projects is pinned to 1.0.0, but the code uses APIs (e.g.,
    agents.createVersion, responses.create) that require 2.x.

  2. Hardcoded placeholder values — Some samples use hardcoded strings like "your_project_endpoint" and
    "gpt-5-mini" instead of reading from environment variables, inconsistent with the .env-template provided.

  3. Missing dotenv/config importchat-with-agent, create-agent, and responses don't import
    dotenv/config, so .env-template values are never loaded.

  4. Verbose env var names.env-template uses AZURE_AI_PROJECT_ENDPOINT / AZURE_AI_FOUNDRY_AGENT_NAME /
    AZURE_AI_FOUNDRY_MODEL_DEPLOYMENT_NAME but the code references shorter names, causing a mismatch.

  5. Outdated tsconfig module resolution — Using "module": "ESNext" + "moduleResolution": "node" which doesn't
    align with modern Node.js ESM usage.

Expected Behavior

Users should be able to clone a quickstart, copy .env-template to .env, fill in their values, and run the sample
without additional troubleshooting.

PR link

#733

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions