fix: harden sensitive runtime logging#3938
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5d79b835e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90083bc89c
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a574cc745
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7c819c71f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f318085937
ℹ️ 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".
3351f33 to
92ec6de
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92ec6debf7
ℹ️ 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".
062c2ba to
5bc85a2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bc85a2bc5
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1aa2fcfeb3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cff0a570d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 520adb2081
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa372d6d28
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e5811b61d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b9b48d3ee
ℹ️ 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".
| exc_info=True, | ||
| log_tool_action_warning( | ||
| logger, | ||
| "Failed to unmount UnixLocal workspace mount before deleting root", |
There was a problem hiding this comment.
Retain the failed UnixLocal mount path
When tool-data logging is explicitly enabled and a workspace has multiple ephemeral mounts, this replacement drops the previous mount_path from the warning. A generic unmount exception then leaves identical records for every mount, and because the method returns without deleting the workspace after any failure, the log is the only indication of which mount blocked cleanup; attach the path as diagnostic-only context.
Useful? React with 👍 / 👎.
| if force_no_raise or sink.on_error in ("log", "ignore"): | ||
| if sink.on_error == "log": | ||
| logger.exception("sandbox event sink failed (ignored): %s", type(sink).__name__) | ||
| log_tool_action_error(logger, "Sandbox event sink failed (ignored)", exc) |
There was a problem hiding this comment.
Retain the failing sink type in swallowed diagnostics
For sinks configured with on_error="log", the exception is swallowed immediately after this record, but the replacement no longer includes the previous type(sink).__name__. Applications with several instrumentation sinks therefore cannot determine which sink lost an event when their handlers raise the same exception; preserve the sink identity as diagnostic-only context while keeping the redacted message fixed.
Useful? React with 👍 / 👎.
|
|
||
|
|
||
| def _processor_diagnostic_extra(processor: TracingProcessor) -> dict[str, object]: | ||
| return {"trace_processor": processor} |
There was a problem hiding this comment.
Keep trace processor extras queue-safe
When both data policies enable diagnostics and the application sends these records through a multiprocessing QueueHandler, the raw processor object survives QueueHandler.prepare() as a custom LogRecord attribute. A processor containing common non-pickleable state such as locks or threads then causes the queue feeder to reject the failure record, so the processor error is never reported; store a queue-safe instance identifier instead of the processor object itself.
AGENTS.md reference: AGENTS.md:L108-L108
Useful? React with 👍 / 👎.
| "%s: %s", | ||
| message, | ||
| exc, | ||
| exc_info=exc, |
There was a problem hiding this comment.
Avoid evaluating exception truthiness while logging
When diagnostic logging is enabled, logging tests the truthiness of exc_info before normalizing an exception instance. A custom exception whose __bool__ raises therefore makes these helpers raise while handling the original failure—changing swallowed callback, cleanup, and fallback behavior—while a falsey exception silently loses its traceback; pass a stable exception tuple instead, including in _log_action_at_level.
Useful? React with 👍 / 👎.
This pull request fixes sensitive-data exposure across runtime logging paths by adding shared policy-aware logging helpers and applying them to model, tool, MCP, Realtime, session, tracing, voice, and sandbox error boundaries.
In redacted mode, MCP lifecycle logs now use fixed messages without reading server or tool names. Diagnostic mode preserves useful endpoint identity while stripping URL credentials, query parameters, and fragments.
It also adds a Python-native sensitive logging audit skill with stable inventory fingerprints, baseline comparison, and review-ledger validation. The change does not alter public APIs, persisted schemas, or wire protocols, and detailed diagnostics remain available when sensitive-data logging is explicitly enabled.