Skip to content

fix(gateway): skip startup publication checks without a target - #174453

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/qa-startup-read-queue-20261016-1608
Oct 16, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/qa-startup-read-queue-20261016-1608

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes unnecessary background GitHub publication checks during Gateway startup and session updates when sessions have no repository workspace or managed worktree.

User Impact

Sessions without a publication target no longer add avoidable ordered database reads during automatic discovery. Eligible sessions still prepare asynchronously, and explicit publication requests retain their on-demand fallback. No configuration changes or migration are required.

Why This Change Was Made

The existing discovery owner can use resident session binding facts before scheduling preparation. When a binding disappears, deleting its existing discovery entry also makes the existing queued and in-flight guards discard obsolete work and late results. This keeps one owner and preserves FIFO admission, identity checks, expiry, and shutdown behavior.

This is a narrow reduction in unnecessary background work, not a claim to resolve every startup delay.

Evidence

  • Regression before the runtime change: 3 failed, 6 passed (28.39 s wrapper). Final discovery suite: 10 passed (23.22 s wrapper), covering targetless startup/updates/invalidations, adding either target type, queued removal, pending removal/rebinding, and existing explicit-demand/lifecycle behavior.
  • Isolated real Gateway, synthetic 32-session fixture plus parent: discovery calls and ordered reservations 33 → 0; worker reservations 37 → 37; readiness HTTP 200 before and after. Explicit two-store positive control retained 2 rows / 2 reservations. After: 6.855 s test / 32.29 s wrapper. Counts are reservations, not SQL statements.
  • Incognito/no-projection nonblocking-turn sibling passed (28.08 s wrapper). Production and Gateway-test typechecks, targeted lint/format, MDX validation, and diff whitespace checks passed. Independent full-context review found no P0–P2 findings.
  • Estimated incremental test execution is <0.1 s, based on approximately 18 ms for the new local cases; this is not a hosted CI measurement. Broad exact-head PR CI remains the landing gate. No visual change or external GitHub credentials were needed for runtime proof.
Focused validation commands
node scripts/run-vitest.mjs src/gateway/github-publication-discovery.test.ts --maxWorkers=1
node scripts/run-vitest.mjs src/gateway/github-publication-availability.worker.test.ts --maxWorkers=1 -t 'turn cancellation and release'
node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.gateway-root.json --incremental
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/gateway/github-publication-discovery.ts src/gateway/github-publication-discovery.test.ts
node_modules/.bin/oxfmt --check src/gateway/github-publication-discovery.ts src/gateway/github-publication-discovery.test.ts docs/gateway/config-tools/github-identity.md
node scripts/check-docs-mdx.mjs docs/gateway/config-tools/github-identity.md
git diff --check

Contributor credit: @vincentkoc (QA direction and scoped fix authorization).

Work sessions


View the OpenClaw team session

Use resident binding facts to avoid impossible automatic preparation and retire
queued or in-flight facts when a publication target is removed. Preserve
eligible asynchronous discovery and explicit-demand fallback.

Co-authored-by: vincentkoc <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 16, 2026 16:56
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S labels Oct 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR skips automatic GitHub publication discovery for sessions without a repository workspace or managed worktree and retires facts when bindings disappear.

Example: An isolated Gateway starts with 32 targetless sessions plus their parent.

  • Before: The PR reports 33 discovery calls and ordered reservations.
  • After: The PR reports zero discovery calls and reservations, unchanged worker reservations, and successful readiness.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-supported optimization with useful lifecycle regressions, reported real-Gateway verification, and passing exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) This collaborator-authored bot PR is outside the ordinary contributor proof gate; its full body reports an isolated real Gateway exercising targetless startup, unchanged worker reservations, successful readiness, and an explicit two-store positive control.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Sessions with no publication target add avoidable background database reservations during Gateway startup and session updates.
Reason: The collaborator-authored direction is approved, the reported Gateway measurements demonstrate reduced work, and the implementation preserves eligible and explicit-demand behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes unnecessary discovery work still present on main, with no actionable introduced defects found and a passing exact-head CI gate.

Priority: P2
Reviewed head: 30120fb27a3c6ae0dc429958cd74c016d8326f77

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway background discovery consumes resident session bindings and prepares cached publication availability and identity facts for agent tools and worker launches.

flowchart TD
  A[Resident session rows] --> B[Target eligibility check]
  B --> C[Background preparation]
  D[Explicit demand] --> C
  C --> E[Published discovery facts]
  E --> F[Agent tools and worker launches]
Loading

Technical review

Best possible solution:

Merge the focused eligibility check in the existing discovery owner while preserving explicit-demand preparation and effect-point authorization.

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

Current-main source schedules targetless resident rows before the workspace owner rejects them; the PR additionally reports matched real-Gateway measurements, but no target code was executed during this review.

Is this the best way to solve the issue?

The change removes impossible work at its existing producer, matches the downstream target contract, and reuses established invalidation guards without introducing another owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 60ae44b74559.

Provenance checked

  • Automatic discovery, lifecycle regressions, and GitHub identity documentation keeps the original intent (c7fae40: Move publication and identity preparation off agent turns into one Gateway background owner while preserving synchronous fact reads and effect-point checks.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c7fae40 adds src/gateway/github-publication-discovery.ts:112 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c7fae40da22e; files: src/gateway/github-publication-discovery.ts)
  • RoboClaw: Raw commit 824fde2 adds src/gateway/github-publication-discovery.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 824fde2bfab6; files: src/gateway/github-publication-discovery.ts)

PR surface

Source +5, Tests +90, Docs 0. Total +95 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 94 4 +90
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 100 5 +95

Review metrics

Metric Value Why it matters
Production versus test growth Production +5 LOC; tests +90 net LOC The small owner-level change is supported by distinct target-addition, queued-removal, and pending-removal lifecycle regressions.

Labels

Label changes:

  • add P2: This is a bounded startup and session-update efficiency improvement without an established outage or urgent user-facing regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This is a bounded startup and session-update efficiency improvement without an established outage or urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 1:12 PM ET / 17:12 UTC.

@roboclaw-bot
roboclaw-bot merged commit 2a03d0a into main Oct 16, 2026
203 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/qa-startup-read-queue-20261016-1608 branch October 16, 2026 17:20
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 16, 2026
…158510

* commit 'cff3c307ba6d0ce273abcdaf5cade848d9746d30':
  feat(decisions): preserve native catalog capabilities and accounting (#157492)
  fix(ui): avoid reactive read warnings in picker scrolling (#174436)
  refactor(test): remove unused Nextcloud fixture signing (#174470)
  refactor(browser): share managed tab eviction fixtures (#174474)
  fix(update): preserve Windows inspection path identities (#174471)
  perf: reduce large-session compaction and indexing allocations (#174433)
  perf(codex): reduce allocations while reading app-server output (#174468)
  fix(gateway): skip startup publication checks without a target (#174453)
  refactor: deslop agent harnesses, channel plugins and packages (wave-6 bundle A) (#173531)
  perf(state): reduce shared SQLite worker heap retention (#174420)
  refactor: remove routine channel callsite diagnostics (#174402)
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…esafe-decision-native

* commit 'cff3c307ba6d0ce273abcdaf5cade848d9746d30':
  feat(decisions): preserve native catalog capabilities and accounting (#157492)
  fix(ui): avoid reactive read warnings in picker scrolling (#174436)
  refactor(test): remove unused Nextcloud fixture signing (#174470)
  refactor(browser): share managed tab eviction fixtures (#174474)
  fix(update): preserve Windows inspection path identities (#174471)
  perf: reduce large-session compaction and indexing allocations (#174433)
  perf(codex): reduce allocations while reading app-server output (#174468)
  fix(gateway): skip startup publication checks without a target (#174453)
  refactor: deslop agent harnesses, channel plugins and packages (wave-6 bundle A) (#173531)
  perf(state): reduce shared SQLite worker heap retention (#174420)
  refactor: remove routine channel callsite diagnostics (#174402)

# Conflicts:
#	src/agents/decision-inference.integration.test.ts
vincentkoc added a commit that referenced this pull request Oct 16, 2026
…/decision-tool-v2-proof-20261016

* commit 'cff3c307ba6d0ce273abcdaf5cade848d9746d30':
  feat(decisions): preserve native catalog capabilities and accounting (#157492)
  fix(ui): avoid reactive read warnings in picker scrolling (#174436)
  refactor(test): remove unused Nextcloud fixture signing (#174470)
  refactor(browser): share managed tab eviction fixtures (#174474)
  fix(update): preserve Windows inspection path identities (#174471)
  perf: reduce large-session compaction and indexing allocations (#174433)
  perf(codex): reduce allocations while reading app-server output (#174468)
  fix(gateway): skip startup publication checks without a target (#174453)
  refactor: deslop agent harnesses, channel plugins and packages (wave-6 bundle A) (#173531)
  perf(state): reduce shared SQLite worker heap retention (#174420)
  refactor: remove routine channel callsite diagnostics (#174402)

# Conflicts:
#	docs/plugins/sdk-overview/capabilities.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…law#174453)

Use resident binding facts to avoid impossible automatic preparation and retire
queued or in-flight facts when a publication target is removed. Preserve
eligible asynchronous discovery and explicit-demand fallback.

Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime 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