Skip to content

[rig-claude] Improve Claude dynamic-workflow compatibility for rig - #351

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
rig-claude-compat/2026-08-04-f0d023c52a500c00
Closed

[rig-claude] Improve Claude dynamic-workflow compatibility for rig#351
github-actions[bot] wants to merge 1 commit into
mainfrom
rig-claude-compat/2026-08-04-f0d023c52a500c00

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Compatibility gap addressed

Sample 360-parallel-branch-analysis-workflow.md used Promise.all to run two concurrent agent calls, which:

  1. Bypasses the shared concurrency limiterPromise.all dispatches both calls unconditionally; parallel(thunks) gates them through the workflow's semaphore so they count against limits.concurrency.
  2. Propagates agent failures as rejectionsPromise.all rejects the whole run if either call throws; parallel(thunks) converts failures to null holes, matching Claude dynamic-workflow semantics exactly.

This was the single highest-confidence discoverability gap: a developer porting a Claude dynamic workflow would see parallel in the conversion table and look to sample 360 as a reference, only to find Promise.all instead.

Why this improves transfer from Claude dynamic workflows to Rig

The Claude dynamic-workflow parallel(thunks) primitive is documented in references/claude-workflow-conversion.md with a 1-to-1 mapping to rig's parallel(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 an input schema so the same agent can be called with different inputs and still produce homogeneous output types for parallel.

A prose block above the code explains what parallel does differently from Promise.all, so the reason for the choice is immediately visible.

Files changed

  • skills/rig/samples/360-parallel-branch-analysis-workflow.md — replaced Promise.all with parallel(thunks), redesigned agents to share a schema (enabling homogeneous typing), added explanatory prose.

Validation run

npm run sample -- --testNamePattern="skill markdown samples typecheck"
# Tests  1 passed | 442 skipped

Remaining intentional differences

None introduced by this change. The known differences (effort, agentType, resume journal, worktree isolation, human checkpoints) are already documented in references/claude-workflow-conversion.md.

Generated by Daily Rig Claude Dynamic Workflow Compatibility · sonnet46 153.6 AIC · ⌖ 8.43 AIC · ⊞ 5.4K ·

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>
@pelikhan
pelikhan marked this pull request as ready for review August 4, 2026 12:46
@pelikhan pelikhan closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant