[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #351
Closed
github-actions[bot] wants to merge 1 commit into
Closed
[rig-claude] Improve Claude dynamic-workflow compatibility for rig#351github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Sample 360 used Promise.all for two concurrent agent calls. This bypasses the workflow's concurrency limiter and swallows agent failures as rejections instead of converting them to null holes — both at odds with Claude dynamic- workflow semantics. Replace with parallel(thunks) using a single typed agent called twice with different inputs, which gives homogeneous types and demonstrates the correct Claude pattern (parallel fan-out with null-hole failure semantics and shared concurrency limiter). Add prose above the code block explaining what parallel does differently from Promise.all. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Compatibility gap addressed
Sample
360-parallel-branch-analysis-workflow.mdusedPromise.allto run two concurrent agent calls, which:Promise.alldispatches both calls unconditionally;parallel(thunks)gates them through the workflow's semaphore so they count againstlimits.concurrency.Promise.allrejects the whole run if either call throws;parallel(thunks)converts failures tonullholes, matching Claude dynamic-workflow semantics exactly.This was the single highest-confidence discoverability gap: a developer porting a Claude dynamic workflow would see
parallelin the conversion table and look to sample 360 as a reference, only to findPromise.allinstead.Why this improves transfer from Claude dynamic workflows to Rig
The Claude dynamic-workflow
parallel(thunks)primitive is documented inreferences/claude-workflow-conversion.mdwith a 1-to-1 mapping to rig'sparallel(thunks). Sample 310 already demonstrates this for a homogeneous set of typed agent calls (many areas → same schema). Sample 360 now demonstrates it for two independent analysis calls, showing how to structure a typed agent with aninputschema so the same agent can be called with different inputs and still produce homogeneous output types forparallel.A prose block above the code explains what
paralleldoes differently fromPromise.all, so the reason for the choice is immediately visible.Files changed
skills/rig/samples/360-parallel-branch-analysis-workflow.md— replacedPromise.allwithparallel(thunks), redesigned agents to share a schema (enabling homogeneous typing), added explanatory prose.Validation run
Remaining intentional differences
None introduced by this change. The known differences (
effort,agentType, resume journal, worktree isolation, human checkpoints) are already documented inreferences/claude-workflow-conversion.md.