Skip to content

fix(dashboard): retain Bay projection across queue probe failures - #1194

Merged
brokemac79 merged 5 commits into
mainfrom
codex/csw-132-bay-projection
Aug 17, 2026
Merged

fix(dashboard): retain Bay projection across queue probe failures#1194
brokemac79 merged 5 commits into
mainfrom
codex/csw-132-bay-projection

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retain the last complete verified public Bay queue projection when the optional queue /stats probe rejects, including after the ordinary 60-second status cache has expired
  • clear generation-coupled live activity, keep status degraded/incomplete, and render retained queue references with lower-bound (≥N) counts
  • bound retention to the existing 15-minute stale window, re-run data through the current public repository allowlist, and fail closed for absent bindings, fulfilled nulls, malformed data, or expired nested samples

Problem

The Bay intermittently becomes entirely empty while the direct /api/exact-review-queue endpoint still returns a complete public projection with active and pending work. During status refresh, attachExactReviewQueueStatus tolerates optional queue probe failures with Promise.allSettled, but a rejected queue probe leaves exact_review_queue as null. That null is persisted and cached, erasing the last verified public snapshot and making a transient dependency failure look like zero work.

The ordinary cached-status read also expired after 60 seconds, earlier than the intended 15-minute stale fallback window. Retaining a queue projection without adapting the Bay client was insufficient because the client previously discarded all queue references whenever the live activity census was incomplete.

This is an observability defect. It can hide a real review/publication backlog, but it does not itself stop reviews. The durable-lifecycle over_cap state and the terminal-review completion outage are separate conditions.

Implementation

When—and only when—the optional queue probe rejects, status refresh may load and retain the prior queue projection through the existing 15-minute stale window if the nested queue projection is complete and its own generation timestamp remains inside that bound. Before retention, the prior object is reprojected through publicExactReviewQueueProjection with the current verified-public repository allowlist.

Generation-coupled live activity is replaced with the canonical incomplete activity shape. The Bay client still renders verified queue references and queue-stage counts, labels them as lower bounds (≥N), and does not invent live workers. A fulfilled null result, an absent queue binding, malformed/partial input, or a nested queue sample older than 15 minutes still fails closed.

Validation

  • exact committed-tree AWS Crabbox Linux behavior proof: 139/139 scoped tests
  • focused retained-projection and Bay client regressions
  • dashboard build plus queue public-boundary and strict checks
  • dashboard and target lint
  • focused formatting and exact committed-blob checks
  • git diff --check origin/main...HEAD

Real Behavior Proof

Claim: A status refresh that loses only the optional queue probe retains the last complete, privacy-filtered public Bay queue projection through the bounded stale window, clears unverifiable live activity, and renders queue-only references/counts without presenting them as a complete census. An environment with no queue binding and an expired nested sample both fail closed.

Exercised surface: the real in-memory ExactReviewQueue, /api/exact-review-queue, /api/status, persisted status storage, response caching, health diagnostics, public projection filtering, and the production Bay client parser/renderer.

Scenario/fixture: enqueue public openclaw/openclaw#125204, obtain its complete public projection through the direct queue API, seed it as the prior status snapshot, then make /stats reject with a private marker while keeping the events endpoint available. Repeat after the ordinary 60-second cache age but within 15 minutes. Negative cases remove the queue binding, return fulfilled null/malformed data, and age the nested queue projection beyond 15 minutes.

Command/environment: AWS Crabbox Linux (c7a.8xlarge), provider aws, run run_904311dcdb8d, lease cbx_68e44965aaf4, exact committed-tree head bea3ef7083fc79dd8cb48d81c2a1ef6e4c7e6416, proof base 866506fb0f57da42f4664647b3d8619f9944475d.

Observed result: /api/status retained the allowlisted queue reference in response, persistence, and cache projections after a rejected probe and after the ordinary cache age elapsed. It cleared live activity, remained degraded/incomplete, withheld the private failure marker, and the Bay rendered queue-only references with lower-bound counts. No binding, fulfilled null, malformed/partial input, and a nested projection older than 15 minutes all failed closed. All 139 tests and the boundary/type/lint/format gates passed.

Artifact/trace: Crabbox run run_904311dcdb8d, lease cbx_68e44965aaf4; terminal proof line: CSW-132 Bay projection Linux behavior proof: PASS.

Limits: This deterministic exact-runtime proof does not deploy or mutate production. The optional pr-behavior-proof skill named by workspace policy was unavailable in this session, so its required contract is reproduced explicitly here. Main later advanced through unrelated agent-runner and live-proof changes in #1196/#1198; the proved four-file tree remains unchanged.

Reviews

  • dirty Codex reviews identified and fixed a no-binding fail-open edge, retained stale live activity, indefinite nested retention, and premature 60-second source expiry; repeated dirty review clean
  • committed Codex review against proof base 866506fb0f57da42f4664647b3d8619f9944475d: clean
  • local ClawSweeper committed-range review: decision=keep_open, confidence=high, action=kept_open; no GitHub mutation

Risks and rollout

The retained projection may be stale, which is why health and activity remain degraded and counts are lower bounds. Retention is bounded by the existing 15-minute stale window, requires a previously complete public projection, and occurs only on an actual optional-probe rejection. It cannot introduce unverified repositories, preserve live activity, or convert an absent binding into apparent data.

Rollback is to revert this PR. No data migration, queue repair, workflow change, or production-state mutation is required.

This PR fixes Bay projection continuity only. It does not repair the separate durable-lifecycle over-cap state, publication backlog, acute model/output generation failures, or hot-intake terminal-comment routing defect tracked in #1189.

Related

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 9:20 AM ET / 13:20 UTC.

ClawSweeper review

What this changes

The PR retains a recent verified public Bay queue projection after an optional queue-status probe rejects, while clearing live activity and showing lower-bound queue counts.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for maintainer review. The patch has no actionable correctness finding, and current main does not contain this bounded Bay fallback.

Priority: P2
Reviewed head: bea3ef7083fc79dd8cb48d81c2a1ef6e4c7e6416

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused runtime proof, bounded fallback logic, and targeted regression coverage support a high-confidence maintainer review.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides an exact-head Crabbox terminal trace exercising the real queue, status route, persistence/cache projections, and Bay renderer after a rejected probe.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides an exact-head Crabbox terminal trace exercising the real queue, status route, persistence/cache projections, and Bay renderer after a rejected probe.
Evidence reviewed 5 items Bounded fallback implementation: On a rejected queue probe, the Worker reads the stale status snapshot, reprojects it through the verified-public allowlist, requires a complete queue document within the configured stale window, and clears activity before retaining it.
Bay degradation semantics: The Bay parser accepts only the canonical incomplete activity shape, uses queue references from the complete projection, and labels queue-only stage counts as lower bounds.
Focused regression coverage: The added Worker regression covers rejected probes, persistence and cache retention, stale-root fallback, expired nested projections, and an absent queue binding.
Findings None None.
Security None None.

How this fits together

The dashboard Worker combines queue and worker observations into a privacy-filtered public status document. OpenClaw Bay reads that document to display public queue references without treating stale queue data as a live worker census.

flowchart LR
  A[Queue status probe] --> B[Dashboard status refresh]
  C[Prior public status snapshot] --> B
  B --> D{Probe rejected?}
  D -->|recent complete sample| E[Retain reprojected queue]
  D -->|invalid or expired| F[Fail closed]
  E --> G[Clear live activity]
  G --> H[Bay lower-bound display]
  F --> H
Loading

Before merge

  • Resolve merge risk (P0) - During a queue-probe outage, the retained queue projection can be up to 15 minutes old; degraded status and lower-bound counts must remain intact when merging.
  • Complete next step (P2) - No repair dispatch is appropriate: the submitted patch has no discrete review finding and carries current real-behavior proof.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 4 files affected; production +50/-7, tests +288 The change is focused on Worker fallback behavior and Bay parsing, with substantial targeted regression coverage.

Merge-risk options

Maintainer options:

  1. Retain the bounded degraded fallback (recommended)
    Merge with the existing 15-minute cap, cleared live activity, and lower-bound display so transient probe failure cannot be mistaken for an empty queue.

Technical review

Best possible solution:

Merge the bounded, allowlist-reprojected queue fallback while preserving unavailable live activity and lower-bound Bay presentation.

Do we have a high-confidence way to reproduce the issue?

Yes. The PR supplies an exact-head Crabbox trace for a rejected queue probe, and the added source-level regression covers the retained, expired, malformed, and unbound cases; this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes. It uses the existing stale-window and public-projection boundaries, then clears generation-coupled live activity rather than fabricating a complete census.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ecf222f5bd14.

Labels

Label justifications:

  • P2: This is a bounded public-observability repair that does not stop review processing.
  • merge-risk: 🚨 other: The change deliberately presents a bounded stale public queue projection during a probe outage, which needs clear degraded semantics.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides an exact-head Crabbox terminal trace exercising the real queue, status route, persistence/cache projections, and Bay renderer after a rejected probe.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides an exact-head Crabbox terminal trace exercising the real queue, status route, persistence/cache projections, and Bay renderer after a rejected probe.

Evidence

What I checked:

  • Bounded fallback implementation: On a rejected queue probe, the Worker reads the stale status snapshot, reprojects it through the verified-public allowlist, requires a complete queue document within the configured stale window, and clears activity before retaining it. (dashboard/worker.ts:6315, bea3ef7083fc)
  • Bay degradation semantics: The Bay parser accepts only the canonical incomplete activity shape, uses queue references from the complete projection, and labels queue-only stage counts as lower bounds. (dashboard/bay-page.ts:243, bea3ef7083fc)
  • Focused regression coverage: The added Worker regression covers rejected probes, persistence and cache retention, stale-root fallback, expired nested projections, and an absent queue binding. (test/dashboard-worker-observability.test.ts:2023, bea3ef7083fc)
  • Current-main comparison: The current main tree has none of the fallback or lower-bound symbols; its commits after the PR proof base do not modify the four touched paths, so the change is not already implemented on main. (ecf222f5bd14)
  • Branch provenance: The checked-out PR head records the final stale-window fallback commit at 2026-08-17T13:58:42+01:00. (dashboard/worker.ts:6315, bea3ef7083fc)

Likely related people:

  • Peter Steinberger: The available shallow history identifies Peter Steinberger on the PR proof-base and current-main integration commits; the original dashboard-path history is unavailable in this checkout. (role: current-main integrator; confidence: low; commits: 866506fb0f57, ecf222f5bd14; files: dashboard/worker.ts, dashboard/bay-page.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-17T12:22:24.988Z sha 9a488ba :: needs changes before merge. :: [P2] Clear stale Bay activity on retained queue snapshots
  • reviewed 2026-08-17T12:30:50.273Z sha 4590605 :: needs changes before merge. :: [P2] Clear stale activity when retaining a queue projection
  • reviewed 2026-08-17T13:12:38.012Z sha bea3ef7 :: needs maintainer review before merge. :: none

@brokemac79
brokemac79 force-pushed the codex/csw-132-bay-projection branch from 9a488ba to 4590605 Compare August 17, 2026 12:27
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@brokemac79
brokemac79 force-pushed the codex/csw-132-bay-projection branch from 4590605 to bea3ef7 Compare August 17, 2026 13:08
@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 17, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 17, 2026 13:17
@brokemac79
brokemac79 merged commit 335cb45 into main Aug 17, 2026
21 of 22 checks passed
@brokemac79
brokemac79 deleted the codex/csw-132-bay-projection branch August 17, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant