Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

ChatControl builds an invalid API hostname for **default** Power Platform environments

Offen Anfängerfreundlich
#534 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
75/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
typescript
Bereich
api

Rechercherichtung

Beginne in ui/embed/pcf-canvas-app, dem ChatControl PCF-Beispiel, und finde die Konstruktion von environmentId zu hostname. Überprüfe den abgeleiteten Host sowohl für Default- als auch für reine GUID-Umgebungs-IDs anhand des Web app channel host und bestätige anschließend, dass Anfragen an den conversations-Endpunkt den gültigen Hostnamen verwenden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Repo: microsoft/CopilotStudioSamples
Sample: ui/embed/pcf-canvas-app (ChatControl PCF, solution AgentControls)

Summary

ChatControl constructs the Copilot Studio direct-to-engine hostname by splitting the environment ID two characters from the end. That is correct for a 32-character GUID, but a default environment's ID is Default- followed by a GUID — 39 characters — so the split lands seven characters early and produces a hostname that does not exist in DNS.

Every request fails with net::ERR_NAME_NOT_RESOLVED. No conversation is created, no session is recorded on the agent, and the control shows a typing indicator indefinitely. The panel surfaces no error to the user.

Environment

  • Power Platform environment: default environment (Default-<tenant GUID>)
  • Agent: published, works correctly in the Teams and Microsoft 365 channels
  • Web app channel: enabled
  • Entra app registration: Single-page application platform, delegated CopilotStudio.Copilots.Invoke, admin consent granted
  • Token acquisition: succeeds (fails only if the redirect URIs are registered under the Web platform — separate, expected, AADSTS9002326)

Repro

  1. Use a tenant's default Power Platform environment.
  2. Create and publish a Copilot Studio agent in it. Enable the Web app channel.
  3. Configure ChatControl with environmentId set to the value shown in Copilot Studio → Settings → Advanced → Metadata, i.e. Default-<tenant GUID>.
  4. Open the app and start a conversation.

Expected

The control calls the host published by Copilot Studio → Channels → Web app:

https://default5e04a99d91a64ede9f8be6cdea7e2f.9d.environment.api.powerplatform.com/
    copilotstudio/dataverse-backed/authenticated/bots/<schemaName>/conversations?api-version=2022-03-01-preview

Actual

The control calls a host with the label boundary seven characters too early:

https://default5e04a99d91a64ede9f8be6c.dea7e2f9d.environment.api.powerplatform.com/
    copilotstudio/dataverse-backed/authenticated/bots/<schemaName>/conversations?api-version=2022-03-01-preview

Side by side:

expected: default5e04a99d91a64ede9f8be6cdea7e2f . 9d      (37 + 2)
actual:   default5e04a99d91a64ede9f8be6c        . dea7e2f9d (30 + 9)

Network tab shows repeated (failed) net::ERR_NAME_NOT_RESOLVED on conversations?api-version=2022-03-01-preview, including the CORS preflight.

Verification that this is a hostname bug and not DNS or configuration

  • The expected host resolves and responds:
    GET https://default5e04a99d91a64ede9f8be6cdea7e2f.9d.environment.api.powerplatform.com/ →
    {"code":"RouteNotFound","message":"The request URI ... does not match any known API routes."}
  • The actual host does not resolve: DNS_PROBE_FINISHED_NXDOMAIN.
  • Passing the bare GUID instead of the Default--prefixed ID does not help: the resulting host 5e04a99d91a64ede9f8be6cdea7e2f.9d.environment.api.powerplatform.com also returns NXDOMAIN, because the default prefix is part of the real hostname.

There is therefore no value of environmentId that yields a working host on a default environment.

Suggested fix

Derive the hostname from the environment ID by taking the last two characters as the trailing DNS label after removing hyphens and lowercasing, rather than assuming a fixed 32-character length:

const id = environmentId.replace(/-/g, '').toLowerCase();
const host = `${id.slice(0, -2)}.${id.slice(-2)}.environment.api.powerplatform.com`;

This produces the correct host for both Default-<guid> and plain-GUID environment IDs.

Alternatively, accept the full connection string from Copilot Studio → Channels → Web app as a control property, which removes the need to reconstruct the hostname at all.

Impact

Any tenant whose agent lives in the default environment — the common case for organisations that have never created additional environments — cannot use this control at all, and the failure mode gives no actionable error.

Vorherrschende Sprache
TypeScript
Sterne
807
Forks
494
Ø Merge
2 T. 3 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/CopilotStudioSamples

Alle Issues in microsoft/CopilotStudioSamples

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.