Skip to content

Agentic workflow to fix potential errors in weekly generator upgrade#1166

Open
MaiLinhP wants to merge 28 commits into
openai:mainfrom
MaiLinhP:agentic
Open

Agentic workflow to fix potential errors in weekly generator upgrade#1166
MaiLinhP wants to merge 28 commits into
openai:mainfrom
MaiLinhP:agentic

Conversation

@MaiLinhP
Copy link
Copy Markdown
Collaborator

Addressed comments from #1156

Making new PR to bypass push restriction to workflow files from local.

Copilot AI and others added 21 commits May 4, 2026 17:06
Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/677d5f27-63c2-436c-b5dd-9b3b5109367b

Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
… categories + triage steps

Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/076a8faf-2599-426b-8cd5-1d6a96fc0ecb

Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
…ssarily expected

Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/b82e6565-e75b-4124-a289-411098b4ef98

Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jesse Squire <jesse.squire@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…changes→8, Create PR→9

Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/e96be0bf-95aa-484b-aed8-3a93014b92bf

Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
…kage and remove obsolete common/ references

Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/8f0d74aa-c1b3-4466-852a-22e5be7b64e6

Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 21:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new agentic workflow to automatically remediate TypeSpec generator update failures by checking out the update branch, running codegen/build/API export, and opening a stacked fix PR.

Changes:

  • Adds the agentic workflow source and generated lock workflow.
  • Adds a new fixing-codegen-errors skill with category-specific remediation guides.
  • Marks generated workflow lock files as Linguist-generated.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/fix-codegen-errors.md Defines the agentic workflow prompt and remediation process.
.github/workflows/fix-codegen-errors.lock.yml Generated executable workflow for the agentic process.
.github/skills/fixing-codegen-errors/SKILL.md Adds the top-level codegen error fixing guide.
.github/skills/fixing-codegen-errors/prohibited-namespace.md Documents prohibited namespace remediation.
.github/skills/fixing-codegen-errors/post-generation-build.md Documents post-generation build failure remediation.
.github/skills/fixing-codegen-errors/npm-plugin-build.md Documents npm/plugin build failure remediation.
.github/skills/fixing-codegen-errors/missing-type.md Documents missing TypeSpec type remediation.
.github/skills/fixing-codegen-errors/client-tsp-decorators.md Documents stale client decorator remediation.
.gitattributes Marks generated workflow lock files as generated.

Comment thread .github/skills/fixing-codegen-errors/missing-type.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/workflows/fix-codegen-errors.lock.yml Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment on lines +15 to +16
2. Determine visibility: types prefixed with `Internal` are internal; others are public.
3. Add a stub in the correct file. The repo has two source roots:
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 21:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/skills/fixing-codegen-errors/missing-type.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/skills/fixing-codegen-errors/post-generation-build.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 21:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comment thread .github/skills/fixing-codegen-errors/missing-type.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/workflows/fix-codegen-errors.md Outdated
Comment thread .github/skills/fixing-codegen-errors/prohibited-namespace.md
Copilot AI review requested due to automatic review settings May 14, 2026 00:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

.github/workflows/fix-codegen-errors.md:93

  • The target-branch checkout script is also missing from the compiled .lock.yml, so the workflow never validates or checks out the branch it is supposed to fix. This leaves the subsequent codegen/build instructions without the expected branch context.
  - name: Check out target branch and verify
    run: |

Comment thread .github/workflows/fix-codegen-errors.md
Comment thread .github/workflows/fix-codegen-errors.md
- Codegen succeeds but `dotnet build` fails → **Category 5** (post-generation build)

> **Ground rule:** Never modify `specification/base/` — these are upstream copies. All fixes go
> in `specification/client/`, `OpenAI/src/Custom/`, or `OpenAI.Responses/src/Custom/`.
Comment on lines +13 to +14
> **Ground rule:** Never modify `specification/base/` — these are upstream copies. All fixes go
> in `specification/client/` or `OpenAI/src/Custom/` (or `OpenAI.Responses/src/Custom/`).
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 17:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Comment on lines +276 to +277
Commit all changes to a new branch (e.g., `typespec/fix-codegen-<VERSION>`), push it, and open
a draft PR with `gh pr create` using `--base <TARGET_BRANCH>` and `--label codegen`. The PR
Comment on lines +240 to +242
If there are **no changes** (codegen and API export produced no modifications to tracked files),
exit gracefully without creating a PR — the new generator version may be fully
backwards-compatible.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Comment thread .github/workflows/fix-codegen-errors.md
Comment thread .github/workflows/fix-codegen-errors.md
Comment thread .github/skills/fixing-codegen-errors/prohibited-namespace.md
Comment on lines +17 to +18
3. Update it to match the new name from the base spec, or remove the `@@clientLocation` line if
the operation was removed.
Copilot AI review requested due to automatic review settings May 14, 2026 18:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

.github/workflows/fix-codegen-errors.md:255

  • The API-change inspection also uses git diff, so newly generated api/*.cs files that are still untracked will not be listed or included in the API Changes summary. Use a status-based check that includes untracked files before deciding whether there are API additions to describe.
git diff --name-only | grep '^api/'

API surface changes (additions, removals, or modifications in api/*.cs) do not block PR
creation — they may or may not be expected depending on the generator update. Capture a diff of
each changed api/ file so you can explain the changes in the PR description:

git diff -- 'api/*.cs'

Comment on lines +240 to +242
If there are **no changes** (codegen and API export produced no modifications to tracked files),
exit gracefully without creating a PR — the new generator version may be fully
backwards-compatible.
Comment on lines +276 to +278
Commit all changes to a new branch (e.g., `typespec/fix-codegen-<VERSION>`), push it, and open
a draft PR with `gh pr create` using `--base <TARGET_BRANCH>` and `--label codegen`. The PR
must target the typespec update branch (not `main`) so it stacks on top of the generator
Comment on lines +187 to +188
> **Ground rule:** Never modify `specification/base/` — these are upstream copies. All fixes go
> in `specification/client/`, `OpenAI/src/Custom/`, or `OpenAI.Responses/src/Custom/`.
Comment on lines +13 to +14
> **Ground rule:** Never modify `specification/base/` — these are upstream copies. All fixes go
> in `specification/client/` or `OpenAI/src/Custom/` (or `OpenAI.Responses/src/Custom/`).
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.

3 participants