Skip to content

fix(envs): pass reset_observation_cls only when the installed core supports it - #1341

Merged
burtenshaw merged 5 commits into
openenv:mainfrom
rycerzes:fix/env-reset-observation-compat
Oct 20, 2026
Merged

burtenshaw merged 5 commits into
openenv:mainfrom
rycerzes:fix/env-reset-observation-compat

Conversation

@rycerzes

@rycerzes rycerzes commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Env apps pass reset_observation_cls only when the installed create_app accepts it, so images built from their own lockfiles (openenv 0.3.1/0.4.1) start again.

Tested: echo_env and finqa_env built from their Dockerfiles start and return 200 on /health; new tests import each app against both create_app signatures.

Fixes #1339


Note

Low Risk
Compatibility-only startup logic with regression tests; no change to env behavior when a current openenv-core is installed.

Overview
Fixes env server startup when Docker images pin older openenv-core (e.g. 0.3.1/0.4.1) that do not accept reset_observation_cls or state_cls on create_app.

Each affected env server/app.py now builds optional kwargs with inspect.signature(create_app) and only passes reset_observation_cls=Observation and the env-specific state_cls when those parameters exist. On newer core, behavior is unchanged; on older core, import no longer fails with unexpected keyword arguments.

Adds tests/envs/test_reset_observation_compat.py to re-import all five env apps under mocked “released” and “current” create_app signatures, asserting apps load and still forward Observation / state models when supported.

Reviewed by Cursor Bugbot for commit e4c40be. Bugbot is set up for automated code reviews on this repo. Configure here.

rycerzes and others added 2 commits October 7, 2026 21:03
…pports it

Fixes env images crashing at import on released openenv-core, which predates the parameter.

Fixes openenv#1339

@burtenshaw burtenshaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the compatibility guard and preserved current-main removal of Pi/OpenCode during refresh. All 10 import tests pass against old and current create_app signatures; touched lint, format, and import sorting pass.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@burtenshaw

Copy link
Copy Markdown
Collaborator

Refreshed against main after #1198. The compatibility wrapper now checks support for state_cls and reset_observation_cls independently, preserving each environment's concrete State model on current core while keeping older core signatures working.

Verified at e4c40be: 39 compatibility/State-wiring tests pass; touched-file lint, formatting, and import ordering pass. Independent review is checking the mixed-signature cases as well.

@burtenshaw burtenshaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the #1198 integration. Reset and State keyword support are gated independently; the strict old-core stub remains unchanged. Independent validation passed all 39 compatibility/State tests plus 8 reset-only and State-only signature cases, with touched-file lint clean.

@burtenshaw
burtenshaw merged commit c696fe2 into openenv:main Oct 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Env images crash at import: create_app() got an unexpected keyword argument 'reset_observation_cls'

2 participants