# Nexu E2e Test

Use when verifying OpenClaw gateway fixes end-to-end, testing skill loading after...

- Repository: https://github.com/nexu-io/nexu (3280 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-04-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add nexu-io/nexu --skill nexu-e2e-test -g -a claude-code -y`
Codex: `npx skills add nexu-io/nexu --skill nexu-e2e-test -g -a codex -y`
Cursor: `npx skills add nexu-io/nexu --skill nexu-e2e-test -g -a cursor -y`
Gemini CLI: `npx skills add nexu-io/nexu --skill nexu-e2e-test -g -a gemini-cli -y`

## Description

Use when verifying OpenClaw gateway fixes end-to-end, testing skill loading after restart, or running integration tests against the local Nexu+OpenClaw stack. Triggers on "e2e test", "verify fix", "test gateway", "test skills loading".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Nexu E2E Testing, OpenClaw Gateway

Run end-to-end verification of the Nexu → OpenClaw gateway stack locally.

## Known Constraints

The OpenClaw gateway has architectural constraints that block naive E2E approaches. **Read this before attempting any gateway testing.**

| Approach | Blocker | Status |
|----------|---------|--------|
| HTTP `POST /v1/chat/completions` | Endpoint exists (`openai-http.ts`) but uses `agentCommand()`, same embedded agent path as CLI, bypasses session store | Works for smoke tests (same as CLI) |
| HTTP `POST /v1/responses` | Endpoint exists (`openresponses-http.ts`) but also uses `agentCommand()` | Works for smoke tests (same as CLI) |
| WebSocket `chat.send` | Requires device pairing for `operator.write` scope, `clearUnboundScopes()` in `message-handler.ts:483-488` clears all self-declared scopes without device identity | Dead end without device keys |
| `openclaw agent --session-id` | Uses embedded agent path (`sessionKey=unknown`), bypasses session store cache | Works for smoke tests, NOT for session-store bugs |
| Direct module import from dist | Rollup bundles with hashed filenames, can't import individual modules | Dead end |
| `tsx` from `/tmp` | Module resolution fails for imports outside project root | Dead end |
| Vitest in-project `.test.ts` | Full module resolution, mocking, TypeScript support | **Primary method** |

**Key insight:** All HTTP and CLI approaches use the embedded agent path via `agentCommand()` (imported from `commands/agent.js`). Only messages arriving through connected channels (Slack/Discord) go through `dispatchInboundMessage()` → auto-reply pipeline → `ensureSkillSnapshot()`, which is the code path that uses the session store.

## Viable Test Methods

### 1. Vitest Unit/Integration Tests (Primary)

The rest: https://github.com/nexu-io/nexu/blob/HEAD/skills/localdev/nexu-e2e-test/SKILL.md
