Skip to content

feat(ray): show the state of a released pause in every UI tab and after a reload - #381

Closed
roxblnfk wants to merge 4 commits into
masterfrom
feat/ray-pause-state
Closed

roxblnfk wants to merge 4 commits into
masterfrom
feat/ray-pause-state

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • A Ray pause() released by Continue or Stop shows Continued or Stopped with its buttons off in every open UI tab and after a reload, as buggregator/server 2.14 does: the create_lock payload of the stored event gets content.state, and the updated event is pushed over the WebSocket.
  • POST /api/ray/locks/{name} (HTTP and RPC) answers {code, status, state}; a later click, from another tab, gets the state of the first one, and an unknown lock answers 404, which frontend 1.41+ shows as a pause the script no longer waits for. Before, it answered 200 with status: false.
  • The MCP summary of the event shows the state, create_lock: {"name":"…","state":"continued"}, and the event is listed again by list_events and wait_for_events when it is released.

How it works

  • The lock keeps its state for the Ray client's poll as before (60 s idle, 10 s after release, 1 000 at most); the event keeps it for the UI, bounded by the event store.
  • Clients pausing in the same second share one lock name: one release writes the state into all their events. An event mapped after the release (a client joining the released lock, or a click that beat the event to the store) takes the state from the lock.

Why?

Frontend 1.41 shows the state of a pause, but Trap gave it only to the tab that clicked: other tabs and a reloaded page kept active buttons.

Checklist

  • Tested
    • Tested manually: Trap with two headless Chromium tabs on a paused event sent with curl; Continue in one tab turned the other off without a reload and after one, and the polling client went on.
    • Unit tests added
  • testo passes but the 3 known ProtobufCasterTest failures; psalm reports only the 2 Run::getSubscribedSignals errors of master on Windows; structarmed is clean.
  • Not tried with the real spatie/ray client: it is not in vendor.

Documentation

docs/ray.md, docs/web-ui.md and the trap skill's integrations.md describe the state.

…er a reload

Continue or Stop writes `content.state`, `continued` or `stopped`, into the `create_lock` payload of every stored Ray event that pauses on the lock, and the updated event goes to every UI client over the WebSocket, as buggregator/server 2.14 does. The reply to `POST /api/ray/locks/{name}` carries the state, which frontend 1.41+ reads; a later click gets the state of the first one, and an unknown lock answers 404, which the UI shows as a pause the script no longer waits for. The state lives in the event, bounded by the event store, so the lock TTLs and cap stay as they are. The MCP summary of the event shows the state.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request tests Changes in the tests labels Nov 23, 2026
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.59%. Comparing base (73bea3d) to head (e14355d).

Files with missing lines Patch % Lines
src/Module/Ray/Frontend/LockReply.php 0.00% 6 Missing ⚠️
src/Module/Ray/Frontend/LockEvents.php 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #381      +/-   ##
==========================================
+ Coverage   80.55%   80.59%   +0.04%     
==========================================
  Files         432      434       +2     
  Lines       17488    17555      +67     
==========================================
+ Hits        14087    14148      +61     
- Misses       3401     3407       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

docs(ray): say that MCP lists the event of a pause again when it is released
test(ray): cover the 404 of an unknown lock over HTTP

A click that lands before the event reaches the store, or a client that pauses in the same second as a released pause and joins its lock, left the event without `content.state` and its card with active buttons: the Ray mapper now writes the state of a released lock into the `create_lock` payloads it maps.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(ray): say that a pause released before its event arrives is listed once, with the state

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
…allocated memory

The limit was the used memory plus 64 MB, while PHP checks it against the allocated memory: in a long suite the allocated memory runs more than 64 MB ahead, so the next allocation failed the whole run.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk

Copy link
Copy Markdown
Member Author

Landed on master as a fast-forward of two signed commits: 074c86d (the feature, same tree as the PR's Ray changes) and b1e0e8e (the profiler test memory fix).

@roxblnfk roxblnfk closed this Nov 23, 2026
@roxblnfk
roxblnfk deleted the feat/ray-pause-state branch November 24, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests Changes in the tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant