Skip to content

fix(ci): instantiate CIEvoStr with a Scenario, add minimal CIScen#1417

Open
genisis0x wants to merge 1 commit into
microsoft:mainfrom
genisis0x:fix/1329-ci-evostr-scenario
Open

fix(ci): instantiate CIEvoStr with a Scenario, add minimal CIScen#1417
genisis0x wants to merge 1 commit into
microsoft:mainfrom
genisis0x:fix/1329-ci-evostr-scenario

Conversation

@genisis0x
Copy link
Copy Markdown

Summary

Closes #1329.

python rdagent/app/CI/run.py <path> aborts at startup with:

File "rdagent/app/CI/run.py", line 730, in <module>
    estr = CIEvoStr()
TypeError: EvolvingStrategy.__init__() missing 1 required positional argument: 'scen'

Root cause

EvolvingStrategy.__init__(self, scen: Scenario) (rdagent/core/evolving_framework.py:61-63) requires a Scenario instance. CIEvoStr inherits without overriding __init__, but the script's module-level launch (rdagent/app/CI/run.py:729) constructs it with no arguments, so the call fails before the lint loop ever runs.

CIEvoStr.evolve itself never reads self.scen — the linting workflow is driven entirely by CI_prompts and ruff/mypy output — so the missing argument is purely a contract violation, not a logical dependency.

Change

rdagent/app/CI/run.py:

  • Add a small local CIScen(Scenario) class with the four abstract methods (background, rich_style_description, get_scenario_all_desc, get_runtime_environment) returning short CI-appropriate strings. Keeping it local avoids pulling a CI-specific scenario into rdagent/scenarios/ where it would have no other consumer.
  • Pass an instance through at the call site: estr = CIEvoStr(scen=CIScen()).

Verification

  • python -m py_compile rdagent/app/CI/run.py clean.
  • ast.parse clean.
  • Approach matches the suggestion in the issue body ("explicitly create and pass in" a Scenario rather than calling with no arguments).

EvolvingStrategy.__init__ requires a Scenario instance, but
rdagent/app/CI/run.py was calling CIEvoStr() with no arguments. Running
'python rdagent/app/CI/run.py <path>' aborts before any work starts with:

    TypeError: EvolvingStrategy.__init__() missing 1 required
    positional argument: 'scen'

CIEvoStr does not actually read self.scen anywhere — the linting loop is
driven entirely by CI_prompts and ruff/mypy output — so the cleanest fix
is a small Scenario stub local to this file, named CIScen, that satisfies
the four abstract methods with CI-appropriate strings and an empty
runtime-environment value. Pass an instance through at the call site.

Fixes microsoft#1329
@genisis0x
Copy link
Copy Markdown
Author

Read the CLA — all clear from my side.

@microsoft-github-policy-service agree

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.

rdagent/app/CI/run.py instantiates EvolvingStrategy without required Scenario argument

1 participant