[codex] add async test docs - #44
Merged
Merged
Conversation
bobzhang
force-pushed
the
codex/add-async-test-docs
branch
from
April 30, 2026 08:13
815d661 to
be25f2b
Compare
bobzhang
force-pushed
the
codex/add-async-test-docs
branch
from
April 30, 2026 08:27
be25f2b to
1a7c088
Compare
The async test "sleep completes" snippet calls @async.sleep, but the SKILL.md doc-test environment loads only moonbitlang/core/* — it has no moonbitlang/async dep — so the block fails [4037] "Cannot use async test: package moonbitlang/async is not imported." Switching to mbt nocheck keeps the snippet visible for documentation while skipping compilation, matching the surrounding note that the user must import moonbitlang/async themselves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
||
| Asynchronous programming uses compiler support plus the `moonbitlang/async` runtime. The runtime supports the native backend best, has limited JavaScript support for IO-independent APIs, and does not support WebAssembly yet. For async IO examples, prefer native. Use `moon add moonbitlang/async@<version>` and `moon ide doc "@async"` to explore the API. | ||
|
|
||
| User-facing subpackages: `@async` (core: tasks, timers, cancellation), `@async/aqueue`, `@async/fs, `@async/stdio`, `@async/websocket`, ..etc. |
Contributor
There was a problem hiding this comment.
🟡 Missing closing backtick breaks markdown formatting for @async/fs package name
On line 643, the backtick after @async/fs is misplaced — the text reads `@async/fs, `@async/stdio` instead of `@async/fs`, `@async/stdio`. In markdown, the backtick pairs as `@async/fs, ` (code span including the comma and space), then @async/stdio renders as plain text, and the remaining backticks cascade into further broken formatting. Since this file is the primary agent guide, the garbled rendering could confuse AI agents about valid package names.
Suggested change
| User-facing subpackages: `@async` (core: tasks, timers, cancellation), `@async/aqueue`, `@async/fs, `@async/stdio`, `@async/websocket`, ..etc. | |
| User-facing subpackages: `@async` (core: tasks, timers, cancellation), `@async/aqueue`, `@async/fs`, `@async/stdio`, `@async/websocket`, ..etc. |
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds MoonBit async testing guidance to the agent skill documentation.
What changed
Async testssubsection coveringasync testsyntax and test-mode imports.await.Validation
git diff --checkgit diff --check HEAD~1..HEADasync fn mainandasync testsnippets in a temporary MoonBit module withmoonbitlang/async@0.18.1using:moon checkmoon test -vmoon run cmd/mainToolchain:
moon 0.1.20260429.