Skip to content

Исправить обработку 403 в composio-direct#197

Merged
xlabtg merged 3 commits into
xlabtg:mainfrom
konard:issue-196-bce765d70d61
Jun 21, 2026
Merged

Исправить обработку 403 в composio-direct#197
xlabtg merged 3 commits into
xlabtg:mainfrom
konard:issue-196-bce765d70d61

Conversation

@konard

@konard konard commented Jun 21, 2026

Copy link
Copy Markdown

Что сделано

  • Разделена авторизация внешнего сервиса (auth_required) и ошибки доступа Composio API key (401/403).
  • 403 Forbidden больше не превращается в auth_required и не отправляет агента в бесполезный composio_auth_link цикл.
  • Для 401/403 возвращается явная диагностика по composio_api_key: project API key, permissions и Composio IP allowlist.
  • Та же диагностика применяется в search/common response handling, single execute и multi execute.
  • Добавлен регрессионный тест на 403 permission failure.
  • Обновлены README/GUIDE и версия composio-direct до 1.9.2.

Как воспроизвести

До исправления ответ Composio вида HTTP 403 / HTTP_Forbidden с текстом про permissions попадал в isAuthError() и возвращался как:

{ "success": false, "error": "auth_required", "auth": { ... } }

Из-за этого агент пытался повторно подключать внешний сервис, хотя проблема была в доступе Composio API key. Новый тест does not treat Composio API key permission failures as toolkit auth_required фиксирует этот сценарий.

Проверка

  • node --test plugins/composio-direct/tests/index.test.js
  • node --test plugins/composio-direct/test/unit/composio-direct.test.js
  • node --test plugins/composio-direct/test/integration/composio-api.test.js
  • npm run validate — 0 errors, 1 существующий warning по casino
  • npm run lint — 0 errors, существующие warnings вне этой правки
  • npm run typecheck
  • npm test — 490 passed
  • node scripts/build-sdk.mjs

Fixes #196

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: xlabtg#196
@konard

konard commented Jun 21, 2026

Copy link
Copy Markdown
Author

🚨 Solution Draft Failed

The automated solution draft encountered an error:

CODEX execution failed with Cannot read properties of null (reading 'type')

🤖 Models used:

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

📎 Failure log uploaded as Gist (3342KB)


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

@konard

konard commented Jun 21, 2026

Copy link
Copy Markdown
Author

🤖 AI Work Session Started

Starting automated work session at 2026-06-21T19:41:00.670Z

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.

@konard konard changed the title [WIP] The composio direct plugin does not work Исправить обработку 403 в composio-direct Jun 21, 2026
@konard konard marked this pull request as ready for review June 21, 2026 19:52
@konard

konard commented Jun 21, 2026

Copy link
Copy Markdown
Author

Working session summary

Готово: PR #197 обновлён и переведён в ready for review: #197

Исправил корень проблемы в index.js: 401/403 от Composio теперь считаются ошибками composio_api_key/permissions, а не auth_required внешнего сервиса. Добавил понятную диагностику по project API key, permissions и IP allowlist. Регрессия покрыта тестом в index.test.js, документация обновлена в GUIDE.md, версия composio-direct поднята до 1.9.2.

Проверки прошли локально: npm run validate, npm run lint, npm run typecheck, npm test, node scripts/build-sdk.mjs, плюс ciblевые composio-direct тесты. GitHub Actions на SHA f260149c9a66450e47b3e75397188d471d02691c тоже зелёные: CI, Plugin Dependencies, CodeQL, Deploy to Vercel. Рабочее дерево чистое, PR merge state CLEAN.

Источник по API Composio, который сверял: https://docs.composio.dev/reference/api-reference/tools/postToolsExecuteByToolSlug


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

@konard

konard commented Jun 21, 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: $10.301708

📊 Context and tokens usage:

  • 207.7K / 200K (104%) input tokens, 30.1K / 128K (24%) output tokens

Total: (207.7K + 6.9M cached) input tokens, 30.1K output tokens, $10.301708 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 Repository (30718KB)


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

@konard

konard commented Jun 21, 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 915dee5 into xlabtg:main Jun 21, 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