18 Commits

Author SHA1 Message Date
Alberto Schiabel 41be258076 fix(examples): fail tool_router_mcp when COMPOSIO_API_KEY is unset (#4222)
Spotted while fixing the provider-dependency failures in #4221.

## Problem

`python/examples/tool_router/tool_router_mcp.py` guarded a missing
credential like this:

```python
api_key = os.environ.get("COMPOSIO_API_KEY")
if not api_key:
    print("Error: COMPOSIO_API_KEY environment variable not set")
    print("Please set it using: export COMPOSIO_API_KEY='your_api_key'")
    return
```

`return` exits the coroutine normally, so `asyncio.run(main())`
completes and the process exits **0**. The live-examples harness scores
entries by exit code, so a run that did nothing at all was recorded
**green** — the worst kind of failure for a canary, since it reports
success while testing nothing.

## Fix

Raise instead, using the `require_env` helper the sibling examples
already use (`examples/tool_router/preload.py`):

```python
def require_env(name: str) -> str:
    value = os.environ.get(name)
    if not value:
        raise RuntimeError(f"Set {name} before running this example.")
    return value
```

## Verification

Replaying the harness's own invocation with the variable unset:

```
$ unset COMPOSIO_API_KEY
$ uv run --project python --with 'openai-agents>=0.19' \
    --with ./python/providers/openai_agents --with ./python \
    python python/examples/tool_router/tool_router_mcp.py

before: exit=0        # silently "passes"
after:  exit=1        # RuntimeError: Set COMPOSIO_API_KEY before running this example.
```

`ruff check`, `ruff format --check`, and `nox -s chk_examples` all pass.

## Scope

I checked whether other examples share the pattern.
`examples/tool_router/authorize.py` prints the same message, but calls
`exit(1)` at module level rather than returning from a coroutine, so it
already fails correctly — left alone. This was the only instance.
2026-08-25 00:28:30 +02:00
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 bccd32beae Refine ToolRouter preload docs and constants 2026-05-07 16:10:38 +05:30
Abir Taheer df857bfdfe fix: remove extraneous f-string prefixes in Python example
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-07 03:17:29 -07:00
Abir Taheer a9977af2c1 docs: add session.update() examples for TypeScript and Python
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-07 02:28:10 -07:00
Dhawal Upadhyay 98569bcf6f Respect base URL in Python ToolRouter examples 2026-05-06 18:52:18 +05:30
Dhawal Upadhyay eae717ac20 Clean up inline custom tools payload typing 2026-05-06 18:44:40 +05:30
Dhawal Upadhyay 8254999914 Address ToolRouter example review comments 2026-05-06 18:28:44 +05:30
Dhawal Upadhyay 9ad5705661 Add Tool Router preload examples 2026-05-06 16:35:33 +05:30
Musthaq Ahamad 40a7dae840 Experimental release for files in tool-router (#2876) 2026-03-13 16:32:13 +05:30
Musthaq Ahamad 2bccee8d55 feat(python): add file upload/download support and ToolRouterSession refactor (#2865) 2026-03-10 13:15:48 +05:30
jkomyno ee738a6b93 fix(py): cursorbot 2026-02-06 02:08:50 +04:00
Musthaq Ahamad eeb296b9a8 Fix claude agent sdk (#2307) 2025-12-27 14:25:26 +05:30
Musthaq Ahamad a550aeb289 Chore: Move tool router out of experimental and remove depreacted mcp (#2267) 2025-12-13 12:58:09 +05:30
Musthaq Ahamad f97d191cc6 Add native tool execution support for tool router in python (#2266) 2025-12-12 22:17:10 +05:30
Musthaq Ahamad f0e67c435c Fix tool router types from latest API changes (#2227)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-05 15:50:46 +05:30
Musthaq Ahamad 9e002c5ca3 Tool Router API Integration (#2214)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-12-04 15:31:09 +05:30