Skip to content

test: update module_llm tests for system prompt handling (None -> "")#44

Merged
colinfrisch merged 1 commit intomesa:mainfrom
februarysea:test-module-followup-pr41
Jan 5, 2026
Merged

test: update module_llm tests for system prompt handling (None -> "")#44
colinfrisch merged 1 commit intomesa:mainfrom
februarysea:test-module-followup-pr41

Conversation

@februarysea
Copy link
Copy Markdown
Contributor

Summary

Updates existing tests to align with the system prompt handling behavior introduced in the previous fix. This ensures the test suite correctly reflects the normalized handling of empty system prompts.

Bug / Issue

This PR is a follow-up to #41 (Fix Ollama tool calling crash when system prompt is None).

In PR #41, the runtime crash was resolved by normalizing the system prompt when it is None. However, some existing tests still assumed the old behavior, causing a mismatch between the implementation and the test expectations.

Implementation

  • Updated existing tests in test_module_llm.py to align with the current behavior where an empty or missing system prompt is normalized to an empty string (None -> "") for Ollama models.
  • No changes were made to the core implementation logic; this PR strictly updates test expectations to match the corrected behavior.

Testing

  • Ran the updated test suite locally with pytest and pre-commit.

Additional Notes

N/A

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 20, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@februarysea
Copy link
Copy Markdown
Contributor Author

It seems like The Upload coverage to Codecov step in the mesa/mesa-llm workflow failed due to a missing or invalid CODECOV_TOKEN, preventing the coverage report upload.

Comment thread tests/test_module_llm.py
@colinfrisch
Copy link
Copy Markdown
Member

LGTM, thanks !!

@colinfrisch colinfrisch merged commit 0d92949 into mesa:main Jan 5, 2026
3 of 12 checks passed
colinfrisch added a commit that referenced this pull request Jan 27, 2026
* created agent and model class

* create agent and model with ollama

* correct terminal

* some additional changes

* mesa_llm tutorial is now done

* Improve reasoning demonstration in introductory model tutorial

* finalize first mesa-llm model tutorial focused on LLMAgent

* Add tutorial-friendly negotiation model

* Minor cleanup

* Delete accidently created file

* Update docs/negotiation_model_tutorial.md

* Add agent messaging and documentation fixes to negotiation tutor

* fix first_model & negotiation_model_tutorial

* fix first model

* inital commit model.py and agent.py

* runs with errors

* runs with errors

* fixed harvesting logic

* final tests with gemini-2.5-flash-lite

* Readme.md file added

* readme.md

* Fix harvesting logic in tools.py

* review changes

* review 2

* fix: treat ollama_chat as ollama provider (#43)

* link to readthedocs and small fixes

* Fix and add dependencies (#49)

* fix-prompt-gestion

* fix-prompt-gestion align testing

* fix dependencies

* Fix prompt gestion (#48)

* fix-prompt-gestion

* fix-prompt-gestion align testing

* Bump actions/upload-artifact from 5 to 6 (#50)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/cache from 4 to 5 (#51)

Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test: update module_llm tests for system prompt handling (None -> "") (#44)

* test disabling Codecov upload

* test build

* testing id-token: write

* reset

* feat: Add dialogue history context to negotiation agents
- Implement _get_dialogue_history() to extract conversation from memory
- Inject dialogue context into reasoning prompts
- Support both STLTMemory and EpisodicMemory
- Handle both agent objects (send_message) and IDs (speak_to tool)
- Format senders as 'AgentType ID' for clarity
- Limit to last 5 exchanges to manage context window

Fixes agent amnesia in multi-turn negotiations where agents
forgot previous offers and repeated themselves.

* refactor: address code review feedback - remove duplication, optimize iteration, remove debug prints

* docs: minor fixes to first model and negotiation_model

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Colin FRISCH <colin.frisch@gmail.com>
Co-authored-by: sujal gawas <sujalgawas18@gmail.com>
Co-authored-by: februarysea <31513558+februarysea@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nithin9585 <nithin958595@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@wang-boyu wang-boyu added the testing Release notes label label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Release notes label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants