9 Commits

Author SHA1 Message Date
Alberto Schiabel 8086ef02cb fix(examples): align Python and TypeScript examples with current backend (#4107)
## Summary

- Repairs runnable TypeScript and Python examples for current backend
requirements, including authenticated MCP endpoints, current transports,
valid tool identifiers, provider limits, and resource uniqueness.
- Replaces placeholder resource IDs with explicit `COMPOSIO_EXAMPLES_*`
configuration and makes failed examples exit loudly.
- Adds `scripts/examples-provision.mjs` as an idempotent provisioning
check for a disposable examples project.

## Scope

- This PR no longer changes the Python SDK runtime or generated-client
dependency.
- Python remains pinned to the published `composio-client==1.43.0` in
`pyproject.toml`, `setup.py`, and `uv.lock`.
- The owned 2.x client integration is deferred until that client
completes its release guarantees and is explicitly published.
- The scheduled live workflow and manifest remain deferred until their
runner is tracked.

## Verification

- `make chk`
- `make tst` (`927 passed, 33 skipped`)
- Hosted checks rerun against commit `12691aca7`.
2026-08-11 19:45:58 +02:00
Dhawal Upadhyay ffb7539bb5 Fix ToolRouter example staging runs 2026-05-07 16:42:08 +05:30
Dhawal Upadhyay d21e7e76f4 fix(python): address PR review comments
- Fix async validation bypass for single-param tools: check
  asyncio.iscoroutinefunction(fn) before wrapping in _infer_tool
- Remove inline # slug/name comments from example (jkomyno review)
- Add test for async single-param rejection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay 81067dad81 style(python): clean up example file spacing
Single blank lines between definitions, noqa for E302/E303
since this is an example file not a library module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay d1abe5df56 refactor(python): merge examples into one file, fix mypy shadowing
- Remove custom_tools_v2.py, keep single custom_tools_agent_test.py
- Add override examples (slug, name, description) with inline comments
- Add toolkit tool with overridden name
- Fix mypy: rename entry -> local_entry to avoid shadowing
  CustomToolsMapEntry from earlier loop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay 4bc4476ba8 docs(python): update e2e examples to use decorator API
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay 60328a01dd test(python): add Gmail proxy + mixed all-paths to agent e2e test
6 scenarios: standalone, toolkit, mixed local, remote, Gmail proxy
(CREATE_DRAFT via ctx.proxy_execute), mixed all paths in one turn.
manage_connections=True, user_id=default throughout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay e208f7db45 test(python): expand agent e2e test to cover all custom tool paths
5 test scenarios with real LLM agent loop (OpenAI Agents SDK):
- Standalone custom tool (GET_USER, local)
- Custom toolkit tool (SET_ROLE, local, ROLE_MANAGER namespace)
- Mixed local tools (GET_USER + SET_ROLE in single session)
- Remote Composio tool (weathermap, backend execution)
- Mixed local + remote (GET_USER local + weathermap remote)

All 5/5 pass end-to-end.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00
Dhawal Upadhyay 4940181bb3 test(python): add LLM agent e2e test for custom tools
Full agent loop using OpenAI Agents SDK with custom tools routing.
Verifies COMPOSIO_SEARCH_TOOLS discovers custom tools and
COMPOSIO_MULTI_EXECUTE_TOOL routes them in-process.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:11:03 -07:00