Skip to content

Fix simulator logs containing future messages#48

Merged
cemde merged 1 commit intomainfrom
fix/simulator-log-history
Mar 22, 2026
Merged

Fix simulator logs containing future messages#48
cemde merged 1 commit intomainfrom
fix/simulator-log-history

Conversation

@cemde
Copy link
Collaborator

@cemde cemde commented Mar 22, 2026

Description

MessageHistory.to_list() returned a direct reference to the internal _messages list. This caused simulator log entries to be mutated after creation. Each entry's conversation_history ended up containing messages from future turns that hadn't occurred at logging time. Fixed by returning a shallow copy.

Fixes #5

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement (refactoring, formatting, etc.)

Checklist

Contribution

Documentation

  • Added/updated docstrings for new/modified functions as instructed CONTRIBUTING.md
  • Updated relevant documentation in docs/ (if applicable)
  • Tag github issue with this PR (if applicable)

Changelog

  • Added entry to CHANGELOG.md under [Unreleased] section
    • Use Added section for new features
    • Use Changed section for modifications to existing functionality
    • Use Fixed section for bug fixes
    • Use Removed section for deprecated/removed features
  • OR this is a documentation-only change (no changelog needed)

Architecture (if applicable)

  • Core/Interface separation: Changes in maseval/core/ do NOT import from maseval/interface/
  • Dependencies: New core dependencies added sparingly; framework integrations go to optional dependencies

Additional Notes

None.

to_list() returned a direct reference to the internal _messages list,
causing simulator logs to contain future conversation messages added
after the log entry was created. Return a shallow copy instead.

Fixes #5
@cemde cemde added bug Something isn't working core In regards to the core package `maseval/core` labels Mar 22, 2026
@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  maseval/core
  history.py
Project Total  

This report was generated by python-coverage-comment-action

@cemde cemde merged commit 95941d9 into main Mar 22, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core In regards to the core package `maseval/core`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User Simulator logging bug

1 participant