fix: make agent callback logging opt-in for CLIs#73
Closed
DavidJBianco wants to merge 1 commit into
Closed
Conversation
3 tasks
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
preprocess_messages_loggingandpostprocess_messages_loggingby default, causing prompt/result previews to be persisted to fixed local files and creating a local information-leak risk.Description
--debug-agentsCLI flag topeak_assistant/data_assistant/__main__.py,peak_assistant/planning_assistant/__main__.py, andpeak_assistant/hypothesis_assistant/hypothesis_refiner_cli.pyto opt in to debug callback logging.debug_agents_optsdict in each CLI that is populated only when--debug-agentsis set and passed into the agent invocation via**debug_agents_opts.msg_preprocess_callback=preprocess_messages_loggingandmsg_postprocess_callback=postprocess_messages_loggingso callbacks are no longer enabled by default.preprocess_messages_loggingandpostprocess_messages_loggingimplementations so debug behavior remains available when explicitly requested.Testing
--debug-agentsflag and that callbacks are no longer wired by default withrg -n "msg_preprocess_callback=preprocess_messages_logging|msg_postprocess_callback=postprocess_messages_logging|--debug-agents"which returned the updated CLI locations.python -m compileall peak_assistant/data_assistant/__main__.py peak_assistant/planning_assistant/__main__.py peak_assistant/hypothesis_assistant/hypothesis_refiner_cli.pyand the compilation succeeded.Codex Task