internet-court/internet-court-skill / vendored/openserv/openserv-client
openserv-client
VerifiedComplete guide to using @openserv-labs/client for managing agents, workflows, triggers, and tasks on the OpenServ Platform. Covers provisioning, authentication, x402 payments, ERC-8004 on-chain identity, and the full Platform API. IMPORTANT - Always read the companion skill openserv-agent-sdk alongside this skill, as both packages are required to build any agent. Read reference.md for the full API reference.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 346 B |
| SKILL.md | skill md | 17.1 KB |
| examples/agent.ts | script | 1.6 KB |
| examples/cleanup.ts | script | 2.8 KB |
| examples/create-agent.ts | script | 2.8 KB |
| examples/env.example | other | 483 B |
| reference.md | markdown | 18.1 KB |
| troubleshooting.md | markdown | 3.3 KB |
troubleshooting.md
View on GitHub# OpenServ Client Troubleshooting
Common issues and solutions.
---
## Task stuck in "to-do"
1. Check workflow is running: `await client.workflows.setRunning({ id })`
2. Check trigger is activated: `await client.triggers.activate({ workflowId, id })`
3. Verify trigger-to-task edge exists in workflow graph
---
## Triggers not created via sync
The sync endpoint requires actual **integration connection IDs** (UUIDs), not just integration identifiers. The `workflows.sync()` method handles this automatically by:
1. Resolving the trigger `type` (e.g., `'webhook'`) to an integration identifier (e.g., `'webhook-trigger'`)
2. Calling `client.integrations.getOrCreateConnection()` to get the actual UUID
3. Using that UUID in the sync payload
If building triggers manually, always use `getOrCreateConnection()`:
```typescript
const connectionId = await client.integrations.getOrCreateConnection('webhook-trigger')
await client.triggers.create({
workflowId,
name: 'My Trigger',
integrationConnectionId: connectionId, // UUID required
props: { ... }
})
```
---
## Adding agents to an existing workspace
When you `sync()` or re-provision a workflow with tasks assigned to agents not yet in the workspace, the client library automatically adds them. You can also add agents explicitly:
```typescript
// Automatic: sync() adds missing agents before syncing
await workflow.sync({
tasks: [
{ name: 'task1', agentId: existingAgent, description: '...' },
{ name: 'task2', agentId: newAgent, description: '...' } // added automatically
]
})
// Explicit: add an agent without assigning a task
await workflow.addAgent(456)
// or
await client.workflows.addAgent({ id: workflowId, agentId: 456 })
```
---
## Edges not created
Edges link triggers to tasks in the workflow graph. They can be:
1. **Auto-generated**: When you call `sync()` with triggers and tasks but no edges, each trigger connects to the first task
2. **Explicit**: Provide the `edges` array to define custom connections
3. **Created via provision()**: The `provision()` function automatically creates nodes and edges
To verify edges exist:
```typescript
const workflow = await client.workflows.get({ id })
console.log('Edges:', workflow.edges)
// Should show: [{ id, source: 'trigger-...', target: 'task-...', ... }]
```
---
## Paywall shows wrong fields
Ensure `input` schema is defined in trigger config:
```typescript
triggers.x402({
price: '0.01',
input: {
myField: { type: 'string', title: 'My Label' }
}
})
```
---
## Authentication errors
- Verify `WALLET_PRIVATE_KEY` or `OPENSERV_USER_API_KEY` is set
- For wallet auth, ensure key starts with `0x`
- If `WALLET_PRIVATE_KEY` is empty after `provision()`, reload `.env` with `dotenv.config({ override: true })` — see below
---
## ERC-8004: "insufficient funds for transfer"
The wallet has no ETH on Base mainnet for gas. Fund the wallet address (logged during provisioning) with a small amount of ETH on Base. Always wrap `registerOnChain` in try/catch so the agent can still start.
---
## ERC-8004: 401 on first run
`WALLET_PRIVATE_KEY` is empty because `provision()` writes it to `.env` after the initial `dotenv` load. Use `dotenv` programmatically and reload after provision:
```typescript
import dotenv from 'dotenv'
dotenv.config()
// ... provision() ...
dotenv.config({ override: true })
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |