Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"repo": "actions/github-script",
"version": "v9.0.0",
"sha": "3a2844b7e9c422d3c10d287c895573f7108da1b3"
},
"github/gh-aw-actions/setup@v0.79.8": {
"repo": "github/gh-aw-actions/setup",
"version": "v0.79.8",
"sha": "c0338fef4749d08c21f8f975fb0e37efa17dda47"
}
},
"containers": {
Expand Down
129 changes: 79 additions & 50 deletions .github/workflows/dotnet-port-api-nightly.lock.yml

Large diffs are not rendered by default.

59 changes: 46 additions & 13 deletions .github/workflows/dotnet-port-api-nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,35 @@ on:
workflow_dispatch:
checkout:
fetch-depth: 0
steps:
- name: Pre-fetch upstream commits and porting history
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p /tmp/gh-aw/data
cd ${{ github.workspace }}

# Ensure upstream remote exists and is current
git remote get-url upstream-agent-framework 2>/dev/null || \
git remote add upstream-agent-framework https://github.com/microsoft/agent-framework.git
git fetch --quiet --prune upstream-agent-framework +refs/heads/main:refs/remotes/upstream-agent-framework/main

# Dump recent upstream commits touching dotnet/ (compact, last 60 days, max 60 entries)
git log upstream-agent-framework/main --since="60 days ago" \
--format='{"sha":"%H","short":"%h","date":"%ci","subject":"%s","author":"%an"}' \
-- dotnet/ | head -60 > /tmp/gh-aw/data/upstream-commits.jsonl
echo "Pre-fetched $(wc -l < /tmp/gh-aw/data/upstream-commits.jsonl) upstream commits."

# Pre-fetch recent porting issues for deduplication (open + recently closed)
gh issue list --repo "${{ github.repository }}" --state all --limit 20 \
--search "[dotnet-port-fixes] in:title" \
--json number,title,state,createdAt,url > /tmp/gh-aw/data/fixes-issues.json
gh issue list --repo "${{ github.repository }}" --state all --limit 20 \
--search "[dotnet-port-api] in:title" \
--json number,title,state,createdAt,url > /tmp/gh-aw/data/api-issues.json
jq -s 'add' /tmp/gh-aw/data/fixes-issues.json /tmp/gh-aw/data/api-issues.json \
> /tmp/gh-aw/data/porting-issues.json
echo "Pre-fetched $(jq length /tmp/gh-aw/data/porting-issues.json) porting issues."
permissions:
contents: read
pull-requests: read
Expand All @@ -25,6 +54,7 @@ tools:
bash:
- "git:*"
- "go:*"
- "gh:*"
- gofmt
- rg
- find
Expand All @@ -41,7 +71,7 @@ tools:
- uniq
- wc
github:
toolsets: [context, repos, issues, pull_requests]
mode: gh-proxy
safe-outputs:
max-patch-size: 4096
noop:
Expand Down Expand Up @@ -76,24 +106,22 @@ Always work from the Go SDK checkout before editing or testing:
cd ${{ github.workspace }}
```

Before inspecting upstream .NET commits, make sure the upstream remote is available and current:
The upstream remote is already fetched by the setup step. Use `upstream-agent-framework/main` as the upstream reference. Inspect specific upstream files with `git show upstream-agent-framework/main:dotnet/<path>`.

```bash
git remote get-url upstream-agent-framework || git remote add upstream-agent-framework https://github.com/microsoft/agent-framework.git
git fetch --prune upstream-agent-framework +refs/heads/main:refs/remotes/upstream-agent-framework/main
```
## Pre-fetched Data

Use `upstream-agent-framework/main` as the upstream reference. For example, inspect `.NET` commits with `git log upstream-agent-framework/main -- dotnet`, and inspect upstream files with `git show upstream-agent-framework/main:dotnet/<path>`.
The setup step has already populated these files — read them directly instead of making tool calls:

Inspect recent upstream .NET commits and merged upstream PRs from a practical recent window. Use the commits themselves as the source of truth for choosing the inspection scope.
- `/tmp/gh-aw/data/upstream-commits.jsonl` — recent upstream commits touching `dotnet/` (last 60 days, one compact JSON object per line: `sha`, `short`, `date`, `subject`, `author`). Use this instead of running `git log`.
- `/tmp/gh-aw/data/porting-issues.json` — recent issues and PRs from both porting workflows (`[dotnet-port-fixes]` and `[dotnet-port-api]`). Use this for deduplication instead of querying issues through tools.

Before doing new work, check existing Go SDK issues and pull requests — both open and recently closed — created by the porting workflows with the `[dotnet-port-api]` or `[dotnet-port-fixes]` title prefix. These workflows run with read-only permissions and report results as tracking issues that link the proposed PR, so search issues (not only pull requests). If either workflow has already addressed the same upstream commit, the same .NET PR, or the same Go package or behavior — whether through an upstream port or a Go-misalignment fallback — do not duplicate it; select a different candidate or call `noop` with a concise explanation that links the existing issue or PR. When in doubt about whether a candidate belongs to this workflow or to `[dotnet-port-fixes]`, apply the litmus test above and defer rather than risk a duplicate.
Before doing new work, check existing Go SDK issues and pull requests using the pre-fetched data at `/tmp/gh-aw/data/porting-issues.json` — both open and recently closed — created by the porting workflows with the `[dotnet-port-api]` or `[dotnet-port-fixes]` title prefix. These workflows run with read-only permissions and report results as tracking issues that link the proposed PR. If either workflow has already addressed the same upstream commit, the same .NET PR, or the same Go package or behavior — whether through an upstream port or a Go-misalignment fallback — do not duplicate it; select a different candidate or call `noop` with a concise explanation that links the existing issue or PR. When in doubt about whether a candidate belongs to this workflow or to `[dotnet-port-fixes]`, apply the litmus test above and defer rather than risk a duplicate.

## Decision Process

Prefer small, easy-to-review tasks over broad ports. The best nightly PRs port a new or changed public API or feature that upstream .NET added and the Go SDK is missing or implements differently. Favor narrow, test-backed API and feature parity over large new surface area. Pure bug fixes, internal behavior corrections, and test-only changes belong to the companion `[dotnet-port-fixes]` workflow.

1. Use the `port-candidate-selector` sub-agent to inspect recent upstream commits that touch `dotnet/` on `upstream-agent-framework/main` and select the best small port candidate. This broad scan is context-heavy; delegate it before doing your own detailed source inspection.
1. Use the `port-candidate-selector` sub-agent to select the best small port candidate. The pre-fetched commit list at `/tmp/gh-aw/data/upstream-commits.jsonl` and deduplication data at `/tmp/gh-aw/data/porting-issues.json` are already available — pass their paths to the sub-agent and tell it to start there.
2. Ask the sub-agent to handle candidate validation, prioritization, applicability filtering, no-change fallback analysis, and PR sizing decisions. Do not redo that broad evaluation in the main agent.
3. Ask the sub-agent for a compact selection report with the upstream commit range inspected, associated .NET PRs when available, selected upstream behavior or no-change recommendation, evidence files, skipped alternatives, and uncertainty to verify. Do not ask it to decide implementation details, API design, tests, or examples.
4. Implement only the selected upstream behavior from the sub-agent report. Do targeted source inspection as needed to design the Go API shape, edit code, add tests/examples, and verify the chosen change; do not rescan or re-rank the upstream candidate set.
Expand Down Expand Up @@ -175,18 +203,23 @@ Call `noop` with a concise message explaining:
## agent: `port-candidate-selector`
---
description: Selects a small .NET-to-Go public-API or feature-parity port candidate from recent upstream commits
model: auto
model: large
---
You select one small, high-confidence .NET Agent Framework change that adds or changes public API or user-facing feature surface worth porting to the Go SDK.

Work from the Go SDK checkout. Ensure the `upstream-agent-framework` remote exists and is current, then inspect recent commits touching `dotnet/` on `upstream-agent-framework/main`. Use commits as the source of truth and identify associated upstream .NET PRs when possible.
Pre-fetched data is available — start here instead of running git log or querying issues:

- `/tmp/gh-aw/data/upstream-commits.jsonl` — compact upstream commit list (one JSON per line: `sha`, `short`, `date`, `subject`, `author`). Read this file first for the candidate survey.
- `/tmp/gh-aw/data/porting-issues.json` — recent issues from both porting workflows for deduplication.

Work from the Go SDK checkout. The upstream remote is already fetched; use `git show upstream-agent-framework/main:dotnet/<path>` for targeted inspection of specific candidate files only. Use `grep` or `head` before reading large Go files in full.

Prioritize changes that introduce or change public API or features mapping to existing Go SDK concepts and can become a narrow, test-backed PR: agents, messages, tools, providers, skills, compaction, hosting, workflows, and their public options or capabilities. Skip pure bug fixes, internal behavior corrections, and test-only changes (they belong to the `[dotnet-port-fixes]` workflow), .NET-only integrations, package metadata, unrelated docs, and changes that appear intentionally omitted from the Go SDK.

Own the full selection decision:

- Validate candidate applicability with targeted inspection of the upstream .NET files and nearby Go implementation.
- Deduplicate against the sibling `[dotnet-port-fixes]` workflow: skip any candidate — including a Go-misalignment fallback — already covered by an open or recently closed issue or PR from either porting workflow (results are reported as prefixed tracking issues, so search issues too), and prefer candidates that clearly fall on this workflow's side of the litmus test.
- Deduplicate against the sibling `[dotnet-port-fixes]` workflow using `/tmp/gh-aw/data/porting-issues.json`: skip any candidate — including a Go-misalignment fallback — already covered by an open or recently closed issue or PR from either porting workflow, and prefer candidates that clearly fall on this workflow's side of the litmus test.
- When multiple relevant opportunities exist, choose the smallest coherent public-API or feature-parity improvement before larger feature work.
- If there is nothing new and relevant to port, inspect the Go SDK for one coherent misalignment with the current upstream .NET implementation and recommend that instead.
- Keep each recommended PR small enough to review. Prefer one API addition, feature alignment, or option/capability parity improvement per PR.
Expand Down
Loading