Repository navigation
fix: keep background work scoped to its selected agent - #123257
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 13, 2026 16:21
Scoped route, session, and job owners now survive hooks, cron, process exits, global delivery, bindings, and media cleanup. Truly ownerless operations remain explicit errors.
steipete
force-pushed
the
steipete/ecstatic-ramanujan-bfd2e3
branch
from
August 13, 2026 17:04
ff5e222 to
a4f7c6c
Compare
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 14, 2026
* fix: preserve explicit agent ownership Scoped route, session, and job owners now survive hooks, cron, process exits, global delivery, bindings, and media cleanup. Truly ownerless operations remain explicit errors. * test: provide session memory hook owner * test(ui): close failed-module page explicitly * test(matrix): align ownership and replacement proof
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #123256
What Problem This Solves
Fixes an issue where explicit multi-agent installations could repeatedly fail background and lifecycle operations when those operations crossed hooks, cron, process-exit, binding, global delivery, or media-cleanup boundaries. Production logs recorded 2,542
AgentSelectionRequiredErrorentries in under 12 hours even though many producers already had an authoritative agent owner.Why This Change Was Made
This repair establishes one canonical owner-propagation flow: scoped route, session, and job owners are consumed before legacy compatibility; required owner fields cross async boundaries; and raw
globaldelivery receives sideband ownership. Legacy raw-global aliases keep optional compatibility metadata, while unbound or genuinely ownerless work still fails closed with actionable selection errors.Non-goals are the excluded Slack thread-context freshness path and three separately tracked follow-ups: owner-aware Slack/Discord global system events, early external-hook failure ownership, and targetless system lifecycle events.
User Impact
Operators with explicit multi-agent rosters no longer need to configure or revive a global default for work that already belongs to a selected agent. Cron alerts, session hooks and memory, process completion notices, bindings, global WebSocket delivery, provider abort, managed media, Talk, ClickClack, Matrix, Feishu, and Discord binding ownership remain scoped. Genuinely ownerless operations continue returning actionable selection or configuration errors.
Evidence
AgentSelectionRequiredErrorentries from 00:10Z to 12:01Z on 2026-08-13, including diagnostic 655, hooks 509, heartbeat 314, Slack 117, Discord 22, and gateway/health/ws plus unclassified paths. Host identity is redacted.env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false corepack pnpm check:changed. It covered formatting, dead exports, core/core-test/extensions/extension-test tsgo, core/extension lint, import cycles, plugin boundaries, storage/database guards, and architecture guards.run_01bd9183bf48/ leasecbx_cd64eebc73e9passed the early guards but lacked workspace modules for the dead-export scan. Later Blacksmith, Daytona, Azure, and AWS readiness checks found no ready provider, so the trusted-source local fallback was used per policy. The changed gate was not remote-green.finally; the focused file passes 9/9 in 18 seconds.31728940686passedopenclaw/ci-gate: 105 successful checks, 35 scoped skips, 1 neutral, no pending checks or failures.git diff --checkwas clean, and the eager-fallback production scan found no matches:rg -n -U 'resolveAgentIdFromSessionKey\([\s\S]{0,180}?resolveDefaultAgentId\(' src extensions --glob '*.{ts,tsx}' --glob '!**/*.test.ts'.