mirror of
https://github.com/wshobson/agents
synced 2026-06-21 14:13:58 +00:00
fix: copilot adapter output path respects output_root with .github/ prefix
This commit is contained in:
@@ -6,7 +6,6 @@ import re
|
||||
from pathlib import Path
|
||||
|
||||
from tools.adapters.base import (
|
||||
WORKTREE,
|
||||
AgentSource,
|
||||
EmitResult,
|
||||
HarnessAdapter,
|
||||
@@ -64,8 +63,8 @@ def _build_tools_list(agent_tools: list[str]) -> list[str]:
|
||||
class CopilotAdapter(HarnessAdapter):
|
||||
"""Emit Copilot agent profiles (.agent.md) and skills (SKILL.md) to a local output tree.
|
||||
|
||||
Agents go to ``agents/<plugin>__<agent>.agent.md``, skills to
|
||||
``skills/<plugin>__<skill>/SKILL.md``. Tool names are rewritten from
|
||||
Agents go to ``.github/agents/<plugin>__<agent>.agent.md``, skills to
|
||||
``.github/skills/<plugin>__<skill>/SKILL.md``. Tool names are rewritten from
|
||||
Claude Code CamelCase to Copilot lowercase. Model aliases are mapped to
|
||||
the GPT-5 family (same as Codex CLI).
|
||||
"""
|
||||
@@ -74,7 +73,7 @@ class CopilotAdapter(HarnessAdapter):
|
||||
|
||||
def __init__(self, output_root: Path | None = None, repo_root: Path | None = None) -> None:
|
||||
"""Set output root (defaults to WORKTREE / .github) and optional repo root."""
|
||||
super().__init__(output_root=output_root or WORKTREE / ".github")
|
||||
super().__init__(output_root=output_root)
|
||||
if repo_root is not None:
|
||||
self.repo_root = repo_root
|
||||
|
||||
@@ -98,7 +97,7 @@ class CopilotAdapter(HarnessAdapter):
|
||||
names, and resolves model aliases before writing.
|
||||
"""
|
||||
agent_id = f"{plugin.name}__{agent.name}"
|
||||
rel = Path("agents") / f"{agent_id}.agent.md"
|
||||
rel = Path(".github") / "agents" / f"{agent_id}.agent.md"
|
||||
|
||||
model, warning = resolve_model("copilot", agent.model)
|
||||
if warning:
|
||||
@@ -126,7 +125,7 @@ class CopilotAdapter(HarnessAdapter):
|
||||
phrases) and body verbatim, wrapped in YAML frontmatter.
|
||||
"""
|
||||
skill_id = f"{plugin.name}__{skill.name}"
|
||||
skill_dir = Path("skills") / skill_id
|
||||
skill_dir = Path(".github") / "skills" / skill_id
|
||||
|
||||
content = _copilot_frontmatter(skill.frontmatter) + "\n\n" + skill.body.rstrip() + "\n"
|
||||
result.written.append(self.write(skill_dir / "SKILL.md", content))
|
||||
|
||||
Reference in New Issue
Block a user