Agentic workflow to fix potential errors in weekly generator upgrade#1166
Agentic workflow to fix potential errors in weekly generator upgrade#1166MaiLinhP wants to merge 28 commits into
Conversation
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>
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>
…tep 5 Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/08b522af-7d1a-49a8-aaf9-e3d38579fda2 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>
Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/41edb32d-842f-4e20-bbd0-777131d8e453 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>
…_activation Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/cd8890c0-d8b3-418f-a6ed-e3f9e14ab8ab Co-authored-by: MaiLinhP <222711853+MaiLinhP@users.noreply.github.com>
… tee Agent-Logs-Url: https://github.com/openai/openai-dotnet/sessions/9c86d34b-63e7-4a57-978c-a9bb9ccfa424 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: 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>
There was a problem hiding this comment.
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-errorsskill 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. |
| 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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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: |
| - 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/`. |
| > **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>
| 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 |
| 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. |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
| 3. Update it to match the new name from the base spec, or remove the `@@clientLocation` line if | ||
| the operation was removed. |
There was a problem hiding this comment.
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 generatedapi/*.csfiles 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'| 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. |
| 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 |
| > **Ground rule:** Never modify `specification/base/` — these are upstream copies. All fixes go | ||
| > in `specification/client/`, `OpenAI/src/Custom/`, or `OpenAI.Responses/src/Custom/`. |
| > **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/`). |
Addressed comments from #1156
Making new PR to bypass push restriction to workflow files from local.