SWF v42 baseline: episode builder hardening - #46
Merged
Conversation
Copilot review findings on PR #45, verified: ingest responses that decode as non-JSON now raise EpisodeIngestError instead of escaping the callers' catch; handle_message() traps definition-hook failures so one malformed bus message cannot take down the listening agent; tick() retains an episode for retry when its close fails and falls back to an empty summary when the summary hook fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Test Coverage Summary |
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens the episode builder and monitor ingest client so that malformed responses or non-ingest exceptions don’t crash the listening agent during SWF baseline v42.
Changes:
- Wrap REST client JSON parsing in
_post()/_get()to raiseEpisodeIngestErrorwhen the response body is not valid JSON. - Prevent non-ingest exceptions in
EpisodeBuilder.handle_message()from propagating by catching and logging unexpected errors. - In
EpisodeBuilder.tick(), tolerate failures indefinition.summary()and retryclose()when ingest close fails (keeping episodes active).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+353
to
+357
| try: | ||
| summary = definition.summary(context) | ||
| except Exception as exc: | ||
| logger.error("episode summary failed for %s: %s", | ||
| execution_id, exc) |
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.
Release v42 of the coordinated SWF baseline. Release notes for the cycle are in swf-testbed
RELEASE_NOTES.md.swf-common-lib in this cycle: the episode builder is hardened against non-ingest failures, so a failure outside event ingest does not take the builder down.
🤖 Generated with Claude Code