Repository navigation
[codex] build OpenClaw SDK cookbook - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05b6b95f50
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "exports": { | ||
| ".": { | ||
| "types": "./src/index.ts", | ||
| "default": "./src/index.ts" |
There was a problem hiding this comment.
Ship a JavaScript entrypoint for the SDK shim
The shim package exports ./src/index.ts as its runtime default, so built examples that run with plain node (for example sdk/quickstart and sdk/coding-agent-cli start scripts) import raw TypeScript at runtime. In Node 22’s strip-types mode, this file currently contains unsupported syntax (parameter properties), which causes runtime failures instead of starting the example; exporting compiled JS (or compiling the shim before use) is required for these start flows to work reliably.
Useful? React with 👍 / 👎.
| calls: RequestCall[]; | ||
| }> { | ||
| const transport = new CookbookTransport(); | ||
| const oc = new OpenClaw({ transport }); |
There was a problem hiding this comment.
Close the OpenClaw client in custom transport recipe
This recipe creates an OpenClaw client with a transport and returns without calling oc.close(). If a real custom transport allocates sockets, streams, or timers, those resources are never released, which can leak handles and keep processes alive in integration tests or CLI usage. Wrap the run lifecycle in try/finally and close the client on exit, as done in the other recipes.
Useful? React with 👍 / 👎.
No description provided.