Skip to content

feat(gateway): push session PR indicators to subscribed clients - #115643

Merged
steipete merged 5 commits into
mainfrom
perf/pr-indicators-push
Jul 29, 2026
Merged

steipete merged 5 commits into
mainfrom
perf/pr-indicators-push

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sidebar PR indicators were pull-on-top-of-pull: every client ran a 60s timer calling controlUi.sessionPullRequests for its visible sessions; the gateway answered from a 60s GitHub cache. With the rest of the dashboard slow-log fixed, this poller was the largest remaining line (51 calls × 79ms per 50min in production), N clients paid N polls for identical data, and updates converged only on the next timer tick.

Why This Change Was Made

Operator-requested design change: the gateway owns the GitHub poll (webhooks aren't viable for self-hosted gateways), pushes updates, and does the work only for sessions someone is actually looking at.

User Impact

PR chips update via push across all open dashboards simultaneously; the per-client 60s RPC chatter disappears; GitHub API spend stays demand-proportional (no subscribers → no polling) and is deduplicated across clients.

Evidence

  • New additive protocol pair: controlUi.sessionPullRequests.subscribe (replace-set semantics: each call replaces the connection's watched keys; empty set or disconnect unsubscribes; 200-key bound) and controlUi.sessionPullRequests.changed (initial per-key snapshot on subscribe, then hash-based deltas; per-key status ready/rate-limited/unavailable with last-known data retained). No protocol version bump; Android protocol catalog regenerated (enum-only surface there); no Swift changes.
  • Gateway polls the union of subscribers' keys every 60s, deduplicating across connections and preserving the existing cache/backoff discipline (60s success, 30s failure, 5min rate-limit).
  • Old pull RPC deleted after a consumer audit: all real consumers were bundled Control UI surfaces (which version with the gateway); tests for the removed path deleted per policy.
  • UI: subscription updates on visibility changes (hidden tab sends an empty set), resubscribes after reconnect, menu watches auto-release.
  • ETag/conditional GitHub requests deferred with reason: the current fetch layer lacks a token-safe response-metadata cache (noted follow-up).
  • Validation: focused gateway/UI suites; full UI e2e 98 files / 349 tests; core/UI tsgo; all deadcode lanes; full lint; format; git diff --check; autoreview clean. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30426131966

@steipete
steipete marked this pull request as ready for review July 29, 2026 05:59
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui gateway Gateway runtime size: XL maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete steipete self-assigned this Jul 29, 2026
@steipete
steipete force-pushed the perf/pr-indicators-push branch from 7000531 to bd16e42 Compare July 29, 2026 07:15
@steipete steipete closed this Jul 29, 2026
@steipete steipete reopened this Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 29, 2026
@steipete
steipete force-pushed the perf/pr-indicators-push branch from 7bf48c4 to 7f7f573 Compare July 29, 2026 08:10
@steipete
steipete merged commit 662abec into main Jul 29, 2026
205 of 207 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the perf/pr-indicators-push branch July 29, 2026 10:30
vincentkoc added a commit to yetval/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (224 commits)
  fix(memory): preserve Windows session ownership (openclaw#115851)
  fix(compaction): drop context-engine fallback on codex ownership skip (openclaw#114155) (openclaw#115666)
  fix(msteams): ignore blank certificate settings (openclaw#109112)
  fix(usage): guard malformed DeepSeek payloads (openclaw#110785)
  docs(agents): reword imported review rules in repo voice
  docs(agents): add context-budget, tool-description, cache-invalidation, and review-premise rules
  docs(agents): mock-gateway proof satisfies gate without discouraging live proof
  docs(agents): add vitest in-flight edit rule and mock-gateway proof recipe
  docs(agents): restructure root AGENTS.md around product doctrine and deduped policy
  fix(codex): keep completed answers over audit gaps (openclaw#115849)
  test(cli): isolate unknown-command process validation (openclaw#115848)
  fix(memory-host-sdk): resolve stable execPath for worker fork to survive Homebrew Node upgrades (openclaw#99318)
  feat(ui): add composer capability menu (openclaw#115800)
  fix(synology-chat): stop fabricating send message ids (openclaw#110770)
  fix(feishu): reply to direct messages by chat id (openclaw#109637)
  fix(acp): attach error listener to spawned ACP agent process (openclaw#109529)
  fix(sessions): deliver agent announcements to direct message sessions (openclaw#115811)
  fix(nextcloud-talk): reject reactions for disabled or unconfigured accounts (openclaw#112675)
  refactor(ui): move Agent Defaults entry from the sidebar into the Agents page (openclaw#115836)
  feat(gateway): push session PR indicators to subscribed clients (openclaw#115643)
  ...

# Conflicts:
#	src/agents/apply-patch.ts
#	src/agents/sandbox/fs-bridge-mutation-helper.ts
pull Bot pushed a commit to yann0001/openclaw that referenced this pull request Jul 29, 2026
* origin/main:
  docs(agents): reword imported review rules in repo voice
  docs(agents): add context-budget, tool-description, cache-invalidation, and review-premise rules
  docs(agents): mock-gateway proof satisfies gate without discouraging live proof
  docs(agents): add vitest in-flight edit rule and mock-gateway proof recipe
  docs(agents): restructure root AGENTS.md around product doctrine and deduped policy
  fix(codex): keep completed answers over audit gaps (openclaw#115849)
  test(cli): isolate unknown-command process validation (openclaw#115848)
  fix(memory-host-sdk): resolve stable execPath for worker fork to survive Homebrew Node upgrades (openclaw#99318)
  feat(ui): add composer capability menu (openclaw#115800)
  fix(synology-chat): stop fabricating send message ids (openclaw#110770)
  fix(feishu): reply to direct messages by chat id (openclaw#109637)
  fix(acp): attach error listener to spawned ACP agent process (openclaw#109529)
  fix(sessions): deliver agent announcements to direct message sessions (openclaw#115811)
  fix(nextcloud-talk): reject reactions for disabled or unconfigured accounts (openclaw#112675)
  refactor(ui): move Agent Defaults entry from the sidebar into the Agents page (openclaw#115836)
  feat(gateway): push session PR indicators to subscribed clients (openclaw#115643)
  fix(setup): make Gemini recovery actionable (openclaw#115835)
  fix(terminal-core): prevent String.replace $ pattern injection in display-string (openclaw#111398)
  refactor(channels): share ingress retention defaults (openclaw#115824)
  fix(nostr): profile imports vary on timestamp ties (openclaw#111798)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…claw#115643)

* feat(gateway): push session PR indicators to subscribed clients

* test(gateway): fix PR indicator drift

* chore(protocol): allowlist PR-indicator event for native apps (Control UI surface)

* test: align PR indicator lifecycle coverage

* fix(ui): scope session PR store listeners to active watchers
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  docs(agents): reword imported review rules in repo voice
  docs(agents): add context-budget, tool-description, cache-invalidation, and review-premise rules
  docs(agents): mock-gateway proof satisfies gate without discouraging live proof
  docs(agents): add vitest in-flight edit rule and mock-gateway proof recipe
  docs(agents): restructure root AGENTS.md around product doctrine and deduped policy
  fix(codex): keep completed answers over audit gaps (openclaw#115849)
  test(cli): isolate unknown-command process validation (openclaw#115848)
  fix(memory-host-sdk): resolve stable execPath for worker fork to survive Homebrew Node upgrades (openclaw#99318)
  feat(ui): add composer capability menu (openclaw#115800)
  fix(synology-chat): stop fabricating send message ids (openclaw#110770)
  fix(feishu): reply to direct messages by chat id (openclaw#109637)
  fix(acp): attach error listener to spawned ACP agent process (openclaw#109529)
  fix(sessions): deliver agent announcements to direct message sessions (openclaw#115811)
  fix(nextcloud-talk): reject reactions for disabled or unconfigured accounts (openclaw#112675)
  refactor(ui): move Agent Defaults entry from the sidebar into the Agents page (openclaw#115836)
  feat(gateway): push session PR indicators to subscribed clients (openclaw#115643)
  fix(setup): make Gemini recovery actionable (openclaw#115835)
  fix(terminal-core): prevent String.replace $ pattern injection in display-string (openclaw#111398)
  refactor(channels): share ingress retention defaults (openclaw#115824)
  fix(nostr): profile imports vary on timestamp ties (openclaw#111798)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant