Skip to content

fix: исправить auth routing Composio Direct#203

Merged
xlabtg merged 2 commits into
xlabtg:mainfrom
konard:issue-202-ddc074941761
Jun 26, 2026
Merged

fix: исправить auth routing Composio Direct#203
xlabtg merged 2 commits into
xlabtg:mainfrom
konard:issue-202-ddc074941761

Conversation

@konard

@konard konard commented Jun 26, 2026

Copy link
Copy Markdown

Что изменено

  • В auto режиме composio-direct теперь распознаёт известные префиксы ключей: ak_ сразу идёт как x-api-key, uak_ сразу идёт как x-user-api-key.
  • Организационные ключи oak_ больше не отправляются на обычные tool/auth/connection endpoints: плагин возвращает локальную диагностическую ошибку с рекомендацией использовать project или user key.
  • Для старых/неизвестных форматов ключей сохранён legacy fallback x-api-key -> x-user-api-key.
  • Project-only endpoints, включая Files/Webhooks, локально отклоняют user/org ключи до HTTP-запроса.
  • Обновлены README/GUIDE и версия composio-direct до 1.9.5.

Причина

По OpenAPI Composio v3.1 (https://backend.composio.dev/api/v3.1/openapi.json) обычные endpoints инструментов используют project/user auth (x-api-key и x-user-api-key), а x-org-api-key относится к /org/* organization-management endpoints. Предыдущий universal fallback на x-org-api-key мог превращать проблему выбора ключа в удалённый 403 и не помогал выполнить tools endpoints.

Как воспроизведено

Добавлены regression tests, которые до исправления падали:

  • uak_... в auto режиме не должен сначала отправляться как x-api-key.
  • oak_... не должен отправляться на /tools/execute/... и должен давать понятную локальную ошибку.
  • project-only Files endpoints не должны отправлять user key в HTTP-запрос.

Проверка

Перед push выполнено:

  • 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
  • node scripts/build-sdk.mjs
  • npm run validate
  • npm run lint
  • npm run typecheck
  • npm test

Для локального соответствия CI перед общими проверками были установлены root dependencies и plugin dependencies по тому же шаблону, что в .github/workflows/ci.yml.

Fixes #202

konard added 2 commits June 26, 2026 17:35
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: xlabtg#202
@konard konard changed the title [WIP] The composio direct plugin does not work fix: исправить auth routing Composio Direct Jun 26, 2026
@konard konard marked this pull request as ready for review June 26, 2026 17:52
@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Author

Working session summary

Готово: PR #203 обновлён и переведён из draft в ready for review.

PR: #203
Коммит: 3a7f8dd fix: уточнить auth routing composio-direct

Что сделано:

  • uak_... в auto режиме теперь сразу отправляется как x-user-api-key.
  • oak_... больше не отправляется на обычные Composio tool/auth/connection endpoints, вместо этого возвращается понятная локальная ошибка.
  • Для unknown legacy key оставлен fallback x-api-key -> x-user-api-key.
  • Project-only endpoints локально отклоняют user/org keys.
  • Добавлены regression tests, обновлены README/GUIDE и версия composio-direct до 1.9.5.
  • Удалён служебный .gitkeep.

Проверки:

  • Локально прошли npm run validate, npm run lint, npm run typecheck, npm test, node scripts/build-sdk.mjs и targeted composio-direct tests.
  • GitHub checks на SHA 3a7f8dd... все зелёные: CI, Plugin Dependencies, CodeQL, Deploy.

Источник для auth-схем Composio: https://backend.composio.dev/api/v3.1/openapi.json


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $11.548060

📊 Context and tokens usage:

  • 331.8K / 200K (166%) input tokens, 36.9K / 128K (29%) output tokens

Total: (331.8K + 6.6M cached) input tokens, 36.9K output tokens, $11.548060 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Thinking level: max (~31999 tokens)
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Gist (4320KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jun 26, 2026

Copy link
Copy Markdown
Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@xlabtg xlabtg merged commit 5b7b1f2 into xlabtg:main Jun 26, 2026
9 checks passed
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.

The composio direct plugin does not work

2 participants