Title: PR #768: clef-proxy mtime credential cache and design-code keep-alive error handling land with no tests · Issue #782 · developing-today/code · GitHub
Open Graph Title: PR #768: clef-proxy mtime credential cache and design-code keep-alive error handling land with no tests · Issue #782 · developing-today/code
X Title: PR #768: clef-proxy mtime credential cache and design-code keep-alive error handling land with no tests · Issue #782 · developing-today/code
Description: Finding (PR diff review, 2026-10-24) Open PR #768 — warm: keep-alive pools for design-code-proxy + clef-proxy (#480) (head d452f7527) — changes credential-caching and connection behaviour in two proxies but adds no tests for the new beha...
Open Graph Description: Finding (PR diff review, 2026-10-24) Open PR #768 — warm: keep-alive pools for design-code-proxy + clef-proxy (#480) (head d452f7527) — changes credential-caching and connection behaviour in two pr...
X Description: Finding (PR diff review, 2026-10-24) Open PR #768 — warm: keep-alive pools for design-code-proxy + clef-proxy (#480) (head d452f7527) — changes credential-caching and connection behaviour in two pr...
Opengraph URL: https://github.com/developing-today/code/issues/782
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PR #768: clef-proxy mtime credential cache and design-code keep-alive error handling land with no tests","articleBody":"## Finding (PR diff review, 2026-10-24)\n\nOpen PR #768 — `warm: keep-alive pools for design-code-proxy + clef-proxy (#480)` (head `d452f7527`) — changes credential-caching and connection behaviour in two proxies but adds **no tests** for the new behaviour. Its changed-file list is only `bin/clef-proxy.mjs` and `bin/design-code-proxy.mjs`; the body cites the pre-existing suites passing (11/11), which by construction cannot cover code that did not exist when they were written.\n\n## Evidence\n\n1. **clef-proxy credential cache (new, untested).** The diff adds `configFileCache` to `bin/clef-proxy.mjs`: `readConfigFileSync` now stats each Cloudflare config file and serves the cached contents unless `mtimeMs` changes, so a rotated token is picked up without a restart. Verified: neither `bin/clef-proxy.test.mjs` nor `bin/design-code-proxy.test.mjs` on main mentions the cache, `mtime`, `readConfigFile`, or `getCredentials` at all. The failure mode this introduces is silent and credential-shaped: if the mtime check ever misfires (rotation tooling that preserves mtime, e.g. `cp -p` / atomic replace with a pinned timestamp), the proxy keeps presenting the **old** Cloudflare token indefinitely with no error.\n2. **design-code-proxy keep-alive + error teardown (new, untested).** The diff adds module-level `http.Agent`/`https.Agent` keep-alive pools (`maxSockets: 32`) to every backend/upstream dispatch, plus new `error` handlers on backend and upstream responses that fall back when headers are unsent and `destroy()` the client response otherwise. No test pins: socket reuse across sequential requests, fallback on a mid-stream backend error before headers, or teardown (not hang) after headers are sent. The PR body's socket-reuse evidence is a manual sandbox smoke (4 requests, 1 source port), not a regression test.\n\n## Why it matters\n\nBoth changes sit on hot, failure-sensitive paths (Cloudflare credential presentation; streamed chat completions through pooled sockets). Without tests, a future refactor can silently revert the rotation pickup or reintroduce the half-open-socket stall the PR exists to fix — the same class of proxy bug this repo has already had to re-fix (see #684's design-code-proxy Content-Length regression, which was caught by a stub test).\n\n## Acceptance criteria\n\n- [ ] A clef-proxy test pins the cache contract: a second request does not re-read an unchanged config file; a config file whose contents **and** mtime change is re-read (rotated token served on the next request); a missing file still yields the fallback.\n- [ ] A design-code-proxy test (stub backend) pins: sequential requests reuse the keep-alive pool, and a backend response error before headers triggers the fallback path while one after headers tears the client response down instead of hanging.\n- [ ] The new tests fail against the pre-#768 behaviour where applicable (ablation), and pass on the PR head; existing proxy suites stay green.\n\nPart of the #480 warm-proxy set. Filed by the pr-diff-review job; this job files only.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-24T18:43:42Z","url":"https://github.com/developing-today/code/issues/782"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:782a47eb-f2d9-39e5-7c56-2acb4dee4f22 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD5C:804E:82A137:A9681D:6B062C6C |
| html-safe-nonce | ffa6c6cae1bbea997fc2426e5fa866e93452f8eb31d66522e97f8fe42ca5a658 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDVDOjgwNEU6ODJBMTM3OkE5NjgxRDo2QjA2MkM2QyIsInZpc2l0b3JfaWQiOiI1MDEyNjAwOTQ5MzUzODg0NzgwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 652a105ccaf9cf48b365b30ab51accb023262089ff768f982adcf1c4bca2fb69 |
| hovercard-subject-tag | issue:6016338652 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/782/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87adb721a87c43112ddf8bf72f9b7874e4d97246877b5c428b00160196f6ddda/developing-today/code/issues/782 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87adb721a87c43112ddf8bf72f9b7874e4d97246877b5c428b00160196f6ddda/developing-today/code/issues/782 |
| og:image:alt | Finding (PR diff review, 2026-10-24) Open PR #768 — warm: keep-alive pools for design-code-proxy + clef-proxy (#480) (head d452f7527) — changes credential-caching and connection behaviour in two pr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width