Skip to content

fix: keep automation delivery owned in multi-agent fleets - #123283

Merged
steipete merged 4 commits into
mainfrom
codex/fix-ambient-agent-owner
Aug 13, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/fix-ambient-agent-owner

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #77700

AI-assisted: yes

What Problem This Solves

Fixes an issue where heartbeat and isolated cron runs owned by a configured agent could finish successfully but fail while delivering their result in an explicit multi-agent fleet. The final delivery path discarded the admitted agent owner and attempted ambient default-agent selection, producing AGENT_SELECTION_REQUIRED after the model had already completed its work.

Why This Change Was Made

Outbound preparation, channel handler creation, durability checks, channel resolution, and durable recovery now carry the existing session agentId into lazy channel bootstrap. Bootstrap uses that owner only for agent-scoped workspace discovery and keys cached outcomes by owner plus channel; genuinely ownerless calls still fail closed. The same owner invariant now avoids eagerly resolving a default agent when an account-scoped conversation binding already contains an agent-scoped session key.

The production growth (+91/-29, net +62) is the typed ownership boundary needed to keep live delivery and persisted replay on the same admitted agent. Tests are +105/-1; docs/changelog are +2/-1.

User Impact

Operators with explicit multi-agent ownership can receive heartbeat and cron results from the correct agent workspace. Delivery replay and reconciliation keep the original owner after a restart, and ownerless operations remain selection errors rather than silently choosing another agent.

Evidence

  • Live clawstudio logs showed an owned cron session complete normally, followed by AgentSelectionRequiredError during final delivery.
  • Frozen pre-fix source 2a70d849e8a8bde3d66562bc441d96fb95388baf plus the new regressions: 3 intended failures, including the exact outbound-preparation stack through resolveChannelOutboundDirectiveOptions and channel-bootstrap.runtime.ts.
  • Fixed head 59ead899663c945772864400d805b021d25d05fc: 6 focused files, 345 tests passed across outbound bootstrap, durable queue recovery, agent delivery, account-scoped bindings, and cron delivery targeting.
  • Classified changed gate passed: core production/test typechecks, lint, formatting, dead exports, import cycles, and repository guards.
  • pnpm check:docs passed: formatting, Markdown lint, MDX, glossary, 6,482 internal links with 0 broken, and config examples.
  • git diff --check passed.
  • Autoreview: .agents/skills/autoreview/scripts/autoreview --mode local returned no accepted/actionable findings (overall correct 0.96).

Proof gap: no source-blind live send was run for this head. Blacksmith Testbox tbx_01kzy4sxqr5s80etyrvt4qtd84 remained queued for 3m56s and was stopped; the owned AWS fallback was unavailable because this host has no managed Crabbox broker login. The deterministic owner-boundary regression and all classified checks are green, but they are not presented as live channel proof.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Aug 13, 2026
@steipete
steipete marked this pull request as ready for review August 13, 2026 18:23
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 13, 2026
@steipete steipete self-assigned this Aug 13, 2026
@steipete
steipete merged commit 927a97c into main Aug 13, 2026
125 checks passed
@steipete
steipete deleted the codex/fix-ambient-agent-owner branch August 13, 2026 19:52
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant