Skip to content

Prevent macOS Server worker stack overflow - #163

Merged
yyjeqhc merged 1 commit into
mainfrom
fix/macos-server-tokio-stack
Aug 25, 2026
Merged

Prevent macOS Server worker stack overflow#163
yyjeqhc merged 1 commit into
mainfrom
fix/macos-server-tokio-stack

Conversation

@yyjeqhc

@yyjeqhc yyjeqhc commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Fix a macOS-only WebCodex Server crash observed during real OpenAI Secure MCP Tunnel dogfood.

A normal MCP request could reach the local Server and abort a Tokio worker with stack overflow. The same request succeeded when RUST_MIN_STACK=8388608 was supplied diagnostically.

This change makes the webcodex-server binary build its Tokio multi-thread runtime explicitly and uses an 8 MiB worker stack on macOS only. Linux and Windows retain Tokio's default worker stack behavior.

Evidence

  • reproduced the crash twice on mini/macOS during real webcodex share --tunnel openai calls
  • diagnostic RUST_MIN_STACK=8388608 removed the crash
  • macOS runtime regression verifies the configured worker stack is at least 8 MiB
  • cargo fmt -- --check passed
  • focused Server compilation passed
  • macOS arm64 build of WebCodex/Runner/CLI passed
  • with RUST_MIN_STACK explicitly unset, live share --tunnel openai reached /healthz=200 and /readyz=200
  • direct MCP initialize and tools/list both returned HTTP 200 and the Server remained alive
  • real ChatGPT Secure Tunnel tool invocation passed after the stack adjustment

The branch was rebased cleanly onto current main; the intervening #162 change is Windows Runner-only and does not overlap this fix.

@yyjeqhc
yyjeqhc enabled auto-merge (squash) August 25, 2026 14:58
@yyjeqhc
yyjeqhc merged commit 14afa51 into main Aug 25, 2026
9 checks passed
@yyjeqhc
yyjeqhc deleted the fix/macos-server-tokio-stack branch August 25, 2026 15:01
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