Skip to content

Fix mutable default previous_run parameters across assistants#83

Closed
DavidJBianco wants to merge 1 commit into
mainfrom
codex/fix-mutable-default-for-previous_run
Closed

Fix mutable default previous_run parameters across assistants#83
DavidJBianco wants to merge 1 commit into
mainfrom
codex/fix-mutable-default-for-previous_run

Conversation

@DavidJBianco

Copy link
Copy Markdown
Collaborator

Motivation

  • The code used shared mutable defaults like previous_run: list = list() in multiple assistant entrypoints, which can retain state across invocations and leak prior session context in multi-user or server scenarios.
  • This is a security-sensitive information disclosure risk when agents are invoked by the Streamlit/API or MCP server paths.

Description

  • Replaced mutable defaults previous_run: list = list() with safe optional defaults previous_run: Optional[list] = None in assistant entrypoints.
  • Added Optional to type imports where required so annotations remain explicit and valid.
  • Changes were applied to peak_assistant/able_assistant/__init__.py, peak_assistant/data_assistant/__init__.py, peak_assistant/hypothesis_assistant/hypothesis_refiner_cli.py, peak_assistant/planning_assistant/__init__.py, and peak_assistant/research_assistant/__init__.py to remove the shared-list pattern while preserving existing function signatures and behavior.

Testing

  • Ran python -m compileall -q peak_assistant to verify the package compiles, and it succeeded.
  • Verified there are no remaining occurrences of the pattern previous_run: list = list() under peak_assistant using a repository search, and the check returned no matches.

Codex Task

@DavidJBianco

Copy link
Copy Markdown
Collaborator Author

Merged into dev via #88 (batch-d-refiner-fixes, commit 50bdee2).

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