Skip to content

improve(secrets): limit expiry metadata to transient credentials - #146882

Merged
vincentkoc merged 1 commit into
mainfrom
perf/gateway-expiry-metadata-20260913
Sep 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
perf/gateway-expiry-metadata-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member
Additional instructions

Allow edits from maintainers is enabled.

What Problem This Solves

Resolves a problem where periodic Gateway cleanup materializes metadata for unrelated saved credentials while looking for expired GitHub setup and device handoffs. The unnecessary JavaScript work grows with the credential store.

Why This Change Was Made

Filter the two transient name prefixes in the owning secret-store query before materializing rows. Keep exact name classification and expiry decisions in the existing classifier. Deleted-row retention, all scopes and kinds, and the deletion transaction are unchanged. No schema, config, permission, or public API changes.

Production delta: +7 lines for the query boundary; tests: +122 lines. The improvement is reduced metadata returned to JavaScript, without an index-seek, disk-I/O, or end-to-end latency claim.

User Impact

The periodic cleanup does less unnecessary work as saved credentials accumulate. Setup and device handoffs expire on the same schedule, and other saved credentials remain unchanged.

Evidence

  • All 28 focused store tests pass with real SQLite.
  • Three regression cases cover UTF-8, UTF-16LE, and UTF-16BE. They compare deletion counts and complete retained rows before checking that unrelated metadata materialized falls from 66 records to zero.
  • Replaying the original production query makes all three new cases fail only at that materialization assertion; deletion and retention parity still pass.
  • Coverage includes exact setup/device deadlines, malformed names, team and identity scopes, secret and environment kinds, durable GitHub credentials, and the exact deleted-row retention boundary.
  • Targeted type checking, formatting, and git diff --check pass.
  • Independent P0-P2 autoreview: scoped clean.
  • The optional Gateway personal-credential caller test could not start because the borrowed local dependency install lacks import-meta-resolve; no caller-test pass is claimed. Required hosted checks remain pending.
  • No production deployment or end-to-end latency measurement is claimed.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 08:37
@vincentkoc
vincentkoc requested a review from a team as a code owner September 13, 2026 08:37
@vincentkoc
vincentkoc force-pushed the perf/gateway-expiry-metadata-20260913 branch from 2e6bdee to 35eda9f Compare September 13, 2026 09:03
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review current head 35eda9f3201ad3dd5c64a2a2ab3d322543fdc52f. The scoped corrections and current-base integration have been independently reviewed; exact-head CI remains authoritative.

@clawsweeper

clawsweeper Bot commented Sep 13, 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:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 6:00 AM ET / 10:00 UTC (Revision 2).

ClawSweeper review

What this changes

The PR filters credential-expiry metadata in SQLite before loading it into JavaScript and adds regression coverage for unchanged deletion behavior.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, focused optimization absent from current main and the latest release. No actionable introduced defect was found; the earlier merged optimization addresses a different query.

Priority: P2
Reviewed head: 9be9c681977214e3158e7c99f8fa94b78a7570f7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with meaningful parity coverage and no actionable findings; owner-review participation remains a separate workflow requirement.
Proof confidence 🌊 off-meta tidepool Not applicable: The member-authored PR is exempt from the external proof gate. Its captured body reports real-SQLite tests of the purge owner, including unchanged retained rows and reduced metadata results; it makes no production latency claim, and the diff does not materially change authority.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored PR is exempt from the external proof gate. Its captured body reports real-SQLite tests of the purge owner, including unchanged retained rows and reduced metadata results; it makes no production latency claim, and the diff does not materially change authority.
Evidence reviewed 9 items Verified introduced production change: The pinned merge-base-to-head diff adds only the two name-range predicates to the expiry SELECT. Exact classification, deadlines, scope-qualified deletion, and the existing transaction remain unchanged.
Current main still materializes unrelated metadata: Current main selects all live rows meeting the age threshold before classifying their names in JavaScript; the proposed prefix filter is absent.
Latest release comparison: The supplied latest release, v2026.9.4, contains the same unfiltered expiry SELECT, so it does not already provide this optimization.
Findings None None.
Security None None.

How this fits together

The shared secret store holds saved credentials and temporary GitHub authorization records. Gateway maintenance periodically asks it to remove expired records while retaining ordinary credentials.

flowchart TD
 A[Gateway maintenance] --> B[Secret store cleanup]
 C[Stored credential rows] --> B
 B --> D[Deleted-row retention cleanup]
 B --> E[Transient prefix and age filter]
 E --> F[Exact name and expiry checks]
 F --> G[Delete expired handoffs]
 D --> H[Retained credentials]
 G --> H
Loading

Before merge

  • Resolve merge risk (P1) - Listed secops-owner participation remains unverified; a pending team review request alone does not establish the involvement required by repository policy.
  • Complete next step (P2) - Confirm that a listed secops owner authored, explicitly requested, or is actively reviewing this restricted-path change.
Agent review details

Security

None.

PR surface

Source +7, Tests +122. Total +129 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 0 +7
Tests 1 122 0 +122
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 129 0 +129

Review metrics

Metric Value Why it matters
Production versus regression coverage production +7 lines; tests +122 lines The small production addition bounds metadata materialization; the tests protect deletion parity across three SQLite encodings.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep expiry selection inside the existing store owner, with exact classification and retention semantics preserved and listed-owner participation recorded.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep expiry selection inside the existing store owner, with exact classification and retention semantics preserved and listed-owner participation recorded.

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

Yes, from source: current main materializes unrelated live credential metadata older than the cleanup threshold before filtering names. Runtime reproduction was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. The query-level prefilter follows the existing listing pattern while leaving exact expiry decisions with their current owner; no schema, configuration, or public API expansion is needed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0d1cf24318b8.

Labels

Label justifications:

  • P2: This is a bounded recurring-cleanup efficiency improvement without evidence of an urgent user-facing outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The member-authored PR is exempt from the external proof gate. Its captured body reports real-SQLite tests of the purge owner, including unchanged retained rows and reduced metadata results; it makes no production latency claim, and the diff does not materially change authority.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-09-13T09:43:42.399Z sha 35eda9f3201ad3dd5c64a2a2ab3d322543fdc52f :: blocked before merge. :: none

@vincentkoc
vincentkoc force-pushed the perf/gateway-expiry-metadata-20260913 branch from 35eda9f to 9be9c68 Compare September 13, 2026 09:47
@vincentkoc vincentkoc changed the title improve(gateway): limit expiry metadata to transient credentials improve(secrets): limit expiry metadata to transient credentials Sep 13, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The repaired head narrows the regression fixtures to the exact transient-prefix contract, preserves complete retained-row and deletion parity checks, and has refreshed focused/type/format evidence in the PR body.

@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@vincentkoc
vincentkoc merged commit 209505f into main Sep 13, 2026
188 of 193 checks passed
@vincentkoc
vincentkoc deleted the perf/gateway-expiry-metadata-20260913 branch September 13, 2026 10:29
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146883: (159 commits)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* refs/heads/temp/pr-146833: (43 commits)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-146802: (51 commits)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  fix(backup): preserve discovery under concurrent state writes (#146912)
  fix: keep queued deliveries in their original state directory (#146917)
  fix(discord): settle voice waveform work before releasing input (#146885)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
…ssion-list-roster-batch-20260913

* commit 'f513c0f345f7f2514c49ccfbc00adc3f78b9a755': (46 commits)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  improve(infra): reduce scheduling work for session notice bursts (#146818)
  improve: prepare Gateway skill commands asynchronously (#146812)
  improve(agents): skip unused assistant delivery parsing (#146858)
  improve(ui): reuse date formatters across timestamp lists (#146789)
  fix(tests): isolate installer and Docker shell snippets (#146897)
  test(heartbeat): share explicit channel configuration fixtures (#146853)
  fix: retain conversation reply claims through write admission (#146866)
  perf(sessions): bound history reads and stabilize cursor paging (#146770)
  fix(ui): let slow dashboard downloads finish before recovery (#146881)
  fix: share Doctor lifecycle coordination with SQLite workers (#146714)
  fix: retain native session model provenance (#146801)
  fix: settle embedded transcript repairs before session cleanup (#146842)
  feat(macos): improve agent navigation and chat layout (#146531)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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