feat(settings): stream pool limits across clients #751

Merged
admin merged 4 commits from feat/741-pool-limits-stream into dev 2026-10-30 16:18:21 +00:00
Owner

Summary

Sixth implementation slice for #741, stacked on #750 and the earlier shared-state PRs. Pool limits now have an authenticated typed stream domain with an initial saved/running snapshot and updates published only after a successful save.

The This Node settings view consumes the stream, reconnects with backoff, and preserves unsaved edits when another client changes the saved limits. If the stream is initially unavailable, it makes one one-shot GetPoolLimits fallback; it does not poll. The event contains only the existing safe pool-limit state.

Verification

  • go test ./apps/sisyphusd/api — passed, including two independent subscribers receiving a saved update
  • npm --prefix apps/sisyphus run typecheck — passed
  • npm --prefix apps/sisyphus test — 235 passed
  • npm --prefix apps/sisyphus run build — passed
  • make lint — passed
  • git diff --check — passed

/cc @rvnminers-A-and-N

## Summary Sixth implementation slice for #741, stacked on #750 and the earlier shared-state PRs. Pool limits now have an authenticated typed stream domain with an initial saved/running snapshot and updates published only after a successful save. The This Node settings view consumes the stream, reconnects with backoff, and preserves unsaved edits when another client changes the saved limits. If the stream is initially unavailable, it makes one one-shot GetPoolLimits fallback; it does not poll. The event contains only the existing safe pool-limit state. ## Verification - go test ./apps/sisyphusd/api — passed, including two independent subscribers receiving a saved update - npm --prefix apps/sisyphus run typecheck — passed - npm --prefix apps/sisyphus test — 235 passed - npm --prefix apps/sisyphus run build — passed - make lint — passed - git diff --check — passed /cc @rvnminers-A-and-N
Author
Owner

Refreshed this PR onto the current #750 head. The previous CI had two real failures: coverage from stale inherited snapshots, and the pool-limits controls remained disabled in Electron because the stream omitted client management metadata. The coverage fixes are now in #749/#750; I moved the metadata/configurability fix and its E2E readiness checks from #764 into this base feature PR.

Locally, the API tests, all 235 client tests, typecheck, production build, make lint, actionlint, gofmt, and diff checks pass. Fresh CI is needed for the full 100% repository coverage and desktop E2E gates. Austin remains requested as reviewer.

/cc @rvnminers-A-and-N

Refreshed this PR onto the current #750 head. The previous CI had two real failures: coverage from stale inherited snapshots, and the pool-limits controls remained disabled in Electron because the stream omitted client management metadata. The coverage fixes are now in #749/#750; I moved the metadata/configurability fix and its E2E readiness checks from #764 into this base feature PR. Locally, the API tests, all 235 client tests, typecheck, production build, `make lint`, `actionlint`, gofmt, and diff checks pass. Fresh CI is needed for the full 100% repository coverage and desktop E2E gates. Austin remains requested as reviewer. /cc @rvnminers-A-and-N
Author
Owner

The last coverage run found one remaining branch: the POOL_LIMITS snapshot error path when the store read fails. Added a failing-store regression to TestSharedStateDomainsAndSnapshots; locally go test -cover ./apps/sisyphusd/api and go test -race ./apps/sisyphusd/api pass, and sharedStateSnapshot is 100% covered. I also rebased #751 onto the refreshed #750 head to clear the stale-base conflict. CI is rerunning on the updated branch; Austin remains requested as reviewer.

/cc @rvnminers-A-and-N

The last coverage run found one remaining branch: the POOL_LIMITS snapshot error path when the store read fails. Added a failing-store regression to `TestSharedStateDomainsAndSnapshots`; locally `go test -cover ./apps/sisyphusd/api` and `go test -race ./apps/sisyphusd/api` pass, and `sharedStateSnapshot` is 100% covered. I also rebased #751 onto the refreshed #750 head to clear the stale-base conflict. CI is rerunning on the updated branch; Austin remains requested as reviewer. /cc @rvnminers-A-and-N
Author
Owner

#750 was green on all 34 checks with no new pushes for a day, so I squash-merged it as 93c7479 and synced integration. I kept the feat/741-shared-file-stream branch so this PR's base doesn't move under you. It's ready to be refreshed onto dev whenever you pick it up.

#750 was green on all 34 checks with no new pushes for a day, so I squash-merged it as `93c7479` and synced `integration`. I kept the `feat/741-shared-file-stream` branch so this PR's base doesn't move under you. It's ready to be refreshed onto `dev` whenever you pick it up.
rvnminers-A-and-N left a comment
Owner

Thanks Lior. The backend reads cleanly: the stream reuses the same token check as GetPoolLimits, the notify only fires after the store write, and the failed-snapshot test covers the error branch. All checks are green on bfad7eb.

GitHub shows this conflicting with dev now that #750 was squash-merged, because the branch still carries #750's original commits. I tried replaying just your three commits onto current dev and they apply cleanly, so it should be a plain rebase. That will also drop the #750 files out of this diff, and it's the root of the whole #741 stack, so everything above it will need restacking afterwards.

Two small things in pool-limits-settings.tsx:

  • attempt = 0 runs on every event, including the initial snapshot. The model-lending card and #752/#753 reset only on non-snapshot events, so a stream that connects and then drops right away would retry every 500 ms here.
  • Stream events force configurable: true, while the location-discovery card in #752 forces configurable: false until the metadata read lands.

Which behaviour do you want across the series? I'd settle on one before more cards copy the pattern.

Thanks Lior. The backend reads cleanly: the stream reuses the same token check as GetPoolLimits, the notify only fires after the store write, and the failed-snapshot test covers the error branch. All checks are green on bfad7eb. GitHub shows this conflicting with dev now that #750 was squash-merged, because the branch still carries #750's original commits. I tried replaying just your three commits onto current dev and they apply cleanly, so it should be a plain rebase. That will also drop the #750 files out of this diff, and it's the root of the whole #741 stack, so everything above it will need restacking afterwards. Two small things in pool-limits-settings.tsx: - `attempt = 0` runs on every event, including the initial snapshot. The model-lending card and #752/#753 reset only on non-snapshot events, so a stream that connects and then drops right away would retry every 500 ms here. - Stream events force `configurable: true`, while the location-discovery card in #752 forces `configurable: false` until the metadata read lands. Which behaviour do you want across the series? I'd settle on one before more cards copy the pattern.
Author
Owner

Refreshed the three #751 commits onto current dev after #750 was squash-merged. Local API tests, desktop typecheck and 235 unit tests pass; fresh CI is pending. The dependent PRs still need restacking. Your questions about retry backoff and configurability remain open; I have not changed that behavior in this refresh.

/cc @rvnminers-A-and-N

Refreshed the three #751 commits onto current dev after #750 was squash-merged. Local API tests, desktop typecheck and 235 unit tests pass; fresh CI is pending. The dependent PRs still need restacking. Your questions about retry backoff and configurability remain open; I have not changed that behavior in this refresh. /cc @rvnminers-A-and-N
Author
Owner

I aligned the stream behavior with the location-settings card: the reconnect backoff resets only after a live (non-snapshot) event, and POOL_LIMITS snapshots now preserve known Electron management metadata while defaulting to non-configurable until the metadata read arrives. That prevents a brief window where a remote/older daemon could show controls as editable before the client confirms capability. The dependent stack is being restacked onto this root update.

/cc @rvnminers-A-and-N

I aligned the stream behavior with the location-settings card: the reconnect backoff resets only after a live (non-snapshot) event, and POOL_LIMITS snapshots now preserve known Electron management metadata while defaulting to non-configurable until the metadata read arrives. That prevents a brief window where a remote/older daemon could show controls as editable before the client confirms capability. The dependent stack is being restacked onto this root update. /cc @rvnminers-A-and-N
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sisyphus/Sisyphus#751