Skip to content

SWF v42 baseline: episode builder hardening - #46

Merged
wenaus merged 1 commit into
mainfrom
infra/baseline-v42
Aug 15, 2026
Merged

SWF v42 baseline: episode builder hardening#46
wenaus merged 1 commit into
mainfrom
infra/baseline-v42

Conversation

@wenaus

@wenaus wenaus commented Aug 15, 2026

Copy link
Copy Markdown
Member

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

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>
Copilot AI lite review requested due to automatic review settings August 15, 2026 11:28
@github-actions

Copy link
Copy Markdown

Test Coverage Summary

src/swf_common_lib/api_utils.py          87     87     0%   8-198
src/swf_common_lib/base_agent.py        441    441     0%   5-889
src/swf_common_lib/config_utils.py       30     30     0%   7-102
src/swf_common_lib/episodes.py          188    188     0%   23-379
src/swf_common_lib/logging_utils.py      33      0   100%
src/swf_common_lib/rest_logging.py       80     80     0%   8-157
src/swf_common_lib/rucio_utils.py       139    139     0%   5-343
-------------------------------------------------------------------
TOTAL                                   998    965     3%
============================== 5 passed in 0.53s ===============================

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 raise EpisodeIngestError when 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 in definition.summary() and retry close() 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)
@wenaus
wenaus merged commit ecd99ba into main Aug 15, 2026
6 checks passed
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