Skip to content

Conversation

@AndrewCEmil
Copy link
Contributor

@AndrewCEmil AndrewCEmil commented Oct 7, 2025

Description

Allow for prompt rewriting in setup_state. If the returned state contains the prompt field, then overwrite prompt with the returned value.

This enables environments that, for example, contain grounding information in the initial prompt.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

This could be considered a breaking change in the sense that if somebody was already mutating the prompt field in setup_state, then the system behavior would change. I don't know why somebody would be doing that as it would have no effect, but it's possible.

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

This resolves a problem for a use-case that I have. Since verifiers doesn't currently support generators for datasets, my other options are:

  • Regenerate my dataset for each run
  • Decorate rollout in my subclass to modify prompt before super.rollout is called. However, I need to store metadata in state that corresponds to the modification to prompt. So I would then also need to mutate info to pipe that data through into the state object, which seems kind of lame.
  • Completely override rollout with a custom implementation

But this seemed like the best approach and I thought that others would find this change useful.

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.

1 participant