Skip to content

Add top-level goal frontmatter support and map it to Codex --goal#40442

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/add-goal-support-top-level
Closed

Add top-level goal frontmatter support and map it to Codex --goal#40442
Copilot wants to merge 1 commit into
mainfrom
copilot/add-goal-support-top-level

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This change adds goal as a first-class top-level frontmatter field (instead of nesting under engine) and wires it into Codex invocation so workflow intent can be passed explicitly as a CLI goal while the markdown/problem body remains the instruction source.

  • Frontmatter contract

    • Added top-level goal to typed config (FrontmatterConfig) and workflow schema (main_workflow_schema.json).
    • Documented goal in frontmatter and engines reference docs.
  • Compilation/runtime propagation

    • Added Goal to WorkflowData.
    • Populated WorkflowData.Goal from parsed frontmatter during workflow build (resolveWorkflowGoal), with trimmed raw fallback.
  • Codex execution mapping

    • Updated Codex command generation to append:
      • ${GH_AW_GOAL:+ --goal "$GH_AW_GOAL"}
    • Injects GH_AW_GOAL env only when a top-level goal is set, avoiding empty/implicit goal behavior.
  • Coverage updates

    • Extended parsing and Codex execution tests for goal-present and goal-absent paths.
    • Updated Codex wasm golden output to include the new command shape.
---
engine: codex
goal: "Fix flaky tests in pkg/workflow"
---
# markdown problem/instructions

Codex execution now includes:

codex exec ... ${GH_AW_GOAL:+ --goal "$GH_AW_GOAL"} ... --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants