Починить composio-direct для актуального Composio API#201
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#200
Working session summaryГотово: PR 201 обновлён и переведён в ready for review: #201 Сделано:
Проверка:
Рабочая копия чистая, This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (290.4K + 3.9M cached) input tokens, 27.8K output tokens, $8.017999 cost 🤖 Models used:
📎 Log file uploaded as Gist (2883KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit b492830.
|
Did you take that into account too https://docs.composio.dev/docs/providers/custom-providers/typescript |
|
🤖 AI Work Session Started Starting automated work session at 2026-06-26T17:10:27.045Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
|
Да, учёл это тоже. Проверил актуальный документ Composio про TypeScript custom providers: https://docs.composio.dev/docs/providers/custom-providers/typescript Вывод для этого PR:
Я добавил это в |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (340.6K + 2.6M cached) input tokens, 25.1K output tokens, $7.102886 cost 🤖 Models used:
📎 Log file uploaded as Gist (4541KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Fixes #200
Причина
Предыдущие исправления научили
composio-directпереключаться междуx-api-keyиx-user-api-key, но официальная OpenAPI-схема Composio v3.1 также описываетx-org-api-key. Поэтому ключи с правами уровня организации могли продолжать получать 401/403, даже если в Composio у них были полные права.Дополнительно проверен актуальный TypeScript custom provider flow Composio: для Teleton это не прямой импорт SDK provider-класса, а Teleton-specific adapter поверх статически зарегистрированных plugin tools.
Источники проверки:
Решение
api_key_auth_scheme: orgи алиасовorganization/x-org-api-key.autoдля endpoint-ов, которые не являются project-only, теперь используются попыткиx-api-key->x-user-api-key->x-org-api-key.1.9.4.composio-directсоответствует custom provider model: discovery/schema tools выполняют transform step, execute/multi_execute выполняют execution step, а auth/connection/toolkit/file/trigger/webhook/meta tools являются provider helpers.inputParameters/outputParameters), чтобы закрепить Teleton wrapper contract для provider-like discovery.Как воспроизвести
Минимальный сценарий покрыт тестом: вызов
composio_execute_toolполучает 403 наx-api-key, 401 наx-user-api-key, затем успешно выполняется черезx-org-api-key. До изменения выполнение останавливалось после project/user попыток.Для замечания про custom providers добавлен защитный тест: Composio tool object в SDK-style форме преобразуется в Teleton-visible result с
tool_slug, схемами иexecute_with, а не в прямой SDK provider object.Проверка
node --test plugins/composio-direct/tests/guide.test.js plugins/composio-direct/tests/index.test.js plugins/composio-direct/test/unit/composio-direct.test.js plugins/composio-direct/test/integration/composio-api.test.js— passed, 66/66npm run validate— passed, 0 errors, 1 существующее предупреждениеcasino: tools array is emptynpm run lint— passed, 0 errors, существующие warnings вне этого измененияnpm run typecheck— passednpm test— passed, 497/497