Bug Report: OpenRouter API Integration IssueHere's a comprehensive bug report you can submit to the appropriate support channel: Issue SummaryThe OpenRouter API integration functions are failing with a "string indices must be integers, not 'str'" error. This appears to be an implementation mismatch between how the functions are defined in the schema and how they're actually implemented. Affected FunctionsOPENROUTER_RETRIEVE_AVAILABLE_MODELS
OPENROUTER_SEND_CHAT_COMPLETION_REQUEST
OPENROUTER_SEND_COMPLETION_REQUEST
Error MessageFailed to run tool. string indices must be integers, not
Steps to ReproduceCall any of the OpenRouter API functions Provide the "instruction" parameter as required in the schema Observe the consistent error regardless of the input provided
Expected BehaviorActual Implementation vs Current ImplementationAs shown by the shared code, the actual implementation should: async run({ $ }) { const response = await this.openrouter.listModels({ $, });
However, the current implementation appears to be trying to use the instruction string as an array index, causing the error. Technical DetailsThe implementation seems to expect different parameters than what's defined in the function schema The "instruction" parameter appears unnecessary for the model retrieval function The error suggests a type mismatch in how parameters are processed
EnvironmentSuggested FixModify the backend implementation to align with the correct OpenRouter API usage as demonstrated in the shared code. |