Skip to content

fix(sdk-python): log wrap record failures instead of raising#53

Merged
negillett merged 1 commit into
mainfrom
wrap-log-record-failures
May 19, 2026
Merged

fix(sdk-python): log wrap record failures instead of raising#53
negillett merged 1 commit into
mainfrom
wrap-log-record-failures

Conversation

@negillett
Copy link
Copy Markdown
Member

Summary

  • When wrap() completes successfully but outbox recording fails, return
    the callable result and log [intentproof] execution record failed.
  • Preserve existing behavior when the wrapped callable raises: recording
    failures are still chained via raise ... from record_exc.

Test plan

  • pytest -q (91 tests, 100% coverage on touched modules)
  • Updated sync and async tests for success-path record failures

When the wrapped callable returns normally but outbox recording
fails, return the result and log the infrastructure error.

Signed-off-by: Nathan Gillett <nathan@intentproof.io>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 19, 2026

PR Summary

Medium Risk
Changes runtime error-handling in wrap() by swallowing execution-recording failures on success paths, which could hide telemetry/outbox outages unless logs are monitored. Application exceptions are still preserved and chained when recording also fails.

Overview
wrap() (sync + async) no longer raises when _record_execution fails after the wrapped callable returns successfully; it returns the callable result and emits a warning via intentproof.instrumentation.

When the wrapped callable raises, behavior is preserved: recording failures are still chained as the __cause__. Tests are updated to assert the new log-and-return behavior for success-path record failures.

Reviewed by Cursor Bugbot for commit 1a467e4. Bugbot is set up for automated code reviews on this repo. Configure here.

@negillett negillett merged commit 6122d6a into main May 19, 2026
3 checks passed
@negillett negillett deleted the wrap-log-record-failures branch May 19, 2026 22:40
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.

1 participant