Skip to content

Defer caught-error log rendering - #97

Merged
Snuffy2 merged 4 commits into
mainfrom
perf-error-path-logging
Aug 8, 2026
Merged

Defer caught-error log rendering#97
Snuffy2 merged 4 commits into
mainfrom
perf-error-path-logging

Conversation

@Snuffy2

@Snuffy2 Snuffy2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Defers exception-detail rendering in the shared error wrapper until a log handler formats the emitted record.

What Changed

  • Added a lazy exception-detail formatter for caught-error logs.
  • Preserved ERROR-level logging, credential redaction, traceback content, and exception propagation.
  • Added regression coverage for deferred rendering.

Why

Repeated caught errors should not pay traceback formatting and message-redaction costs when a log record is filtered or otherwise never formatted.

Greptile Summary

The PR snapshots sanitized exception details when caught while deferring traceback string formatting until a logging handler formats the record.

  • Adds a cached lazy formatter for caught-error records.
  • Adds regression coverage for credential redaction, traceback snapshots, and deferred formatting.
  • Aligns the pydoclint hook with the repository’s Python 3.14 runtime.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
aiopnsense/helpers.py Replaces eager traceback string construction with a sanitized snapshot whose final formatting is deferred and cached.
tests/test_helpers.py Verifies eager safe-data capture, deferred traceback formatting, cached rendering, and absence of retained exception or frame references.
prek.toml Pins pydoclint to Python 3.14 consistently with the project runtime and existing hook configuration.

Reviews (3): Last reviewed commit: "Clarify error logging test fixtures" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Snuffy2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0b42ebdc-1d83-4f30-b8ee-e5aceed38118

📥 Commits

Reviewing files that changed from the base of the PR and between b08bb21 and 21472a5.

📒 Files selected for processing (3)
  • aiopnsense/helpers.py
  • prek.toml
  • tests/test_helpers.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  aiopnsense
  helpers.py
Project Total  

This report was generated by python-coverage-comment-action

Snuffy2 added 2 commits August 8, 2026 17:19
Snapshot only sanitized exception data before records reach logging handlers and cache the deferred traceback rendering result.
Align fixture docstrings with eager message sanitization and deferred traceback formatting.
@Snuffy2

Snuffy2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Snuffy2

Snuffy2 commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 21472a5876

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Snuffy2
Snuffy2 merged commit 725154a into main Aug 8, 2026
13 checks passed
@Snuffy2
Snuffy2 deleted the perf-error-path-logging branch August 8, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant