Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 31, 2025

Campaign orchestrators were generating hardcoded file-glob patterns (campaign-id/**) that failed to match agent-created files in dated directories (campaign-id-20251231/metrics/*.json), causing repo-memory push validation errors.

Changes

  • Extract pattern from campaign spec: Added extractFileGlobPattern() to derive file-glob from memory-paths or metrics-glob configuration, preserving wildcards for dated directories
  • Pattern precedence: Prefers patterns with directory wildcards (campaign-id-*/**) over static paths, with fallback hierarchy: memory-paths → metrics-glob → campaign ID
  • Updated orchestrator builder: Replaced hardcoded fmt.Sprintf("%s/**", spec.ID) with extracted pattern in repo-memory configuration

Example

Before:

memory-paths: ["memory/campaigns/project64-*/**"]
# Generated: file-glob: "project64/**" ❌ no match

After:

memory-paths: ["memory/campaigns/project64-*/**"]  
# Generated: file-glob: "project64-*/**" ✅ matches project64-20251231/

Pattern extraction handles multiple scenarios:

  • Wildcards in directory names: campaign-id-*/data/**campaign-id-*/data/**
  • Metrics-only config: campaign-id-*/metrics/*.jsoncampaign-id-*/**
  • Simple paths: campaign-id/**campaign-id/**

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE ux-amd64/bin/go GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/compile GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/compile (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login runs/20251231-075905-52104/test-526039141/.github/workflows GOPROXY (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login ithub/workflows l/linux_amd64/compile /usr/bin/git -c=4 -nolocalimports l/linux_amd64/li/tmp/validate-js-3798572598.cjs git rev-�� ference.git l/linux_amd64/link /usr/bin/git -json GO111MODULE ux-amd64/bin/go git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix memory changes in campaigns, see run: https://github.com/githubnext/gh-aw/actions/runs/20614496974/job/59204731960
Problem is that the file does not match allowed patterns as the date was appended:

go-file-size-reduction-project64-20251231/metrics/2025-12-31.json
Error: Allowed patterns: go-file-size-reduction-project64/**
Error: Pattern test results:
Error:   go-file-size-reduction-project64/** -> regex: ^go-file-size-reduction-project64\/.*$ -> NO MATCH
Error: File pattern validation failed
Error: Failed to scan artifact directory: File pattern validation failed

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 31, 2025 07:56
Extract file-glob pattern from memory-paths/metrics-glob to support
campaigns with dated directory patterns (e.g., campaign-id-20251231/).

- Add extractFileGlobPattern helper to extract patterns from memory-paths
- Prefer patterns with directory wildcards (campaign-id-*) over simple patterns
- Fall back to metrics-glob if no memory-paths wildcards found
- Update orchestrator to use extracted pattern instead of simple ID
- Add comprehensive tests for pattern extraction logic

Fixes file pattern validation errors in campaign workflows where agents
create files in dated subdirectories that don't match the hardcoded
campaign-id/** pattern.

Co-authored-by: mnkiefer <[email protected]>
Copilot AI changed the title [WIP] Fix memory changes in campaigns for allowed file patterns Fix campaign file-glob pattern to support dated directory structures Dec 31, 2025
Copilot AI requested a review from mnkiefer December 31, 2025 08:07
@mnkiefer mnkiefer marked this pull request as ready for review December 31, 2025 08:29
@mnkiefer mnkiefer merged commit 458a0f6 into main Dec 31, 2025
130 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-memory-changes-campaigns branch December 31, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants