Repository navigation
Add Dreaming workflow to curate Copilot memory weekly - #14357
Merged
Merged
Conversation
Inspired by Claude Managed Agents 'dreaming': a scheduled agent that reviews the past week of PRs, review feedback, conversations, and CI check outcomes to find recurring misses, then curates the repo's Copilot memory (AGENTS.md, .github/instructions/**, .github/skills/**, .github/agents/**) with small, non-duplicate changes — preferring edits over additions — and opens one PR. Runs weekly on Monday and via workflow_dispatch. Uses the shared PAT pool and copilot engine like the other agentic workflows. PR edits are restricted to the memory files via allowed-files. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1b63f3d4-d050-4905-9e00-bee816df8a94
Contributor
Author
|
(need to merge this to trigger-this from follow-up PRs to understand utility) |
jankratochvilcz
enabled auto-merge (squash)
July 14, 2026 18:31
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new scheduled agentic workflow (“Dreaming”) intended to periodically review recent repo activity and curate Copilot’s durable instruction/memory files by opening a single small PR (or emitting a noop).
Changes:
- Introduces
.github/workflows/dreaming.agent.mddefining the Dreaming agent workflow (weekly + manual trigger) with guarded safe-outputs restricted to memory files. - Adds the compiled workflow output
.github/workflows/dreaming.agent.lock.ymlgenerated bygh aw compileto pin actions/containers and enforce safe-output constraints.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/dreaming.agent.md | Defines the new Dreaming agent workflow, its prompt/guardrails, permissions, and safe-output allowlist for memory curation PRs. |
| .github/workflows/dreaming.agent.lock.yml | Compiled/pinned workflow generated from the .agent.md source, including safe-output enforcement and runtime wiring. |
rainersigwald
approved these changes
Jul 14, 2026
- Replace the 'Copilot memory' terminology with 'learning atoms' throughout to avoid conflation with GitHub Copilot's separate 'memory' feature (per review feedback), keeping one explicit note distinguishing the two. - Use the existing 'Area: Documentation' label instead of the non-existent 'documentation' label, which would have failed PR creation with a 404. - Recompile the lock file to pick up both changes. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1b63f3d4-d050-4905-9e00-bee816df8a94
ViktorHofer
approved these changes
Jul 15, 2026
This was referenced Jul 15, 2026
jankratochvilcz
added a commit
that referenced
this pull request
Jul 15, 2026
… curation PR (#14369) ## Problem The Dreaming workflow (added in #14357) ran end-to-end successfully for the first time after the fleet gh-aw upgrade (#14365), produced a high-quality proposal (two small "learning atom" edits to `.github/instructions/*.instructions.md`) — but **never opened a PR**. It fell back to opening a review *issue* (#14368) instead. ### Root cause The workflow's whole job is to curate the "learning atoms": `AGENTS.md` and everything under `.github/instructions`, `.github/skills`, `.github/agents`. Those are *exactly* the paths gh-aw's default file-protection policy guards: - `AGENTS.md` is in the built-in `protected_files` list, and - `protect_top_level_dot_folders: true` (a v0.82.9 default) marks every `.github/**` path as protected. The default `protected-files` policy is `request_review`. When a run edited the protected instruction files, the safe-outputs **signed-commit push was refused**: ``` pushSignedCommits: refusing unsigned push for branch 'dreaming/…': Signed-commit payload violates file-protection policy (request_review): .github/instructions/tasks.instructions.md, .github/instructions/tests.instructions.md ``` …so the run silently degraded to a review issue. ## Fix Set `protected-files: allowed` on the `create-pull-request` safe output. Verified against the pinned setup action (`github/gh-aw-actions/setup` v0.82.9, `ca8678ca`): both `checkFileProtection` (pre-apply) and `checkFileProtectionPostApply` (the exact function the signed-push gate calls) short-circuit to `{ action: "allow" }` when the policy is `allowed`, **before** the manifest/dot-folder checks run. ### Why this is safe - The tight `allowed-files` allowlist (`AGENTS.md`, `.github/instructions/**`, `.github/skills/**`, `.github/agents/**`) is the real guardrail. It is enforced **independently and ahead of** the protected-files check, so the agent still cannot touch product code, tests, build manifests, or the workflow definitions. - The PR still needs **maintainer approval** before it can merge, so human review is preserved at the PR gate — the `request_review` issue fallback was redundant friction for a workflow whose only output is a PR against these files. ## Diff Two files, minimal: - `.github/workflows/dreaming.agent.md` — one `protected-files: allowed` line (+ explanatory comment) in the `create-pull-request` config. - `.github/workflows/dreaming.agent.lock.yml` — regenerated via `gh aw compile dreaming.agent --approve`; the only functional change is `protected_files_policy: request_review` → `allowed` (plus the auto-generated frontmatter/EOF hashes). Once merged, a re-run should open the curation PR directly instead of issue #14368. Co-authored-by: Copilot App <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds a new agentic workflow, Dreaming (Copilot memory curation), inspired by Claude Managed Agents' "dreaming" — a scheduled between-sessions process that reviews recent activity, extracts recurring patterns a single session can't see, and curates the shared memory so future agents and contributors improve over time.
.github/workflows/dreaming.agent.md— source workflow.github/workflows/dreaming.agent.lock.yml— compiled output (gh aw compile, v0.79.8, actionlint clean)What it does
Weekly (Monday) and via manual
workflow_dispatch, the agent:gh pr checks/ checks + statuses API) to categorize recurring sources of misses — the common mistakes reviewers keep pointing out and the common CI failure categories.AGENTS.md(the.github/copilot-instructions.mdsymlink target),.github/instructions/**,.github/skills/**,.github/agents/**— and opens one ready-for-review[Dreaming]PR with small, high-signal changes. Emits a silentnoopon a quiet week.Guardrails (per the two explicit constraints)
allowed-files, with.github/workflows/**excluded. A maintainer always reviews/merges; the workflow never self-merges.Consistency with existing agentic workflows
Reuses the shared
pat_poolimport, thecopilot-pat-poolenvironment, and the sameCOPILOT_PAT_*token rotation +copilotengine asreview/close-stale-prs/flaky-*. Compiled action pins match every other committed.lock.yml(checkoutv7.0.0,gh-aw-actions/setupv0.82.8). No unrelated file churn.Security review note
COPILOT_PAT_0..9pool secrets (identical to the other agentic workflows). No new secrets introduced.contents,pull-requests,issues,checks,statuses,actions). The only write path is the gatedcreate-pull-requestsafe output, restricted to the memory files.Notes
Real CI here is Azure DevOps; the workflow intentionally categorizes GitHub-surfaced check conclusions rather than deep-mining AzDO logs (that's the flaky-test workflows' job), which keeps it on the default GitHub network with no extra firewall configuration.