From 31810cbefdb244ad5eb2eb2a229e2e32d6266fde Mon Sep 17 00:00:00 2001 From: James Devine Date: Wed, 22 Apr 2026 08:39:28 +0100 Subject: [PATCH] docs: fix stale {{ copilot_ado_env }} docs, add TODO for test engine hardcode - Replace obsolete {{ copilot_ado_env }} AGENTS.md section with correct {{ engine_env }} docs (engine-specific env vars: GITHUB_TOKEN, OTEL) - Add TODO to CompileContext::for_test() flagging hardcoded Engine::Copilot as tech debt for when multiple engines are supported Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- AGENTS.md | 10 +++++++--- src/compile/extensions/mod.rs | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 21d30ee..0f12da0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -873,11 +873,15 @@ The step: If `permissions.read` is not configured, this marker is replaced with an empty string. -## {{ copilot_ado_env }} +## {{ engine_env }} -Generates environment variable entries for the copilot AWF step when `permissions.read` is configured. Sets both `AZURE_DEVOPS_EXT_PAT` and `SYSTEM_ACCESSTOKEN` to the read service connection token (`SC_READ_TOKEN`). +Generates engine-specific environment variable entries for the AWF sandbox step via `Engine::env()`. For the Copilot engine, this produces: -If `permissions.read` is not configured, this marker is replaced with an empty string, and ADO access tokens are omitted from the copilot invocation. +- `GITHUB_TOKEN: $(GITHUB_TOKEN)` — GitHub authentication +- `GITHUB_READ_ONLY: 1` — Restricts GitHub API to read-only access +- `COPILOT_OTEL_ENABLED`, `COPILOT_OTEL_EXPORTER_TYPE`, `COPILOT_OTEL_FILE_EXPORTER_PATH` — OpenTelemetry file-based tracing for agent statistics + +ADO access tokens (`AZURE_DEVOPS_EXT_PAT`, `SYSTEM_ACCESSTOKEN`) are not part of this marker — they are injected separately by `{{ acquire_ado_token }}` and extension pipeline variable mappings when `permissions.read` is configured. ## {{ acquire_write_token }} diff --git a/src/compile/extensions/mod.rs b/src/compile/extensions/mod.rs index 46d612e..1674ec7 100644 --- a/src/compile/extensions/mod.rs +++ b/src/compile/extensions/mod.rs @@ -156,6 +156,9 @@ impl<'a> CompileContext<'a> { } /// Create a context for tests (no async, no git remote inference). + // TODO: resolve engine from front_matter.engine when multiple engines are supported, + // instead of hardcoding Engine::Copilot. Currently safe because "copilot" is the only + // engine variant, but this will need to call get_engine() once more are added. #[cfg(test)] pub fn for_test(front_matter: &'a FrontMatter) -> Self { Self {