fix(health): fail readiness fast on PG pool saturation - #503
Closed
samxu01 wants to merge 3 commits into
Closed
Conversation
samxu01
commented
Jun 28, 2026
samxu01
left a comment
Contributor
Author
There was a problem hiding this comment.
Looks good overall. The only thing I'd flag is that the new readiness short-circuit duplicates the pool-saturation snapshot logic already used in /api/health/db; if this grows further, I'd extract a tiny shared helper for the readiness decision itself so the two endpoints stay aligned.
samxu01
commented
Jun 28, 2026
samxu01
left a comment
Contributor
Author
There was a problem hiding this comment.
One-line second opinion: yes, fail-fast on pool saturation makes sense here, because readiness should reflect queue pressure before requests start timing out.
samxu01
added a commit
that referenced
this pull request
Jun 29, 2026
…nly.me demo Replace stale/weak screenshots with real, unedited captures of agents doing real work, align the front door with the shared-memory wedge, and point the demo at commonly.me. - Landing "In action" leads with the real engineering flow: an agent ships PR #503 with a passing test, a teammate reviews it and flags real code duplication (was an idle pod-monitoring shot). - README hero + table use real captures (real engineering, artifact generation, multi-runtime roster, identity/memory) — drops stale v1 feed/pods/task-board. - Hero copy: drop off-message "social layer for agents and humans" → "the open-source workspace where your agents and team share one memory" + badges. - Demo links app-dev.commonly.me → commonly.me (README hero + footer; repo homepage + description updated via gh repo edit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…503) Theo's review flagged that the PG-pool detail block was duplicated between /api/health/db and /api/health/ready. Extract the shared {max,total,idle, waiting,connectionTimeoutMillis} shape into one pgPoolDetail() helper called from both — behavior identical, the two probes can no longer drift. (Cody's codex-exec couldn't land the follow-up push reliably, so applied directly; same author/branch as the original PR.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
samxu01
added a commit
that referenced
this pull request
Jun 29, 2026
Adds /api/health/db (lightweight pool-stats probe, 503 on saturation) and makes
/api/health/ready fail fast when the PG pool is saturated (waiting>0 && idle===0)
— the signal that would have caught the 2026-05-26 pool-exhaustion incident
before user impact. Shared {max,total,idle,waiting,connectionTimeoutMillis}
detail extracted into one pgPoolDetail() helper so /db and /ready can't drift.
Includes a 90-line unit test for /ready saturation behavior.
Authored by Cody (cloud-codex) end-to-end; review note (extract the shared
helper) raised by Theo and applied as a follow-up.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
Squash-merged to main as 353763c (local squash + push). Theo's review note (shared pgPoolDetail helper) addressed; CI green. |
This was referenced Jun 29, 2026
samxu01
added a commit
that referenced
this pull request
Jun 29, 2026
OpenClaw agents (Theo/Nova/Pixel/Ops) have no shell — they triage, review, coordinate, and research. Only Cody (Codex runtime) authors code and opens real labeled PRs (e.g. #503). Credit code authorship to Cody and reframe the OpenClaw agents accordingly, matching the hedged landing copy and docs/agents/AGENT_CODING_CAPABILITY.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
samxu01
added a commit
that referenced
this pull request
Jun 29, 2026
#528) Fails a pull_request against main when its merge-base has drifted more than MAX_BEHIND (40) commits behind origin/main, forcing a rebase before merge. Codifies the stale-base squash-merge footgun that silently reverted intervening merged work (#503 clobbered #506/#507). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019vuFLFHnmJKmMxosHSWA4P
lilyshen0722
added a commit
that referenced
this pull request
Jul 2, 2026
…erged #542 The README pointed its real-work proof at PR #503, which was closed/reverted (the stale-base squash-merge incident). The live showcase pod ("Commonly Engineering") actually features PR #542 — Cody extending a Cloudflare-aware rate-limit fix across the auth/uploads/showcase routes, with Theo reviewing. Point both README references at #542 so the marketing claim matches the real, merged, showcase-featured exchange.
lilyshen0722
added a commit
that referenced
this pull request
Jul 2, 2026
to #542 Consistent with the README re-anchor — link a merged, live PR instead of the closed/reverted one.
samxu01
added a commit
that referenced
this pull request
Jul 2, 2026
… + button contrast (#555) * fix(showcase): resolve the showcase pod id at build + fix blue-button contrast The public "Watch a live room" CTA was dead in production — it rendered "This room isn't public" because the deployed frontend requested `/api/showcase/__SHOWCASE_POD_ID__` (the literal placeholder). Root cause: vite's `define: { 'process.env': {} }` clobbers all process.env reads, and only REACT_APP_API_URL had an explicit passthrough — REACT_APP_SHOWCASE_POD_ID did not, so V2Showcase fell back to the '__SHOWCASE_POD_ID__' sentinel. (Same trap the API_URL comment already documents.) The showcase API + pod are fine — publicRead:true, 4 members; only the client id substitution was broken. - vite.config.ts: add `'process.env.REACT_APP_SHOWCASE_POD_ID'` to `define` (the Dockerfile + CI already pass it as a build arg/env). - v2-showcase.css: `.v2-showcase__btn--primary` rendered dark-on-blue — the `.v2-root a { color: inherit }` (0,1,1) trap beat the single-class #fff rule. Re-assert with a `.v2-root` prefix (0,2,0). "Sign up to join" / "Start your own room" now compute white (verified live). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MnRCAFgjrrGZxo9VRCmCm9 * docs(readme): re-anchor the "real work" proof from reverted #503 to merged #542 The README pointed its real-work proof at PR #503, which was closed/reverted (the stale-base squash-merge incident). The live showcase pod ("Commonly Engineering") actually features PR #542 — Cody extending a Cloudflare-aware rate-limit fix across the auth/uploads/showcase routes, with Theo reviewing. Point both README references at #542 so the marketing claim matches the real, merged, showcase-featured exchange. * docs(agents): re-anchor the coding-capability example from reverted #503 to #542 Consistent with the README re-anchor — link a merged, live PR instead of the closed/reverted one. --------- Co-authored-by: Lily Shen <ls111@rice.edu> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
samxu01
added a commit
that referenced
this pull request
Jul 2, 2026
…exchange (#556) The old marketing shot was anchored to the reverted #503 story. Recaptured from the now-working public showcase (fixed in #555): the real PR #542 thread — founder flags that routes/showcase.ts still keys its rate-limiter on req.ip; Theo triages; Cody patches it (8e484cd) swapping in cloudflareIpRateLimitKeyGenerator across all three routes; Theo reviews with real depth (shared ipRateLimit.ts reduces duplication, the CJS/ESM module.exports shim is intentional) and ships it. Matches the re-anchored README/agent-docs (#542, not #503). Both copies updated (screenshots/ for README, assets/landing/ for the bundled hero). Captured from commonly.me/v2/showcase. Claude-Session: https://claude.ai/code/session_01MnRCAFgjrrGZxo9VRCmCm9 Co-authored-by: Lily Shen <ls111@rice.edu> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
GH#454 is already fixed on by PR #455 plus the later summarizer/db-health follow-up. This PR addresses a smaller current gap next to that work: readiness should fail fast from pool state during saturation so Kubernetes can react immediately.
Test
�[41m �[0m
�[41m�[37m This is not the tsc command you are looking for �[0m
�[41m �[0m
To get access to the TypeScript compiler, �[34mtsc�[0m, from the command line either: