Skip to content

Isolate Python execution logs between tool calls - #22

Merged
Shulyaka merged 1 commit into
masterfrom
fix/python-log-isolation
Oct 24, 2026
Merged

Shulyaka merged 1 commit into
masterfrom
fix/python-log-isolation

Conversation

@Shulyaka

@Shulyaka Shulyaka commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Python tool calls currently share a log buffer and attach capture handlers to the same logger, allowing previous or concurrent calls' messages to appear in another result.

Give each invocation its own buffer, unregistered logger, and private logging manager. Direct logging, import logging, and nested child loggers are captured only by that execution while still propagating normally to Home Assistant. Preserve message formatting, levels, and global logging-disable behavior without mutating the parent logger or growing the global logger registry. Always detach and close the capture handler after execution.

The optional logger parameter on the internal execute() helper preserves its existing direct-call interface. Uses standard logging APIs available with HA 2026.10.0.

Validation:

  • Final Python suite on HA 2026.10.0: 13 passed.
  • Regressions cover sequential calls, failed-call cleanup, imported and child loggers, same-named concurrent children, propagation, and logging settings.
  • Concurrent tests keep both captures active using barriers, so cross-call leakage is exercised deterministically.
  • All configured pre-commit hooks and git diff --check passed.
  • Full GitHub CI on HA 2026.10.3: 222 tests passed, with lint and formatting passing.
  • All four fixes apply together cleanly; 16 combined checks passed on HA 2026.10.0.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T19:04:44.719976Z a56236d PR opened
🔒 Security Review ✅ Completed 2026-10-24T19:06:41.336871Z a56236d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Shulyaka
Shulyaka merged commit e7ef02c into master Oct 24, 2026
4 checks passed
@Shulyaka
Shulyaka deleted the fix/python-log-isolation branch October 24, 2026 19:47
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