Repository navigation
fix(gateway): skip startup publication checks without a target - #174453
Conversation
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]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +90, Docs 0. Total +95 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 1:12 PM ET / 17:12 UTC. |
|
Merged via squash.
|
…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)
…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
…/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
…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]>
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
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 --checkContributor credit: @vincentkoc (QA direction and scoped fix authorization).
Work sessions
View the OpenClaw team session