Skip to content

Add clip_range compatibility to PPOConfig - #68

Merged
Navy10021 merged 1 commit into
mainfrom
codex/fix-typeerror-in-ppoconfig-initialization
Mar 6, 2026
Merged

Navy10021 merged 1 commit into
mainfrom
codex/fix-typeerror-in-ppoconfig-initialization

Conversation

@Navy10021

Copy link
Copy Markdown
Owner

Motivation

  • utils/hp_search.py and tests pass clip_range into PPOConfig, but the PPOConfig dataclass only exposed clip_eps, causing TypeError: PPOConfig.__init__() got an unexpected keyword argument 'clip_range' during HP search runs.
  • Provide a backward-compatible bridge so existing callers that use clip_range continue to work without changing other code.

Description

  • Added an optional clip_range: Optional[float] = None field to PPOConfig in rl_agent/blue_agent.py to accept legacy callers that pass clip_range.
  • Implemented __post_init__ on PPOConfig to synchronize clip_range and clip_eps so either name can be used interchangeably at construction time.
  • Change is contained in rl_agent/blue_agent.py and preserves existing clip_eps behavior when clip_range is not provided.

Testing

  • Ran pytest -q tests/test_hp_search.py and it passed (7 passed).
  • Ran the full test suite with pytest -q and it succeeded (143 passed, 1 skipped).

Codex Task

@Navy10021
Navy10021 merged commit c58d6f1 into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant