Skip to content

Tame miniapp runtime liveness warnings#3188

Open
isaiahb wants to merge 1 commit into
cloud-v2-authfrom
codex/runtime-liveness-warning
Open

Tame miniapp runtime liveness warnings#3188
isaiahb wants to merge 1 commit into
cloud-v2-authfrom
codex/runtime-liveness-warning

Conversation

@isaiahb

@isaiahb isaiahb commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • measure steady-state miniapp delivery NACKs inside the per-context executor so queued work does not look like a wedged runtime
  • log ready_nack frames as warnings instead of dev-overlay errors
  • add router coverage for the warning behavior

Test

  • bun test mobile/modules/island/src/services/__tests__/MentraJSRouter.test.ts

Note

Low Risk
Small timing/logging changes in miniapp delivery and observability; no auth, data, or crash-respawn behavior changes.

Overview
Reduces noisy “wedged runtime” signals when miniapp JS is merely backlogged on its per-context thread, and downgrades how those liveness NACKs appear in dev.

On Android JSCRuntime.dispatchToJs, re-arming the steady-state ready_nack watchdog moved inside the per-package executor task so the 3s timer measures time until __deliver runs, not time spent waiting behind earlier queued work. Cold-start NACK behavior is unchanged.

In MentraJSRouter, __error frames with method ready_nack now use logger.warn instead of logger.error, so they don’t surface like other miniapp failures in the dev overlay. Crash handling is unchanged (ready_nack still isn’t treated as a crash). A unit test covers the warning path.

Reviewed by Cursor Bugbot for commit d0a3aae. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Reduces false “wedged runtime” alerts by arming the steady-state NACK timer inside the per-context executor, and downgrades ready_nack to a warning instead of a dev-overlay error.

  • Bug Fixes
    • Re-arm steady-state NACK inside the per-context executor so it measures actual __deliver time, not queue delay.
    • Log __error/ready_nack as a warning in MentraJSRouter; added a unit test to cover this behavior.

Written for commit d0a3aae. Summary will update on new commits.

Review in cubic

@isaiahb isaiahb requested a review from a team as a code owner June 17, 2026 22:52
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

📋 PR Review Helper

📱 Mobile App Build

Ready to test! (commit d0a3aae)

📥 Download APK

🕶️ ASG Client Build

Waiting for build...


🔀 Test Locally

gh pr checkout 3188

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

Copy link
Copy Markdown

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: d0a3aaeef1

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

// waiting behind earlier queued work. Skipped during cold-start
// (timer still ticking from spawn).
if (record.readyAcked) {
armReadyNackTimer(record, STEADY_STATE_NACK_TIMEOUT_MS, cold = false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve NACK coverage for executor starvation

When the Android JS executor is already stuck before this submitted task starts—for example, a miniapp timer callback scheduled by scheduleTimer() enters a long/infinite CPU loop, and those timer callbacks do not have the soft watchdog—this line is never reached, so the 3s steady-state ready_nack is never armed for later host deliveries or pings. Previously dispatchToJs armed the timer before enqueueing, which still surfaced a dead context; now that case stays silent until the slower ping/foreground liveness path notices it. Please keep some starvation watchdog outside the executor or add equivalent watchdog coverage to queued timer work.

Useful? React with 👍 / 👎.

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