Repository navigation
Conversation
Simulate a slow context load on cache misses, scale the default run to 4 workers x 20 workflows x 5 steps, and stream activity events to the parent for an optional live view and a side-by-side summary with an impact table (context loads, cache copies, latency). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each step now needs every earlier conversation turn. A worker fetches only the turns it is missing, with simulated latency per turn, so stale workers pay proportionally and the owner under affinity never fetches. The strip, live view, impact table, and verification report turns fetched instead of whole-context cache hits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Summary
Add an experimental sample showing how workflow-session activity affinity lets workflows reuse worker-local conversation history, and makes the impact visible.
conversation_stepactivities (default 6 turns). Turnnneeds every earlier turn0..n-1. Each worker caches the turns it holds per workflow Run ID and fetches only the turns it is missing, with simulated latency per turn (--fetch-seconds, default 0.5s). Turn 0 needs no history; the history is not workflow state.live.py) of how far each worker holds each conversation, plus per-workflow placement strips (○2= worker 2 had every earlier turn,●2(3)= worker 2 fetched 3 missing turns); disabled with--no-liveor when not a TTY;--activity-workers) alongside session workers.Requirements and scope
Requires the experimental SDK from temporalio/sdk-python#1979 and server from temporalio/temporal#12630, with sticky activity execution enabled for the namespace. The README explains running with the feature SDK interpreter.
Demonstrates healthy-worker affinity and cache reuse, not failover. Ordinary routing may colocate activities by chance.
Validation