-
Notifications
You must be signed in to change notification settings - Fork 1
chore: sync workflow templates #5611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| import argparse | ||
| import base64 | ||
| import binascii | ||
| import contextlib | ||
| import dataclasses | ||
| import datetime as dt | ||
| import hashlib | ||
|
|
@@ -356,11 +357,6 @@ def materialize_orchestrator_skill( | |
| return None | ||
|
|
||
| if plan.pack: | ||
| materialize_reference_packs( | ||
| workspace_path, | ||
| reference_pack_name=plan.pack, | ||
| token=token, | ||
| ) | ||
| reference_packs = _load_reference_packs_module() | ||
| snapshot = reference_packs.load_reference_packs(workspace_path) | ||
| matching = [ | ||
|
|
@@ -371,6 +367,13 @@ def materialize_orchestrator_skill( | |
| if not matching: | ||
| raise ValueError(f"orchestrator skill reference pack not found: {plan.pack}") | ||
| checkout_path = workspace_path / matching[0].checkout_path | ||
| with contextlib.suppress(FileNotFoundError): | ||
| shutil.rmtree(checkout_path) | ||
|
Comment on lines
+370
to
+371
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle non-directory checkout paths during cleanup. Line 370-Line 371 only suppresses Suggested fix- with contextlib.suppress(FileNotFoundError):
- shutil.rmtree(checkout_path)
+ if checkout_path.exists():
+ if checkout_path.is_dir() and not checkout_path.is_symlink():
+ shutil.rmtree(checkout_path)
+ else:
+ checkout_path.unlink()🤖 Prompt for AI Agents |
||
| materialize_reference_packs( | ||
| workspace_path, | ||
| reference_pack_name=plan.pack, | ||
| token=token, | ||
| ) | ||
| else: | ||
| checkout_path = _materialize_single_checkout_plan( | ||
| workspace_path, | ||
|
|
@@ -413,12 +416,19 @@ def assemble_prompt( | |
| ) | ||
|
|
||
| if context.get("materialize_orchestrator_skill"): | ||
| materialize_orchestrator_skill( | ||
| orchestrator_summary_path = materialize_orchestrator_skill( | ||
| workspace, | ||
| pack_override=context.get("orchestrator_skill_pack") or None, | ||
| enabled_override=context.get("orchestrator_skill_enabled"), | ||
| token=token, | ||
| ) | ||
| else: | ||
| orchestrator_summary_raw = context.get("orchestrator_skill_summary_path") | ||
| orchestrator_summary_path = ( | ||
| Path(str(orchestrator_summary_raw)) if orchestrator_summary_raw else None | ||
| ) | ||
| if orchestrator_summary_path and not orchestrator_summary_path.is_absolute(): | ||
| orchestrator_summary_path = workspace / orchestrator_summary_path | ||
|
|
||
| output_file = str( | ||
| context.get("output_file") or _prompt_output_name(provider, context.get("pr_number")) | ||
|
|
@@ -448,12 +458,11 @@ def assemble_prompt( | |
| if reference_summary.is_file(): | ||
| parts.extend(["\n\n## Reference Packs\n", _read_text(reference_summary).rstrip()]) | ||
|
|
||
| orchestrator_summary = workspace / ".reference" / "ORCHESTRATOR_SKILL.md" | ||
| if orchestrator_summary.is_file(): | ||
| if orchestrator_summary_path and orchestrator_summary_path.is_file(): | ||
| parts.extend( | ||
| [ | ||
| "\n\n## Orchestrator Skill Context\n", | ||
| _read_text(orchestrator_summary).rstrip(), | ||
| _read_text(orchestrator_summary_path).rstrip(), | ||
| ] | ||
| ) | ||
|
|
||
|
|
@@ -943,6 +952,7 @@ def _cmd_assemble(args: argparse.Namespace) -> int: | |
| "materialize_orchestrator_skill": args.materialize_orchestrator_skill, | ||
| "orchestrator_skill_pack": args.orchestrator_skill_pack or None, | ||
| "orchestrator_skill_enabled": _parse_optional_bool(args.orchestrator_skill_enabled), | ||
| "orchestrator_skill_summary_path": os.environ.get("ORCHESTRATOR_SKILL_SUMMARY_PATH"), | ||
| "github_token": os.environ.get("GH_TOKEN") or os.environ.get("GITHUB_TOKEN"), | ||
| } | ||
| prompt = assemble_prompt(args.reference_pack_name, context, args.provider) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a reference pack is named
..(it currently passesPACK_NAME_PATTERNinscripts/reference_packs.pyandbuild_checkout_planmaps it to.reference/..) and the orchestrator skill selects that pack, this new deletion targets the workspace root. In practiceshutil.rmtree(workspace/.reference/..)removes the checked-out files and then raisesFileNotFoundError, which is suppressed here, so prompt assembly continues with the repo wiped. Please resolve and verify the target stays under.reference(or reject./..pack names) before deleting.Useful? React with 👍 / 👎.