fix(examples): harden multi-agent notepad 409 retry and improve docs#1166
Open
fix(examples): harden multi-agent notepad 409 retry and improve docs#1166
Conversation
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.
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.
Summary
demo.shintorunner.shso devs can read host orchestration and the per-sandbox program separately.Related Issue
N/A — bug discovered during a demo run.
Changes
examples/multi-agent-notepad/runner.sh(new) — agent-side script extracted fromdemo.sh's heredoc, with hardened 409/5xx retry and decorrelated jitter (RANDOM % sleep_secs).examples/multi-agent-notepad/demo.sh— heredoc removed; nowcpsrunner.shinto the upload payload. 460 → 240 lines.examples/multi-agent-notepad/README.md— rewrite. Leads with the pattern, documents memory-architecture variants, switches Quick Start togh auth token.examples/multi-agent-notepad/.gitignore(new) — ignores personalrun_demo.shhelpers.Testing
bash -nsyntax check passes on both scripts.DEMO_AGENT_COUNT=5recommended before merge.Checklist
mise run pre-commitclean.