Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | # Tool Router Session Update E2E Test |
| 2 | |
| 3 | End-to-end regression test for `session.update()` with default options. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | - Docker (for running tests in containers) |
| 8 | - `COMPOSIO_API_KEY` environment variable (any Composio project works) |
| 9 | |
| 10 | ## Running |
| 11 | |
| 12 | ```bash |
| 13 | # From repo root |
| 14 | COMPOSIO_API_KEY=your_key pnpm test:e2e:node --filter=@e2e-tests/node-tool-router-session-update |
| 15 | |
| 16 | # Or from this directory |
| 17 | COMPOSIO_API_KEY=your_key bun test e2e.test.ts |
| 18 | ``` |
| 19 | |
| 20 | ## What it tests |
| 21 | |
| 22 | `@composio/core` 0.20.0 sent `expected_config_version` on every `session.update()` call. The API rejected that field with a 400, so no default update could succeed, and mocked unit tests could not see it. |
| 23 | |
| 24 | 1. **Create** – Create a session with `toolkits: ['github', 'gmail']` |
| 25 | 2. **Update** – Call `session.update({ toolkits: ['github'] })` with default options and assert the returned toolkits and a higher `configVersion` |
| 26 | 3. **Persisted** – Re-read the session with `sessions.use()` and assert the server kept the change |
| 27 | 4. **Cleanup** – Delete the session |