Skip to content

Add native structured outputs for Codex, Claude, and Copilot SDK - #66742

Closed
pelikhan wants to merge 6 commits into
mainfrom
pelikhan-structured-engine-outputs
Closed

pelikhan wants to merge 6 commits into
mainfrom
pelikhan-structured-engine-outputs

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Why

Workflows need a schema-constrained primary response that downstream jobs can consume reliably, independently of safe-output side effects. JSON event formatting and prompt-only instructions do not provide that contract.

Related: #28963

Approach

  • Add main-workflow structured-output frontmatter with either an inline JSON Schema or a repository-relative schema-file, plus engine capability and configuration-validation interfaces.
  • Enable only verified native paths: Codex's built-in harness, Claude Code's built-in harness, and the built-in Copilot SDK. Reject unsupported engines, custom execution paths, incompatible versions, and samples replay. Gemini and Goose remain disabled.
  • Extract and validate the primary JSON response, permit at most one native schema correction, and keep transport retries separate. Publish compact JSON through needs.agent.outputs.structured and successful-response artifacts only after successful execution, tracked secret redaction, and host validation against the original compiler-provided schema.
  • Document schema dialects, reference/path restrictions, size limits, engine support evidence, and safe downstream consumption. Add assertions to the three retained smoke workflows.
  • Make set_issue_field skip with a warning when there is no triggering issue; malformed targets and actual API/authentication errors still fail. Fix smoke preflight defects in MCP argument handling and agent-owned temporary paths without weakening credential verification.

Security and review notes

Schema files must stay within the repository, external references and Actions expressions are rejected, response files are opened without following symlinks, and final validation does not trust an agent-editable schema. Validation never coerces values or silently removes properties. Model-produced strings remain untrusted shell data.

Claude's strict staged preflight still flags removal of the previously approved github/codeql-action/upload-sarif action because staged safe outputs suppress the real upload. Ordinary compilation retains that action. The safe-update warning was not bypassed or approved.

Validation

  • Fresh npm ci succeeded in actions/setup/js and eslint-factory; npm run typecheck now passes after merging the upstream project-typing and dependency fixes.
  • 737 focused JavaScript tests passed across project creation, structured-output validation, retained harnesses, SDK integration, and issue-field handling. The final impacted JavaScript gate also passed 383 tests.
  • Focused Go native-output/schema and MCP argument regressions passed; final impacted Go tests, standard Go lint, JavaScript lint, and schema-freshness checks passed.
  • make fmt, make build, and make recompile completed; all 327 workflows compile and make check-workflow-drift passes.
  • Codex and Copilot SDK strict staged preflight passes with the feature compiler. Hosted feature execution remains unverified; no smoke runs were dispatched.
  • make agent-report-progress still fails on the previously established custom Go linter diagnostics. The prior create_project.cjs typecheck failure is resolved.

Latest merged main: 87dc1d35e3. Head: 61b483081f.

pelikhan and others added 6 commits October 7, 2026 13:52
Define structured-output schemas, native capability and mode guards, bounded correction, post-redaction validation, and downstream JSON outputs. Enable verified Codex, Claude, Copilot SDK, Gemini, and Goose paths with smoke coverage and researched support documentation.

Co-authored-by: Copilot App <[email protected]>
Includes upstream read-only-cache redaction remediation and regenerated workflow locks while preserving native structured outputs.

Co-authored-by: Copilot App <[email protected]>
Honor nonfatal target resolution for contextless set_issue_field requests, report skipped outcomes, and retain hard errors for invalid targets and API failures.

Co-authored-by: Copilot App <[email protected]>
Revert Goose and Gemini integrations and smoke changes, remove the Goose-specific declarative capability plumbing, and add rejection coverage while keeping the three retained native paths and merged upstream fixes.

Co-authored-by: Copilot App <[email protected]>
Sync upstream action pins and regenerate the three conflicting smoke locks. Preserve Codex, Claude, and Copilot SDK structured-output support and the smoke preflight fixes.

Co-authored-by: Copilot App <[email protected]>
Merge upstream 87dc1d3, preserving native structured-output support. Fresh npm ci and runtime typecheck pass; project and native-output regressions pass. Rebuilt compiler and verified all workflow locks remain current.

Co-authored-by: Copilot App <[email protected]>
value = parseResponse(result);
structuredOutputInvalid = false;
}
fs.writeFileSync(outputConfig.outputPath, `${JSON.stringify(value)}\n`);
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