Skip to content

fix(fast-mode): handle missing serviceTiers#13

Open
boggedbrush wants to merge 2 commits into
am-will:mainfrom
boggedbrush:main
Open

fix(fast-mode): handle missing serviceTiers#13
boggedbrush wants to merge 2 commits into
am-will:mainfrom
boggedbrush:main

Conversation

@boggedbrush
Copy link
Copy Markdown

Blank Codex window before fix

Summary

Fixes a blank-screen renderer crash in the Linux desktop app when fast mode eligibility is evaluated against model schemas where serviceTiers is missing or null.

The recovered webview bundle previously assumed every model had a serviceTiers array and accessed serviceTiers.length directly. When the model payload omitted that field, or returned it as null, the renderer could throw during startup/rendering and leave the app stuck on a blank screen.

Commits

fix: guard fast mode service tiers

Applies the actual runtime fix.

  • Updates the recovered fast mode bundle to treat missing serviceTiers as an empty list.
  • Adds the same guarded patch to assemble-codex-runtime.mjs so future recovered-runtime refreshes preserve the fix.
  • Records the fast mode patch in refresh-manifest.json.
  • Adds initial regression coverage for the guarded recovered bundle and idempotent patch application.

test: harden fast mode serviceTiers patch

Hardens the patch path and expands regression coverage.

  • Ensures the patch replaces the unsafe serviceTiers.length form when present.
  • Treats the guarded form as idempotent success.
  • Fails loudly if neither expected form is found.
  • Adds coverage for:
    • serviceTiers omitted
    • serviceTiers: null
    • serviceTiers: []
    • populated serviceTiers
    • additionalSpeedTiers still enabling fast mode
    • unsafe recovered-bundle serviceTiers access patterns

Why

Some model schema responses may omit serviceTiers or provide it as null, while still including other model metadata such as additionalSpeedTiers. The fast mode check should tolerate that shape instead of throwing.

With this change, missing or null serviceTiers behaves like an empty list:

(model.serviceTiers?.length ?? 0) > 0

Existing populated serviceTiers behavior is preserved, and fast mode can still be enabled via additionalSpeedTiers when applicable.

Testing

  • Ran targeted Linux Jest coverage for:
    • codex-runtime-assembly.test.js
    • recovered-bundle.red.test.ts
Test Suites: 2 passed, 2 total
Tests: 1 skipped, 27 passed, 28 total
  • Verified the fix on Bazzite Linux.

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