Skip to content

Qualify auto-generated sub-orchestration IDs across continue_as_new generations#33

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-collision-of-sub-orchestration-ids
Open

Qualify auto-generated sub-orchestration IDs across continue_as_new generations#33
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-collision-of-sub-orchestration-ids

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Auto-generated sub-orchestration IDs were based only on event_id; after continue_as_new, event_id restarts and children could reuse prior-generation IDs, stalling parent waits against already-completed child instances.
This change makes auto IDs generation-qualified for execution N>1 while keeping execution 1 format unchanged for compatibility.

  • Runtime ID derivation

    • Updated replay action resolution so pending sub-orchestration IDs become:
      • execution 1: sub::{event_id}
      • execution N>1: sub::{execution_id}.{event_id}
    • Keeps replay determinism and removes cross-generation collisions.
  • Replay-engine regression coverage

    • Added a focused test validating execution 2 emits sub::2.{event_id} for auto-generated child IDs.
  • Docs

    • Updated sub-orchestration behavior docs and replay-engine test spec to reflect generation-qualified auto IDs.
let final_instance = if instance.starts_with(SUB_ORCH_PENDING_PREFIX) {
    if execution_id == INITIAL_EXECUTION_ID {
        format!("{SUB_ORCH_AUTO_PREFIX}{event_id}")
    } else {
        format!("{SUB_ORCH_AUTO_PREFIX}{execution_id}.{event_id}")
    }
} else {
    instance
};

Checklist

  • Tests added/updated
  • Regular tests pass locally (cargo nt)
  • Doc tests pass locally (cargo test --doc --all-features)
  • Docs updated
    • Existing docs updated where behavior changed
    • New doc added under docs/ if introducing a new area
    • Linked from docs/README.md

Links / Design notes

  • Code pointers:
    • src/runtime/replay_engine.rs (auto ID resolution now includes execution_id)
    • tests/replay_engine/sub_orchestration.rs (new generation-specific ID test)
    • docs/sub-orchestrations.md
    • docs/replay-engine-test-spec.md

Copilot AI changed the title [WIP] Fix collision of auto-generated sub-orchestration IDs Qualify auto-generated sub-orchestration IDs across continue_as_new generations Jun 16, 2026
Copilot AI requested a review from pinodeca June 16, 2026 19:21
@pinodeca pinodeca marked this pull request as ready for review June 17, 2026 16:34
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