Skip to content

State-file size discipline: set repo-memory max-file-size and add rolling-compaction rule#45

Merged
mrjf merged 4 commits intomainfrom
copilot/set-repo-memory-max-file-size
Apr 23, 2026
Merged

State-file size discipline: set repo-memory max-file-size and add rolling-compaction rule#45
mrjf merged 4 commits intomainfrom
copilot/set-repo-memory-max-file-size

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Long-running programs grow their per-program state file unboundedly, eventually exceeding repo-memory's default size limit (breaking the scheduler) and flooding the agent's context window with stale iteration history.

Changes

  • repo-memory.max-file-size: 30720 in workflows/autoloop.md frontmatter — 30 KB budget, sized for ~10 detailed iteration entries plus ~5 compressed-range summaries. Comment notes it's tunable per program cadence.
  • Rolling-compaction rule under "Update Rules": collapse iteration entries beyond the 10 most recent into compressed range summaries, prune Lessons Learned, consolidate Foreclosed Avenues. Compact aggressively when size > 80% of budget. Suggested format:
    ### Iters 50–100 — ✅ (metrics 20→55): brief summary of what worked across this range
  • state_file_size_bytes / state_file_max_bytes added to /tmp/gh-aw/autoloop.json via a new get_state_file_size() helper and STATE_FILE_MAX_BYTES constant in workflows/scripts/autoloop_scheduler.py (mirrored to .github/workflows/scripts/), so the agent can act on the 80% threshold rather than only reacting to overflow. Documented in the "Reading Programs" section.
  • Regenerated .github/workflows/autoloop.lock.yml.
  • Merged origin/main into the branch and re-applied the scheduler-side changes against the new Python scheduler (the upstream had refactored the inline JS heredoc into workflows/scripts/autoloop_scheduler.py).

Copilot AI changed the title [WIP] Set repo-memory max-file-size and add rolling-compaction rule State-file size discipline: set repo-memory max-file-size and add rolling-compaction rule Apr 22, 2026
Copilot AI requested a review from mrjf April 22, 2026 22:40
Copilot finished work on behalf of mrjf April 22, 2026 22:40
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 23, 2026

@copilot resolve the merge conflicts in this pull request, and fix failing tests, if any

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot resolve the merge conflicts in this pull request, and fix failing tests, if any

Resolved the conflict in workflows/autoloop.md against origin/main (which had refactored the scheduler from an inline JS heredoc into workflows/scripts/autoloop_scheduler.py). Re-applied the changes against the new Python scheduler: added STATE_FILE_MAX_BYTES = 30720, a get_state_file_size() helper, and emitted state_file_size_bytes / state_file_max_bytes in autoloop.json. Synced the script mirror under .github/workflows/scripts/ and recompiled the lock file. All 123 tests pass. (522c525)

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/repos/bogus.invalid/bogus/issues
    • Triggering command: /usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py (http block)
  • https://api.github.com/repos/bogus.invalid/bogus/pulls
    • Triggering command: /usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py (http block)

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

Copilot finished work on behalf of mrjf April 23, 2026 03:07
@mrjf mrjf marked this pull request as ready for review April 23, 2026 03:11
@mrjf
Copy link
Copy Markdown
Contributor

mrjf commented Apr 23, 2026

@copilot resolve conflicts

…ry-max-file-size

# Conflicts:
#	.github/workflows/autoloop.lock.yml
#	.github/workflows/scripts/autoloop_scheduler.py
#	workflows/scripts/autoloop_scheduler.py

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot resolve conflicts

Merged the latest origin/main into the branch. Conflicts were in .github/workflows/autoloop.lock.yml (regenerated from source) and both copies of autoloop_scheduler.py (kept the HEAD blocks for STATE_FILE_MAX_BYTES, get_state_file_size(), and the two new autoloop.json fields). All 123 tests pass. (1fb6beb)

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/repos/bogus.invalid/bogus/issues
    • Triggering command: /usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py (http block)
  • https://api.github.com/repos/bogus.invalid/bogus/pulls
    • Triggering command: /usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py (http block)

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

Copilot finished work on behalf of mrjf April 23, 2026 03:16
@mrjf mrjf merged commit 7c89578 into main Apr 23, 2026
1 check passed
@mrjf mrjf deleted the copilot/set-repo-memory-max-file-size branch April 23, 2026 03:43
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.

State-file size discipline: set repo-memory max-file-size and add a rolling-compaction rule

2 participants