Repository navigation
Replaying a Strands agent run with the model server switched off #4265
xizhuomengcontin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Verified against the Strands SDK today: an agent run can be recorded from outside the process and then re-run with no model server present at all.
Disclosure: I work on the tool (OrcaReplay, Apache-2.0, no paid tier).
The run
A real
AgentoverOpenAIModel, pointed at a local OpenAI-compatible endpoint:Nothing is installed into Strands — no hook, no callback handler (I passed
callback_handler=Noneprecisely so the capture could not be confused with instrumentation), no code change beyond reading the base URL from the environment.Why it might be useful here
Re-running an agent while you change the system prompt or the tool set: the model responses stay fixed, so the difference you see is your change rather than the sampler. Also useful in CI, and for chasing a single bad trajectory without paying for it each time. From a checkpoint the run can instead continue live on a different model, which is a fairer way to compare two models on one task than running each from scratch.
Limits, stated up front
egress=blockedon replay means model-provider egress. Recorded tool calls still execute for real, so a recorded shell or HTTP tool runs again. It is not a sandbox.One small note in case it is a real issue rather than my environment: calling the agent emitted
RuntimeError: generator didn't stop after athrow()alongside the correct answer, both with and without recording. Harmless here, but it looked like something you might want to know about.All reactions