Skip to content

[codex] add async test docs - #44

Merged
bobzhang merged 7 commits into
mainfrom
codex/add-async-test-docs
Apr 30, 2026
Merged

[codex] add async test docs#44
bobzhang merged 7 commits into
mainfrom
codex/add-async-test-docs

Conversation

@bobzhang

@bobzhang bobzhang commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds MoonBit async testing guidance to the agent skill documentation.

What changed

  • Adds an Async tests subsection covering async test syntax and test-mode imports.
  • Documents that async calls do not use await.
  • Notes that async tests run in parallel and should isolate shared resources.
  • Clarifies native-target validation guidance for async tests.
  • Corrects Async IO backend wording to distinguish native support from limited JavaScript support and unsupported WebAssembly.

Validation

  • git diff --check
  • git diff --check HEAD~1..HEAD
  • Verified the async fn main and async test snippets in a temporary MoonBit module with moonbitlang/async@0.18.1 using:
    • moon check
    • moon test -v
    • moon run cmd/main

Toolchain: moon 0.1.20260429.


Open in Devin Review

@bobzhang
bobzhang force-pushed the codex/add-async-test-docs branch from 815d661 to be25f2b Compare April 30, 2026 08:13
devin-ai-integration[bot]

This comment was marked as resolved.

@bobzhang
bobzhang force-pushed the codex/add-async-test-docs branch from be25f2b to 1a7c088 Compare April 30, 2026 08:27
bobzhang and others added 2 commits April 30, 2026 16:32
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>
@bobzhang
bobzhang merged commit a5c40ac into main Apr 30, 2026
1 of 2 checks passed

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review


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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant