Skip to content

fix(examples): harden multi-agent notepad 409 retry and improve docs - #1166

Merged
zredlined merged 2 commits into
mainfrom
fix/notepad-409-jitter
May 5, 2026
Merged

fix(examples): harden multi-agent notepad 409 retry and improve docs#1166
zredlined merged 2 commits into
mainfrom
fix/notepad-409-jitter

Conversation

@zredlined

Copy link
Copy Markdown
Collaborator

Summary

  • Add decorrelated jitter and 5xx retry to the multi-agent notepad's GitHub Contents API write loop so racing workers don't retry in lockstep.
  • Extract the inline 220-line sandbox runner from demo.sh into runner.sh so devs can read host orchestration and the per-sandbox program separately.
  • Rewrite README to lead with "Why GitHub as a shared notepad?" and add a "Memory architecture variants" section covering pile / append-journal / indexed-memory patterns.

Related Issue

N/A — bug discovered during a demo run.

Changes

  • examples/multi-agent-notepad/runner.sh (new) — agent-side script extracted from demo.sh's heredoc, with hardened 409/5xx retry and decorrelated jitter (RANDOM % sleep_secs).
  • examples/multi-agent-notepad/demo.sh — heredoc removed; now cps runner.sh into the upload payload. 460 → 240 lines.
  • examples/multi-agent-notepad/README.md — rewrite. Leads with the pattern, documents memory-architecture variants, switches Quick Start to gh auth token.
  • examples/multi-agent-notepad/.gitignore (new) — ignores personal run_demo.sh helpers.

Testing

  • bash -n syntax check passes on both scripts.
  • Manual end-to-end run with DEMO_AGENT_COUNT=5 recommended before merge.

Checklist

  • Conventional Commits format.
  • README updated.
  • No secrets committed.
  • mise run pre-commit clean.
  • Demo end-to-end verified.

Add decorrelated jitter to the GitHub Contents API retry loop so racing
workers don't retry in lockstep, and widen the retry set to 5xx for
transient server errors. Without jitter, N concurrent workers trip the
same backoff schedule and re-collide on each beat.

Also:
- Extract the inline 220-line sandbox runner from demo.sh into a
  separate runner.sh. demo.sh stays as host orchestration; runner.sh
  is the per-sandbox program. demo.sh shrinks 460 to 240 lines.
- Rewrite README to lead with "Why GitHub as a shared notepad?" and
  add a "Memory architecture variants" section covering pile,
  append-journal, and indexed-memory patterns.
- Switch Quick Start to use \`gh auth token\` as the primary path.
- Pass the worker slice arg explicitly instead of reading \$9 from the
  outer dispatcher.
- Add .gitignore for personal run_demo.sh helpers.
@zredlined
zredlined requested a review from a team as a code owner May 5, 2026 05:34
@copy-pr-bot

copy-pr-bot Bot commented May 5, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

johntmyers
johntmyers previously approved these changes May 5, 2026
@zredlined
zredlined merged commit 142a3a3 into main May 5, 2026
8 checks passed
@zredlined
zredlined deleted the fix/notepad-409-jitter branch May 5, 2026 15:36
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