Skip to content

fix: preserve CrewAI tool history across turns#266

Open
darvell-thenvoi wants to merge 2 commits into
mainfrom
fix/crewai-history-replay
Open

fix: preserve CrewAI tool history across turns#266
darvell-thenvoi wants to merge 2 commits into
mainfrom
fix/crewai-history-replay

Conversation

@darvell-thenvoi

@darvell-thenvoi darvell-thenvoi commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve CrewAI tool_call/tool_result events as replayable history instead of dropping them
  • replay the full room transcript on each CrewAI kickoff instead of reducing prior turns to a bootstrap blob
  • add regression coverage for tool replay and full-history kickoff behavior, and update CrewAI converter conformance expectations
  • change platform instructions order so platform instructions are the first thing rather than appended

Test plan

  • env -u VIRTUAL_ENV uv run python -m pytest tests/converters/test_crewai.py tests/adapters/test_crewai_adapter.py -v
  • env -u VIRTUAL_ENV uv run python -m pytest tests/framework_conformance/test_converter_conformance.py -v -k crewai
  • env -u VIRTUAL_ENV uv run ruff check src/thenvoi/converters/crewai.py src/thenvoi/adapters/crewai.py tests/converters/test_crewai.py tests/adapters/test_crewai_adapter.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py
  • env -u VIRTUAL_ENV uv run ruff format --check src/thenvoi/converters/crewai.py src/thenvoi/adapters/crewai.py tests/converters/test_crewai.py tests/adapters/test_crewai_adapter.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py
  • env -u VIRTUAL_ENV uv run pyrefly check src/thenvoi/converters/crewai.py src/thenvoi/adapters/crewai.py

@darvell-thenvoi darvell-thenvoi requested a review from a team April 22, 2026 22:51
@darvell-thenvoi

Copy link
Copy Markdown
Collaborator Author

Rechecked current head. No new code changes were needed; the PR remains scoped to CrewAI history/tool replay handling and its converter/conformance coverage.

Validation:

  • uv run --extra dev pytest tests/adapters/test_crewai_adapter.py -k 'history or replay or backstory or tool' -q --no-cov -> 45 passed, 25 deselected
  • uv run --extra dev pytest tests/converters/test_crewai.py tests/framework_conformance/test_converter_conformance.py -k crewai -q --no-cov -> 28 passed, 1 skipped, 154 deselected
  • uv run ruff check src/thenvoi/adapters/crewai.py src/thenvoi/converters/crewai.py tests/adapters/test_crewai_adapter.py tests/converters/test_crewai.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py -> passed
  • uv run ruff format --check src/thenvoi/adapters/crewai.py src/thenvoi/converters/crewai.py tests/adapters/test_crewai_adapter.py tests/converters/test_crewai.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py -> passed

1 similar comment
@darvell-thenvoi

Copy link
Copy Markdown
Collaborator Author

Rechecked current head. No new code changes were needed; the PR remains scoped to CrewAI history/tool replay handling and its converter/conformance coverage.

Validation:

  • uv run --extra dev pytest tests/adapters/test_crewai_adapter.py -k 'history or replay or backstory or tool' -q --no-cov -> 45 passed, 25 deselected
  • uv run --extra dev pytest tests/converters/test_crewai.py tests/framework_conformance/test_converter_conformance.py -k crewai -q --no-cov -> 28 passed, 1 skipped, 154 deselected
  • uv run ruff check src/thenvoi/adapters/crewai.py src/thenvoi/converters/crewai.py tests/adapters/test_crewai_adapter.py tests/converters/test_crewai.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py -> passed
  • uv run ruff format --check src/thenvoi/adapters/crewai.py src/thenvoi/converters/crewai.py tests/adapters/test_crewai_adapter.py tests/converters/test_crewai.py tests/framework_configs/converters.py tests/framework_conformance/test_converter_conformance.py -> passed

Base automatically changed from dev to main May 26, 2026 15:46
@darvell-thenvoi darvell-thenvoi force-pushed the fix/crewai-history-replay branch from 6d2b2a9 to 1c8724c Compare May 27, 2026 01:47
@darvell-thenvoi darvell-thenvoi changed the base branch from main to dev May 27, 2026 02:15
Darvell Long added 2 commits May 26, 2026 19:22
Keep CrewAI tool events in converted history and replay the full room transcript on each kickoff so multi-step peer workflows retain more execution context.
Prepend the Thenvoi platform prompt before custom CrewAI backstory text so the adapter's routing and tool-use rules land earlier in the backstory block.
@darvell-thenvoi darvell-thenvoi force-pushed the fix/crewai-history-replay branch from 1c8724c to e6abfa3 Compare May 27, 2026 02:24
Base automatically changed from dev to main June 22, 2026 10:58
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