Skip to content

Block stale OpenWorlds surfaces from play - #630

Merged
100yenadmin merged 1 commit into
mainfrom
codex/worldos-stale-surface-block
Jun 3, 2026
Merged

Block stale OpenWorlds surfaces from play#630
100yenadmin merged 1 commit into
mainfrom
codex/worldos-stale-surface-block

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • block player move controls whenever the live /session-surface probe is loading or unavailable, not only when /app-status reports a provider/readiness bucket
  • keep the existing player-facing session-surface alert, and route action/dice/text/Declare disabled states through one livePlayBlocked guard
  • preserve engine authority: viewer remains a read model plus /move intent submitter; this is projection/control gating only

Why

Browser-first testing found a stale OpenWorlds tab that still looked playable after its same-port backend had died. The page showed old can_act state and enabled controls even though /app-status, /session-surface, and /openworlds/ were unreachable. A fresh player or agent should see a disconnected state instead of being invited to click dead controls.

Evidence

  • Pre-patch fresh browser proof on ff428a8: /Volumes/LEXAR/Codex/worldos-product-slices/browser-scripted-ff428a8-20260603T023832Z/summary.json
  • Patched browser proof: /Volumes/LEXAR/Codex/worldos-product-slices/stale-surface-block-ff428a8-20260603T024257Z/summary.json
    • healthy scripted session still accepts Continue and renders follow-up narration
    • stopped backend shows Session surface unavailable: Failed to fetch
    • Continue/Look/Say/Do/Check/Save, dice, move input, and Declare are disabled while disconnected

Test Plan

  • python3 -m pytest viewer/tests/test_openworlds_static.py -q
  • git diff --check
  • In-app Browser smoke on patched worktree with scripted provider and private art root /Users/lume/ClawDnD-val

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Narration now filters internal system notes and scaffolding for a cleaner gameplay experience.
    • Action buttons and move submission now correctly reflect live session connectivity status.
    • Improved messaging clarifies when live session reconnection is required before taking actions.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a7c74139-eeba-40c6-a99f-d8459b3b0c58

📥 Commits

Reviewing files that changed from the base of the PR and between ff428a8 and 73ab4ea.

📒 Files selected for processing (2)
  • viewer/openworlds/screen-table.jsx
  • viewer/tests/test_openworlds_static.py

📝 Walkthrough

Walkthrough

This PR refactors ScreenTable's play gating from app-status-only blocking to surface-aware blocking. A new livePlayBlocked state is derived from surfaceStatus and applied across move submission, exploration and combat actions, dice buttons, move input, and the Declare button with updated reconnection-based UX messaging.

Changes

Live session play gating refactor

Layer / File(s) Summary
Live session play gating foundation
viewer/openworlds/screen-table.jsx
Introduce surfaceStatusBlocksPlay and derive livePlayBlocked/livePlayBlockReason from session surface readiness to form the new gating foundation.
Move submission and action control gating
viewer/openworlds/screen-table.jsx
Update postMove, exploration/combat action buttons, dice buttons, and move input to use livePlayBlocked instead of app-status gating; update placeholder text to reflect live-session reconnection state.
Declare button refinement and messaging
viewer/openworlds/screen-table.jsx
Update Declare button disable logic to key on livePlayBlocked with new "Reconnect live session before declaring" messaging for blocked state.
Test assertions for gating logic
viewer/tests/test_openworlds_static.py
Validate new surfaceStatusBlocksPlay and livePlayBlocked combinations in action enable/disable expressions; update Declare button disable conditions with new reconnection-related failure reason strings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Surface awaits, gates now align,
No more app-only, the session will shine.
Reconnect the stream, let actions resume—
Live play gating blooms in the digital room!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes a clear summary of the changes, explanation of why they are needed, and test plan, but is missing the required licensing/CLA section. Add the required Licensing/CLA section with the three checkboxes confirming CLA compliance and that no confidential or restricted material is included.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: blocking stale OpenWorlds surfaces from play by gating on live session-surface availability.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@100yenadmin
100yenadmin marked this pull request as ready for review June 3, 2026 02:47
@100yenadmin
100yenadmin merged commit 55cdeb6 into main Jun 3, 2026
14 checks passed
@100yenadmin
100yenadmin deleted the codex/worldos-stale-surface-block branch June 3, 2026 02:52
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