From e743c27ae1344635179037f0e0e39140ab919618 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 16:20:32 +0000 Subject: [PATCH 1/2] Initial plan From 3471e368a0019ed01b279286da237eaa81ecffc8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 4 Apr 2026 16:39:50 +0000 Subject: [PATCH 2/2] fix: filter aw_context from workflow inputs in interactive mode The aw_context input is injected by the compiler as an internal implementation detail of Agentic Workflows. It should not be shown to users or prompted for during interactive workflow runs (add-wizard, gh aw run). Changes: - Export AwContextInputName constant from pkg/workflow/compiler_aw_context.go - Filter aw_context from getWorkflowInputs() in run_workflow_validation.go - Add test cases to verify aw_context is filtered from displayed inputs Agent-Logs-Url: https://github.com/github/gh-aw/sessions/9fd79867-5983-4a77-bd8b-195f8fe23eb8 Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com> --- pkg/cli/run_workflow_validation.go | 8 +++- pkg/cli/run_workflow_validation_test.go | 53 +++++++++++++++++++++++++ pkg/workflow/compiler_aw_context.go | 8 +++- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/pkg/cli/run_workflow_validation.go b/pkg/cli/run_workflow_validation.go index b768065d8b9..a3fcc4d51c5 100644 --- a/pkg/cli/run_workflow_validation.go +++ b/pkg/cli/run_workflow_validation.go @@ -147,7 +147,13 @@ func getWorkflowInputs(markdownPath string) (map[string]*workflow.InputDefinitio } // Parse input definitions - return workflow.ParseInputDefinitions(inputsMap), nil + parsed := workflow.ParseInputDefinitions(inputsMap) + + // Remove aw_context from the returned inputs - it is an internal input managed by the + // agentic workflow system and should never be surfaced to users for prompting or display. + delete(parsed, workflow.AwContextInputName) + + return parsed, nil } // validateWorkflowInputs validates that required inputs are provided and checks for typos. diff --git a/pkg/cli/run_workflow_validation_test.go b/pkg/cli/run_workflow_validation_test.go index 8a34825fbd4..a78e31e820e 100644 --- a/pkg/cli/run_workflow_validation_test.go +++ b/pkg/cli/run_workflow_validation_test.go @@ -199,6 +199,59 @@ jobs: }, expectError: false, }, + { + name: "workflow with aw_context input is filtered out", + markdownFile: "compiled-workflow.md", + lockFileYAML: `name: "Compiled Workflow" +on: + workflow_dispatch: + inputs: + aw_context: + default: "" + description: Agent caller context (used internally by Agentic Workflows). + required: false + type: string + task: + description: 'Task description' + required: true + type: string +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "test" +`, + expectedCount: 1, // aw_context should be filtered out, only 'task' remains + expectedReq: map[string]bool{ + "task": true, + }, + expectError: false, + }, + { + name: "workflow with only aw_context input returns empty", + markdownFile: "aw-context-only.md", + lockFileYAML: `name: "AW Context Only" +on: + workflow_dispatch: + inputs: + aw_context: + default: "" + description: Agent caller context (used internally by Agentic Workflows). + required: false + type: string +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "test" +`, + expectedCount: 0, // aw_context is the only input and should be filtered out + expectError: false, + }, { name: "workflow with no inputs", markdownFile: "simple-workflow.md", diff --git a/pkg/workflow/compiler_aw_context.go b/pkg/workflow/compiler_aw_context.go index 2deef527917..b9167849679 100644 --- a/pkg/workflow/compiler_aw_context.go +++ b/pkg/workflow/compiler_aw_context.go @@ -8,6 +8,10 @@ import ( var awContextLog = logger.New("workflow:compiler_aw_context") +// AwContextInputName is the name of the internal aw_context workflow_dispatch input. +// It is managed internally by the agentic workflow system and should not be surfaced to users. +const AwContextInputName = "aw_context" + // awContextInputDescription is the description for the aw_context workflow_dispatch input. // It signals to users that this input is managed internally by the agentic workflow system. const awContextInputDescription = "Agent caller context (used internally by Agentic Workflows)." @@ -27,7 +31,7 @@ func injectAwContextIntoOnYAML(onSection string) string { return onSection } // Idempotency: skip if already injected - if strings.Contains(onSection, "aw_context:") { + if strings.Contains(onSection, AwContextInputName+":") { awContextLog.Print("aw_context already injected, skipping") return onSection } @@ -107,7 +111,7 @@ func buildAwContextInputLines(wdIndent int) []string { awIndent := strings.Repeat(" ", wdIndent+4) // under inputs: propIndent := strings.Repeat(" ", wdIndent+6) // properties of aw_context return []string{ - awIndent + "aw_context:", + awIndent + AwContextInputName + ":", propIndent + "default: \"\"", propIndent + "description: " + awContextInputDescription, propIndent + "required: false",