runtime/codegen: make activity retries replay-safe#98
Merged
Conversation
Keep canonical tool result JSON at execution and history boundaries while projecting transcript tool results to semantic content. Enforce result-or-error contracts in the runtime and make replay rebuild the same tool_result shape as live execution.
Make the tool result contract derive error state from planner.ToolResult itself instead of threading a second error parameter through the runtime boundary.
Remove the redundant `CRITICAL:` prefix from runtime error messages while preserving the underlying error text and lock the wording down with focused runtime tests.
Keep Temporal-only timing mechanics behind the engine while preserving canonical run completion and transcript replay across restarts and legacy persisted events.
Make inconsistent closed-workflow states fail fast in Temporal status mapping and align the generator goldens with the new activity timeout contract so lint and tests enforce the updated timing semantics.
Use stable hook and tool identities to make retried activity attempts replay their canonical results instead of duplicating side effects, then restore default retries for hook and execute-tool activities.
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
Test plan
make lintmake testgo test ./runtime/agent/runtime ./codegen/agent/...