Repository navigation
fix: keep projected GitHub reads out of ETag cache - #1242
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 1:13 AM ET / 05:13 UTC. ClawSweeper reviewWhat this changesThe PR excludes jq and Go-template GitHub CLI output projections from the durable ETag cache and adds coverage for split, attached, compact, and clustered flag forms. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: current main still allows projected GitHub CLI reads into the durable ETag broker. This narrow fix correctly bypasses that broker for jq/template projections, and the PR body supplies sufficient after-fix read-only CLI proof for the current head. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe apply lane reads GitHub metadata before deciding whether a proposal is safe to close. The durable ETag broker caches full API responses for quota efficiency, while projected output must remain specific to the caller’s requested fields for close-safety guards. flowchart LR
A[Apply lane] --> B[GitHub CLI read]
B --> C{Output projection?}
C -->|jq or template| D[Direct GitHub response]
C -->|Full resource| E[Durable ETag broker]
D --> F[Close-safety guards]
E --> F
F --> G[Apply decision]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow projection bypass, retain durable caching for full-resource GETs, and monitor apply-lane quota telemetry rather than widening the persisted cache-key contract. Do we have a high-confidence way to reproduce the issue? Yes—current-main source shows projected pull metadata can share a broker key despite the requested-reviewer guard consuming a distinct projection; the linked issue supplies the concrete sequence. Is this the best way to solve the issue? Yes—the bypass is the narrowest safe repair because it preserves the existing full-resource cache contract while preventing projection-shaped bodies from being replayed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 91a2bf645327. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Squash-merged as a2641b2 and verified that commit is on remote main. #1239 auto-closed. Thanks @goutamadwant. Validated exact head The main PR body's built-runtime, real read-only GitHub proof shows five projected reads returning their requested shapes with the broker deliberately unreachable. No live apply-decisions closure was run. Projected reads now incur direct REST quota; that accepted trade-off prevents another projection's cached body from weakening close-safety reads while preserving full-resource caching. No safety policy or OpenClaw Bay contract changed. |
Closes #1239
What Problem This Solves
Exact-publication apply runs could reuse a durable ETag body produced by a different GitHub output projection. A cached projected response could therefore omit requested reviewers or teams from a later close-safety read.
Why This Change Was Made
Projected
gh apireads now bypass the durable ETag broker for jq and template output flags, including split, attached, compact, and clustered short-option forms. Full-resource GETs retain the existing durable cache path and cache-key contract.User Impact
Pull requests with active requested reviewers or teams are no longer exposed to auto-close eligibility because another call site cached a differently projected body.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes apply-lane GitHub read admission only and does not alter Bay data contracts, status, or navigation.
Documentation Impact
No documentation update is required. The existing ETag broker contract remains unchanged; this narrows broker admission for response projections.
Evidence
node --version(v24.16.0)pnpm run build:allnode --test test/github-etag-read-broker.test.ts(6/6 passed)pnpm run check:staticpnpm run lintgit diff --check origin/main...HEADpnpm run checkpassed static checks, all builds, lint, and changed coverage before the exhaustive suite reached an unrelated local-review fixture that did not terminate; hosted CI remains authoritative for the full gate.Real Behavior Proof
Claim
Projected GitHub reads execute their requested projection directly instead of consulting or replaying the durable ETag broker.
Exercised Surface
The built production
createGitHubRuntime().ghWithPreparedTimeout()path under exact event publication, using real read-onlygh apicalls and an intentionally unreachable broker endpoint.Scenario And Environment
Node 24 and GitHub CLI 2.92.0 read an existing public ClawSweeper pull request using split, attached, compact, and clustered projections. The broker endpoint was deliberately unavailable, so successful results demonstrate direct execution rather than broker fallback or replay.
Command
Result
All five projected reads completed through direct GitHub CLI invocations and returned their requested shapes while the broker was unreachable. Production mutations: 0.
Recorded after-fix output for head
c6c0908b99ff824a0a83abe922e0b4a7c136b1a4:{ "exactEventPublication": "true", "brokerEndpointReachable": false, "directGhInvocations": 5, "firstProjectionReturnedBody": true, "secondProjectionReturnedReviewerArrays": true, "attachedProjectionReturnedState": true, "compactProjectionReturnedState": true, "clusteredProjectionReturnedHeadersAndState": true, "productionMutations": 0 }Limits
The live proof is read-only and did not run a live
apply-decisionsclose attempt. Full-resource GET broker behavior remains covered by the existing focused tests.Disclosure: AI was used to understand the codebase and review the fix.