From 4c6b0f5e9288b9cf72d7c139dac4013793810617 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 May 2026 23:30:30 +0000 Subject: [PATCH 1/2] feat: query /reflect before running the agent in harnesses Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e7a915e7-dc86-42df-b7cb-3bd3a0835751 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/claude_harness.cjs | 4 ++++ actions/setup/js/copilot_harness.cjs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/actions/setup/js/claude_harness.cjs b/actions/setup/js/claude_harness.cjs index eaf35226533..d88009c788f 100644 --- a/actions/setup/js/claude_harness.cjs +++ b/actions/setup/js/claude_harness.cjs @@ -218,6 +218,10 @@ async function main() { // task instructions are never written to stderr or captured in agent logs. const safeInitialArgs = hadPromptFile && initialArgs.length > 0 ? [...initialArgs.slice(0, -1), ""] : initialArgs; + // Fetch AWF API proxy reflection data before running the agent to capture initial proxy state. + // This is best-effort: failures are logged but do not affect the agent run. + await fetchAWFReflect({ logger: log }); + let delay = INITIAL_DELAY_MS; let lastExitCode = 1; let useContinueOnRetry = false; diff --git a/actions/setup/js/copilot_harness.cjs b/actions/setup/js/copilot_harness.cjs index ac2bda44064..698a6fd5211 100644 --- a/actions/setup/js/copilot_harness.cjs +++ b/actions/setup/js/copilot_harness.cjs @@ -311,6 +311,10 @@ async function main() { await checkCommandAccessible(command); const resolvedArgs = resolvePromptFileArgs(args); + // Fetch AWF API proxy reflection data before running the agent to capture initial proxy state. + // This is best-effort: failures are logged but do not affect the agent run. + await fetchAWFReflect({ logger: log }); + let delay = INITIAL_DELAY_MS; let lastExitCode = 1; const isScheduledRun = process.env.GITHUB_EVENT_NAME === "schedule"; From 91c864b0cdad4e3205c285a53029b009e1e7895b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 May 2026 23:41:50 +0000 Subject: [PATCH 2/2] feat: add post-run /reflect fetch to pi_provider.cjs on agent_end Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d5620cf5-a2f1-40d2-9071-c6eae9dca649 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/pi_provider.cjs | 27 +++++-- .../src/content/docs/agent-factory-status.mdx | 5 +- .../docs/reference/frontmatter-full.md | 73 ++++++++++++++++--- 3 files changed, 87 insertions(+), 18 deletions(-) diff --git a/actions/setup/js/pi_provider.cjs b/actions/setup/js/pi_provider.cjs index d22b6196b65..5cb00605856 100644 --- a/actions/setup/js/pi_provider.cjs +++ b/actions/setup/js/pi_provider.cjs @@ -66,10 +66,13 @@ function resolveGatewayUrl(provider) { /** * Pi provider extension for gh-aw. * - * Subscribes to the `agent_start` Pi SDK event and calls the AWF /reflect - * endpoint to discover and log the open LLM inference paths before the agent - * begins its first turn. This is best-effort: any network or parse error is - * logged but does not abort the agent session. + * Subscribes to the `agent_start` and `agent_end` Pi SDK events and calls the AWF /reflect + * endpoint to discover and log the open LLM inference paths before the agent begins its + * first turn and again after it finishes. The post-run fetch is the authoritative snapshot + * used by the step summary; the pre-run fetch captures the initial proxy state for diagnostics + * in case the session exits unexpectedly before reaching `agent_end`. + * Both calls are best-effort: any network or parse error is logged but does not abort the + * agent session. * * @param {any} pi - Pi ExtensionAPI instance * @returns {void} @@ -92,8 +95,20 @@ function piProviderExtension(pi) { log(`model=${model || "(not set)"} (no provider prefix — defaulting to Copilot gateway)`); } - // Fetch AWF API proxy reflection data and persist to disk so the post-run - // step summary (awf_reflect_summary.cjs) can include provider and model info. + // Fetch AWF API proxy reflection data before the agent runs to capture initial proxy state. + // This is best-effort: failures are logged but do not affect the agent session. + await fetchAWFReflect({ + reflectUrl: AWF_API_PROXY_REFLECT_URL, + outputPath: AWF_REFLECT_OUTPUT_PATH, + timeoutMs: AWF_REFLECT_TIMEOUT_MS, + modelsTimeoutMs: AWF_MODELS_URL_TIMEOUT_MS, + logger: log, + }); + }); + + pi.on("agent_end", async () => { + // Fetch AWF API proxy reflection data after the agent finishes for the post-run step summary. + // This is best-effort: failures are logged but do not affect the agent exit code. await fetchAWFReflect({ reflectUrl: AWF_API_PROXY_REFLECT_URL, outputPath: AWF_REFLECT_OUTPUT_PATH, diff --git a/docs/src/content/docs/agent-factory-status.mdx b/docs/src/content/docs/agent-factory-status.mdx index 507d6e38a39..8759f511dfe 100644 --- a/docs/src/content/docs/agent-factory-status.mdx +++ b/docs/src/content/docs/agent-factory-status.mdx @@ -74,6 +74,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Daily Issues Report Generator](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-issues-report.md) | copilot | [![Daily Issues Report Generator](https://github.com/github/gh-aw/actions/workflows/daily-issues-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-issues-report.lock.yml) | - | - | | [Daily Malicious Code Scan Agent](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-malicious-code-scan.md) | copilot | [![Daily Malicious Code Scan Agent](https://github.com/github/gh-aw/actions/workflows/daily-malicious-code-scan.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-malicious-code-scan.lock.yml) | - | - | | [Daily MCP Tool Concurrency Analysis](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-mcp-concurrency-analysis.md) | copilot | [![Daily MCP Tool Concurrency Analysis](https://github.com/github/gh-aw/actions/workflows/daily-mcp-concurrency-analysis.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-mcp-concurrency-analysis.lock.yml) | `daily around 9:00 on weekdays` | - | +| [Daily Model Inventory Checker](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-model-inventory.md) | copilot | [![Daily Model Inventory Checker](https://github.com/github/gh-aw/actions/workflows/daily-model-inventory.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-model-inventory.lock.yml) | - | - | | [Daily News](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-news.md) | copilot | [![Daily News](https://github.com/github/gh-aw/actions/workflows/daily-news.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-news.lock.yml) | `daily around 9:00 on weekdays` | - | | [Daily Observability Report for AWF Firewall and MCP Gateway](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-observability-report.md) | codex | [![Daily Observability Report for AWF Firewall and MCP Gateway](https://github.com/github/gh-aw/actions/workflows/daily-observability-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-observability-report.lock.yml) | - | - | | [Daily OTel Instrumentation Advisor](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-otel-instrumentation-advisor.md) | claude | [![Daily OTel Instrumentation Advisor](https://github.com/github/gh-aw/actions/workflows/daily-otel-instrumentation-advisor.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-otel-instrumentation-advisor.lock.yml) | - | - | @@ -89,6 +90,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Daily Semgrep Scan](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-semgrep-scan.md) | copilot | [![Daily Semgrep Scan](https://github.com/github/gh-aw/actions/workflows/daily-semgrep-scan.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-semgrep-scan.lock.yml) | - | - | | [Daily Sentrux Report](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-sentrux-report.md) | copilot | [![Daily Sentrux Report](https://github.com/github/gh-aw/actions/workflows/daily-sentrux-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-sentrux-report.lock.yml) | - | - | | [Daily Skill Optimizer Improvements](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-skill-optimizer.md) | copilot | [![Daily Skill Optimizer Improvements](https://github.com/github/gh-aw/actions/workflows/daily-skill-optimizer.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-skill-optimizer.lock.yml) | - | - | +| [Daily Sub-Agent Optimizer](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-subagent-optimizer.md) | claude | [![Daily Sub-Agent Optimizer](https://github.com/github/gh-aw/actions/workflows/daily-subagent-optimizer.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-subagent-optimizer.lock.yml) | - | - | | [Daily Syntax Error Quality Check](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-syntax-error-quality.md) | copilot | [![Daily Syntax Error Quality Check](https://github.com/github/gh-aw/actions/workflows/daily-syntax-error-quality.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-syntax-error-quality.lock.yml) | - | - | | [Daily Team Evolution Insights](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-team-evolution-insights.md) | claude | [![Daily Team Evolution Insights](https://github.com/github/gh-aw/actions/workflows/daily-team-evolution-insights.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-team-evolution-insights.lock.yml) | - | - | | [Daily Team Status](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-team-status.md) | copilot | [![Daily Team Status](https://github.com/github/gh-aw/actions/workflows/daily-team-status.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-team-status.lock.yml) | `daily around 9:00 on weekdays` | - | @@ -104,7 +106,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Dependabot Local Repair](https://github.com/github/gh-aw/blob/main/.github/workflows/dependabot-repair.md) | copilot | [![Dependabot Local Repair](https://github.com/github/gh-aw/actions/workflows/dependabot-repair.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/dependabot-repair.lock.yml) | - | - | | [Deployment Incident Monitor](https://github.com/github/gh-aw/blob/main/.github/workflows/deployment-incident-monitor.md) | copilot | [![Deployment Incident Monitor](https://github.com/github/gh-aw/actions/workflows/deployment-incident-monitor.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/deployment-incident-monitor.lock.yml) | - | - | | [Design Decision Gate 🏗️](https://github.com/github/gh-aw/blob/main/.github/workflows/design-decision-gate.md) | claude | [![Design Decision Gate 🏗️](https://github.com/github/gh-aw/actions/workflows/design-decision-gate.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/design-decision-gate.lock.yml) | - | - | -| [Dev](https://github.com/github/gh-aw/blob/main/.github/workflows/dev.md) | copilot | [![Dev](https://github.com/github/gh-aw/actions/workflows/dev.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/dev.lock.yml) | `daily around 9:00` | - | +| [Dev](https://github.com/github/gh-aw/blob/main/.github/workflows/dev.md) | pi | [![Dev](https://github.com/github/gh-aw/actions/workflows/dev.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/dev.lock.yml) | `daily around 9:00` | - | | [Dev Hawk](https://github.com/github/gh-aw/blob/main/.github/workflows/dev-hawk.md) | copilot | [![Dev Hawk](https://github.com/github/gh-aw/actions/workflows/dev-hawk.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/dev-hawk.lock.yml) | - | - | | [Developer Documentation Consolidator](https://github.com/github/gh-aw/blob/main/.github/workflows/developer-docs-consolidator.md) | claude | [![Developer Documentation Consolidator](https://github.com/github/gh-aw/actions/workflows/developer-docs-consolidator.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/developer-docs-consolidator.lock.yml) | - | - | | [Dictation Prompt Generator](https://github.com/github/gh-aw/blob/main/.github/workflows/dictation-prompt.md) | copilot | [![Dictation Prompt Generator](https://github.com/github/gh-aw/actions/workflows/dictation-prompt.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/dictation-prompt.lock.yml) | `weekly on sunday around 6:00` | - | @@ -181,6 +183,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Smoke Gemini](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-gemini.md) | gemini | [![Smoke Gemini](https://github.com/github/gh-aw/actions/workflows/smoke-gemini.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-gemini.lock.yml) | - | - | | [Smoke Multi PR](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-multi-pr.md) | copilot | [![Smoke Multi PR](https://github.com/github/gh-aw/actions/workflows/smoke-multi-pr.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-multi-pr.lock.yml) | - | - | | [Smoke OpenCode](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-opencode.md) | opencode | [![Smoke OpenCode](https://github.com/github/gh-aw/actions/workflows/smoke-opencode.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-opencode.lock.yml) | - | - | +| [Smoke Pi](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-pi.md) | pi | [![Smoke Pi](https://github.com/github/gh-aw/actions/workflows/smoke-pi.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-pi.lock.yml) | - | - | | [Smoke Project](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-project.md) | copilot | [![Smoke Project](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-project.lock.yml) | - | - | | [Smoke Service Ports](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-service-ports.md) | copilot | [![Smoke Service Ports](https://github.com/github/gh-aw/actions/workflows/smoke-service-ports.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-service-ports.lock.yml) | - | - | | [Smoke Temporary ID](https://github.com/github/gh-aw/blob/main/.github/workflows/smoke-temporary-id.md) | copilot | [![Smoke Temporary ID](https://github.com/github/gh-aw/actions/workflows/smoke-temporary-id.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/smoke-temporary-id.lock.yml) | - | - | diff --git a/docs/src/content/docs/reference/frontmatter-full.md b/docs/src/content/docs/reference/frontmatter-full.md index fd4bd923d2e..df7efd4f26d 100644 --- a/docs/src/content/docs/reference/frontmatter-full.md +++ b/docs/src/content/docs/reference/frontmatter-full.md @@ -1169,6 +1169,42 @@ env: "example-value" features: {} +# Named model alias definitions with ordered fallback lists, resolved recursively +# by AWF. Each key is an alias name (use empty string "" for the default policy). +# Each value is an ordered list of vendor/modelid glob patterns or other alias +# names to try in sequence. Entries defined here are merged on top of the builtin +# aliases; the main workflow file always wins over imported aliases. Builtin +# aliases include: sonnet, haiku, opus, gpt-5, gpt-5-mini, gpt-5-codex, +# gemini-flash, gemini-pro, small, mini, large, auto. +# (optional) +models: + {} + +# A/B testing experiments. Each key is an experiment name; the value is either an +# array of two or more variant strings (bare-array form) or an object with a +# 'variants' field plus optional metadata fields (description, metric, weight, +# issue, start_date, end_date, hypothesis, secondary_metrics, guardrail_metrics, +# min_samples, owner). The reserved 'storage' key controls how experiment state is +# persisted: 'repo' (default) commits state to a git branch named +# 'experiments/{sanitizedWorkflowID}' (workflow ID lowercased with hyphens +# removed) for durability; 'cache' uses GitHub Actions cache. At runtime the +# activation job picks a variant and persists the updated counters. Use ${{ +# experiments. }} in the workflow prompt to reference the selected variant. +# When multiple experiments are declared, assignments are statistically balanced +# using a least-used counter that round-robins across variants (or weighted when +# 'weight' is provided); ties are broken randomly so no variant is systematically +# favoured on the first run. +# (optional) +experiments: + # Storage backend for experiment state. 'repo' (default) persists state to a git + # branch named 'experiments/{sanitizedWorkflowID}' (workflow ID lowercased with + # hyphens removed, e.g. 'my-workflow' -> 'experiments/myworkflow') for durability + # across cache evictions. 'cache' uses GitHub Actions cache (legacy behaviour). + # Repo storage is recommended because experiment data is valuable and more durable + # than cache. + # (optional) + storage: "cache" + # DEPRECATED: Use 'disable-model-invocation' instead. Controls whether the custom # agent should infer additional context from the conversation. This field is # maintained for backward compatibility with existing custom agent files. @@ -1694,6 +1730,13 @@ engine: # (optional) session-timeout: "example-value" + # Timeout for individual MCP tool calls as a Go duration string (e.g. "30s", "2m", + # "10m"). Must be between 10s and 600s inclusive. Omitted or empty uses the + # gateway built-in default (60s). Use a higher value for slow MCP backends such as + # full-text search over large indexes. + # (optional) + tool-timeout: "example-value" + # Option 3: Inline engine definition: specifies a runtime adapter and optional # provider settings directly in the workflow frontmatter, without requiring a # named catalog entry @@ -2162,16 +2205,25 @@ tools: # Option 2: Playwright tool configuration with custom version and arguments playwright: - # Optional Playwright container version (e.g., 'v1.41.0', 1.41, 20). Numeric - # values are automatically converted to strings at runtime. + # Optional version pin. In CLI mode (recommended): the @playwright/cli npm package + # version (e.g., '0.1.11'). In MCP mode (deprecated): the Playwright browser + # Docker image version (e.g., 'v1.56.1'). Omit to use the default version. # (optional) version: null - # Optional additional arguments to append to the generated MCP server command + # Optional additional arguments to append to the generated MCP server command (MCP + # mode only) # (optional) args: [] # Array of strings + # Integration mode: 'cli' (recommended) installs @playwright/cli via npm for + # token-efficient CLI invocations — use playwright-cli commands in bash and + # localhost to reach local servers; 'mcp' (deprecated) runs a Docker-based MCP + # server. + # (optional) + mode: "cli" + # GitHub Agentic Workflows MCP server for workflow introspection and analysis. # Provides tools for checking status, compiling workflows, downloading logs, and # auditing runs. @@ -5743,6 +5795,13 @@ safe-outputs: # (optional) commit-pushed: "example-value" + # Custom header text prepended to every message body generated by safe outputs + # (issues, comments, pull requests, discussions). Applied after any + # threat-detection caution alert and before the agent-generated content. Available + # placeholders: {workflow_name}, {run_url}. + # (optional) + body-header: "example-value" + # When enabled, workflow completion notifier creates a new comment instead of # editing the activation comment. Creates an append-only timeline of workflow # runs. Default: false @@ -5992,14 +6051,6 @@ observability: # variable. headers: "example-value" -# Allow list of bot identifiers that can trigger the workflow even if they don't -# meet the required role permissions. When the actor is in this list, the bot must -# be active (installed) on the repository to trigger the workflow. -# (optional) -bots: [] - # Array of Bot identifier/name (e.g., 'dependabot[bot]', 'renovate[bot]', - # 'github-actions[bot]') - # Rate limiting configuration to restrict how frequently users can trigger the # workflow. Helps prevent abuse and resource exhaustion from programmatically # triggered events.