Skip to content

Improve first-load reliability and add troubleshooting guide#28

Merged
abewheel merged 2 commits intomainfrom
abewheel/improve-first-load
Mar 30, 2026
Merged

Improve first-load reliability and add troubleshooting guide#28
abewheel merged 2 commits intomainfrom
abewheel/improve-first-load

Conversation

@abewheel
Copy link
Copy Markdown
Contributor

Summary

  • Add connection timeout (5s) and automatic retry (3 attempts with exponential backoff) to AppProvider so apps self-heal when the PostMessage handshake races on first load in ChatGPT/Claude
  • Make sandbox proxy retry the sandbox-proxy-ready signal every 200ms until the host responds, fixing a race where the srcdoc parses before React's ref callback attaches the listener
  • Guard onSandboxReady in McpAppHost to fire only once despite repeated ready signals
  • Suppress noisy "Server not initialized" transport errors that fire harmlessly during parallel test connections
  • Add troubleshooting guide (docs/guides/troubleshooting.mdx) covering the full nuclear refresh flow, port conflicts, ngrok issues, and common inspector/test problems
  • Print troubleshooting link in CLI output after dev server startup and in browser console on connection failure
  • Add troubleshooting sections to package README, template README, and create-sunpeak-app skill

Test plan

  • pnpm --filter sunpeak typecheck passes
  • pnpm --filter sunpeak lint passes
  • pnpm --filter sunpeak test -- --run passes (247 tests)
  • pnpm --filter sunpeak build succeeds
  • Run sunpeak dev and verify troubleshooting link appears in terminal output
  • Verify troubleshooting page renders at /docs/guides/troubleshooting

Add connection retry with timeout to AppProvider so apps self-heal when
the PostMessage handshake races on first load in ChatGPT/Claude. Add
periodic sandbox-proxy-ready retries to handle srcdoc/React ref timing.
Suppress noisy "Server not initialized" transport errors during parallel
connections. Add troubleshooting guide to docs site, READMEs, CLI output,
and agent skill.
@abewheel abewheel merged commit c3ab0a7 into main Mar 30, 2026
3 checks passed
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