Check conversation roles when using CrewAI kickoff with CometAPI

If your CometAPI-backed CrewAI application passes conversation history into Agent.kickoff, add a role-preservation check before changing CrewAI versions or expanding the model route. A successful response is not the acceptance criterion: the previous assistant turn must still be represented as an assistant turn.

CrewAI 1.15.18 lists this bug fix: “Keep message roles when Agent.kickoff gets a conversation.” That is a useful regression-test target, not evidence that every earlier version or every provider route was affected.

The CometAPI connection is specific. Its CrewAI integration guide configures the LLM with model, api_key, and base_url, using https://api.cometapi.com/v1 for model access. It separates CrewAI orchestration from model-ID routing through CometAPI and warns that a common interface does not guarantee identical model behavior or capabilities.

Scope matters: the guide runs crew.kickoff(inputs={"topic": topic}). It does not demonstrate conversational Agent.kickoff. The check below is for applications that add that entry point, not a claim that the tutorial itself loses roles.

A small upgrade gate

This is a proposed test procedure, not a reported test result.

  1. Freeze the route. Record the installed CrewAI version, dependency lock, CometAPI base URL and configured model ID. Compare your existing version with the proposed upgrade while keeping that route fixed. Do not change the model at the same time as the framework.
  2. Use synthetic history. Create a user turn such as “The test label is cedar,” an assistant turn “I recorded cedar,” and a follow-up user turn “What label did I provide?” Pass those turns through your application’s conversation adapter using the input shape supported by that CrewAI version. These are fixture contents, not a copy-paste API signature.
  3. Observe the handoff. In a test-only transport hook immediately before the request goes to CometAPI, inspect the roles and ordering of those three turns. Allow framework-added instructions, but require the fixture’s user/assistant/user attribution to survive. Keep only sanitized role/order assertions and version/route metadata in the test report; do not log keys, headers or real conversation text.
  4. Separate serialization from behavior. A correct role sequence is a structural pass. A plausible answer about “cedar” alone is not: a model could infer it even from incorrectly attributed history. After the structural check, assess response behavior separately on the intended CometAPI route.
  5. Check fallback routes deliberately. Repeat the same fixture for each model ID you actually intend to permit through CometAPI. Keep automatic fallback off during diagnosis so a different model’s answer cannot hide the original route’s result. The guide’s common endpoint is not a promise that every model interprets the conversation identically.

When to stop

If an original turn changes role or disappears, stop the rollout and isolate the conversation adapter and CrewAI serialization path. Do not treat that mismatch as a transient failure to retry, or “fix” it by switching model IDs. If outbound roles are correct but answers differ, preserve that distinction and investigate route-specific behavior rather than declaring the framework check failed.

Neither source establishes that CometAPI routing caused role loss, and this procedure does not prove what a downstream model received internally. It gives you a narrower, inspectable decision: whether the conversation your application intends to send survives the CrewAI-to-CometAPI request boundary before you enable the new framework version or fallback route.