GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(mcpx): WASM tool-source spike — wazero host, capability test (#1970) by dezren39 · Pull Request #2002 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Oct 28, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Spike for #1970 (queue task 2907): Approach B — a core-WASM .wasm module as an mcpx tool source, hosted by wazero.

What this adds

  • pkgs/mcpx/internal/wasmtools: a standalone wazero host for a core-WASM tool source. It instantiates no WASI at all, so a guest gets no filesystem, network, clock, or environment by default; the only imports that can exist are host grants (today: mcpx.log). Any ungranted import — WASI included — fails instantiation: deny-by-default is a property of the loader.
  • Guest ABI mirrors mcpclient.Client (ListTools / CallTool shapes in internal/mcpclient/client.go), shaped so a component-model ABI can replace it underneath later (Approach C).
  • Test guests (Zig sources + prebuilt .wasm in testdata/): echo (lists/calls one tool, logs via the granted import) and greedy (imports mcpx.read_file, which the host never offers).

Interface gap (per the spike brief)

There is no registration point yet for a new tool-source kind: upstreams are concrete transports in internal/mcpclient and internal/adapter, and the tool-source interface is still tracked by #1885. So this package is deliberately a standalone spike, not a parallel/fifth composition path. Wiring it in waits for #1885's interface; the ABI above is designed to sit behind it unchanged.

Capability test (acceptance)

  • TestListAndCallWithGrantedLog — granted log import works; tool list + call round-trip.
  • TestSameModuleWithoutGrantIsDenied — same module without the grant fails to instantiate.
  • TestUngrantedCapabilityImportIsDenied — greedy.wasm is denied even with every grantable capability granted; the error names the missing read_file import.

Verified on the laptop worktree: go test -count=1 ./internal/wasmtools/ — PASS.

Constraints

  • Pure Go: no cgo introduced (wazero only, already in-tree for embeddings).
  • Existing JS-runtime script behaviour and process/HTTP tool sources unchanged — this adds one new internal package only.

Gating research answer

Posted on #1970: wazero does not host Component Model components at acceptable maturity today (component support is still under active development upstream); the mature component host is wasmtime, whose Go bindings require cgo — which would forfeit the pure-Go premise. Recommendation: proceed with B on core WASM now; defer C until wazero component hosting matures or a pure-Go lowering path lands.

Refs #1970, #1885


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse (fleet worker)
feat(mcpx): WASM tool-source spike — wazero host, capability test (#1970
019ee02
)
@dezren39
dezren39 requested a review from a team as a code owner October 28, 2026 23:43
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0207bd8a-5b2d-4be9-9b89-db14fc431ca0
Commits

Reviewing files that changed from the base of the PR and between 77918e0 and 019ee02.

Files ignored due to path filters: 2
  • pkgs/mcpx/internal/wasmtools/testdata/echo.wasm is excluded by !**/*.wasm
  • pkgs/mcpx/internal/wasmtools/testdata/greedy.wasm is excluded by !**/*.wasm
Files selected for processing: 4
  • pkgs/mcpx/internal/wasmtools/testdata/guest/echo.zig
  • pkgs/mcpx/internal/wasmtools/testdata/guest/greedy.zig
  • pkgs/mcpx/internal/wasmtools/wasmtools.go
  • pkgs/mcpx/internal/wasmtools/wasmtools_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T23:46:56.314809Z 019ee02 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Oct 28, 2026
mcpx: WebAssembly as a sandboxed tool source — wazero, and the component model as the tool boundary #1970
Closed
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Oct 28, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 019ee02b90

ℹ️ 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/wasmtools/wasmtools.go
Comment on lines +98 to +102
for _, fn := range []string{inputPtrFn, outputPtrFn, listFn, callFn} {
if mod.ExportedFunction(fn) == nil {
rt.Close(ctx)
return nil, fmt.Errorf("wasmtools: guest does not export %s", fn)
}

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Validate guest memory and function signatures during loading

If a guest exports all four required names but omits linear memory or uses an incompatible result signature, Load succeeds even though subsequent calls can panic the Go host. For example, a valid WASM module whose mcpx_list_tools returns no values reaches res[0] in ListTools, while a module without memory reaches a nil memory dereference in readOutput or CallTool. Validate the required memory and function parameter/result types before returning the source so malformed guests produce load errors rather than host panics.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/mcpx/internal/wasmtools/wasmtools.go
// grant set — WASI included — makes Load fail.
func Load(ctx context.Context, src []byte, grants ...string) (*Source, error) {
s := &Source{}
rt := wazero.NewRuntime(ctx)

@chatgpt-codex-connector chatgpt-codex-connector Bot Oct 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Enable context cancellation for guest execution

If a guest tool enters an infinite loop, canceling or timing out the context passed to ListTools or CallTool will not interrupt it, leaving the caller goroutine executing indefinitely. The wazero v1.9.0 runtime configuration documentation explicitly states that execution-termination checks are disabled by default, which is the configuration selected by NewRuntime here. Construct the runtime with WithCloseOnContextDone(true) so callers can actually bound guest execution through the contexts these methods accept.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39

dezren39 commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

  • Agent: queue worker (repo-worker-code), lane C
  • Session / ID: queue task 2907
  • Found via: queue claim (resume)
  • Task: WASM spike done — PR feat(mcpx): WASM tool-source spike — wazero host, capability test (#1970) #2002 opened, gating research answer posted on this issue, laptop tests pass; parked waiting on CI
  • Expectation: resume: check CI on PR feat(mcpx): WASM tool-source spike — wazero host, capability test (#1970) #2002, merge if green per standing criteria, then complete task 2907
  • Links: PR feat(mcpx): WASM tool-source spike — wazero host, capability test (#1970) #2002 · branch queue/2907-1970-wasm-spike
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned dezren39 Oct 29, 2026
@dezren39
dezren39 merged commit ab39b8d into main Oct 29, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the queue/2907-1970-wasm-spike branch October 29, 2026 01:08
This was referenced Oct 29, 2026
mcpx(wasmtools): granted log capability is unbounded — no line/total cap and Logs() never drains, unlike the 1 MiB output cap #2073
Closed
mcpx(wasmtools): Load never checks the memory export — a guest with the four ABI functions but no memory is accepted, then ListTools/CallTool panic the host #2076
Closed
@dezren39
dezren39 restored the queue/2907-1970-wasm-spike branch November 1, 2026 09:02
@dezren39
dezren39 deleted the queue/2907-1970-wasm-spike branch November 1, 2026 16:45
This was referenced Nov 3, 2026
Preserved branch: queue/2907-1970-wasm-spike — decision needed (merge / cherry-pick / drop) #3647
Closed
mcpx: extensibility -- plugins, hooks, tool sources, embedding (tracker) #1885
Open
Unowned PR batch from branch disposition (2026-11-07) #7297
Open
This was referenced Nov 16, 2026
watchdog: reopen issues the bot wrongly closes on merges #10105
Closed
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
This was referenced Nov 23, 2026
fleet queue: add a repair verb for quarantined/malformed task packets (in-place payload fix) #13191
Closed
[dezren39/darwin-nix#1997] agents: bound prompt, OIDC, and dispatch HTTP calls #11723
Closed
[dezren39/darwin-nix#2038] agents dispatch: task prompts are fetched unpinned from developing-today/code main and sent to an agent session unverified #12196
Open
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 24, 2026
Open-PR clearance programme 2026-11-24: every open PR merged, fixed+merged, or tasked #14166
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@dezren39 dezren39

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.