Skip to content

fix: make agent callback logging opt-in for CLIs#73

Closed
DavidJBianco wants to merge 1 commit into
mainfrom
codex/propose-fix-for-logging-vulnerability-9zt7m3
Closed

fix: make agent callback logging opt-in for CLIs#73
DavidJBianco wants to merge 1 commit into
mainfrom
codex/propose-fix-for-logging-vulnerability-9zt7m3

Conversation

@DavidJBianco

Copy link
Copy Markdown
Collaborator

Motivation

  • The CLIs previously wired preprocess_messages_logging and postprocess_messages_logging by default, causing prompt/result previews to be persisted to fixed local files and creating a local information-leak risk.
  • The intent is to preserve the debugging callbacks while preventing unintentional leakage during normal runs by making disk logging an explicit opt-in.

Description

  • Added a --debug-agents CLI flag to peak_assistant/data_assistant/__main__.py, peak_assistant/planning_assistant/__main__.py, and peak_assistant/hypothesis_assistant/hypothesis_refiner_cli.py to opt in to debug callback logging.
  • Introduced a debug_agents_opts dict in each CLI that is populated only when --debug-agents is set and passed into the agent invocation via **debug_agents_opts.
  • Removed the unconditional passing of msg_preprocess_callback=preprocess_messages_logging and msg_postprocess_callback=postprocess_messages_logging so callbacks are no longer enabled by default.
  • Preserved the existing preprocess_messages_logging and postprocess_messages_logging implementations so debug behavior remains available when explicitly requested.

Testing

  • Ran a targeted search to confirm the new --debug-agents flag and that callbacks are no longer wired by default with rg -n "msg_preprocess_callback=preprocess_messages_logging|msg_postprocess_callback=postprocess_messages_logging|--debug-agents" which returned the updated CLI locations.
  • Compiled the modified CLI modules with python -m compileall peak_assistant/data_assistant/__main__.py peak_assistant/planning_assistant/__main__.py peak_assistant/hypothesis_assistant/hypothesis_refiner_cli.py and the compilation succeeded.

Codex Task

@DavidJBianco

Copy link
Copy Markdown
Collaborator Author

Merged into dev via #87 (batch-c-logging-opt-in, commit 2597449).

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