Skip to content

Feat/acp hub delegated sessions#91093

Closed
scotthuang wants to merge 43 commits into
openclaw:mainfrom
scotthuang:feat/acp-hub-delegated-sessions
Closed

Feat/acp hub delegated sessions#91093
scotthuang wants to merge 43 commits into
openclaw:mainfrom
scotthuang:feat/acp-hub-delegated-sessions

Conversation

@scotthuang

@scotthuang scotthuang commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: Hub sessions (WebChat, WeChat, and other main chat surfaces) need persistent external ACP harness workers without binding a Discord/Telegram thread. The existing ACP persistent path requires mode: "session" plus thread: true, which is unavailable or awkward on many hub channels.
  • Why it matters now: Dogfooding hub → Codex/Claude Code delegation from a single visible chat requires a named worker that stays alive across turns, accepts follow-ups by label, and does not echo A2A ping-pong back into the hub.
  • Intended outcome: A hub agent can sessions_spawn({ runtime: "acp", delegate: true, label?, task }), follow up with sessions_send(label=...), list owned workers via sessions_list({ delegated: true }), and operators inspect or close workers with /acp delegate list|status|close <label>. Persistent harness teardown for hub-delegated workers is operator-facing (/acp delegate close) plus maintenance idle/max-age sweeps — the same lifecycle model documented in docs/tools/acp-agents.md.
  • Success looks like: Hub-delegated workers spawn without thread binding, survive after the first task, honor follow-ups without A2A echo loops, auto-close on idle/max-age policy, and remain discoverable by label for both agents and operators.
  • Reviewers should focus on: Owner-boundary correctness for hubDelegated metadata and label follow-up, A2A skip conditions for parent-owned delegates, lifecycle maintenance/close ordering (acp.delegate.*), fail-closed ACP metadata/session-id/repair boundaries, owner-scoped label uniqueness (spawn pre-check and sessions.patch), and JSON-store vs sqlite discovery parity for operator /acp delegate vs maintenance.

ACP spawn shapes (scope boundary)

Three sessions_spawn({ runtime: "acp", ... }) paths — this PR delivers row 3 only:

Shape Persistent Thread Follow-up Close
mode: "run" No Not required Parent task announce; optional parent sessions_send Automatic after task
mode: "session" + thread: true Yes Required Messages in the bound channel thread/topic /acp close
delegate: true Yes Forbidden sessions_send(label=...) from owning hub session /acp delegate close + acp.delegate.* maintenance

This PR delivers: hub-delegated persistent workers (row 3) for WebChat/WeChat and other non-thread hub surfaces.

Does not change: row 1 (mode: "run") and row 2 (thread-bound persistent ACP). Broader decoupled-session / global session-management work stays out of scope — see Linked context.

Full product docs: docs/tools/acp-agents.md (Hub-delegated persistent workers).

Design rationale: why delegate instead of relaxing mode: "session"?

Short answer: persistence alone is under-specified. mode: "session" today means thread-visible persistent ACP (follow-up in the bound thread, close via /acp close). Hub orchestration needs a different contract: parent-owned background worker, label-routed follow-up via sessions_send, skip A2A for owner sends, and operator/maintenance close — not “same persistent session, minus thread.”

Why not { mode: "session" } without thread: true?

  • Runtime would not know follow-up surface (thread message vs hub label), visibility (channel thread vs internal worker), close owner (/acp close vs /acp delegate close + acp.delegate.*), or label rules (global vs owner-scoped).
  • That conflates at least three persistent shapes: thread-bound session, hub-delegated worker (this PR), and cron/hook affinity — each with different owner and lifecycle invariants.
  • Today mode: "session" without thread fail-closes on purpose; silently allowing it would create persistent workers without an explicit product contract.

What delegate: true buys:

  • Explicit opt-in to the hub worker bundle: hubDelegated ownership, owner-scoped labels, parent relay semantics, /acp delegate operator surface, and maintenance policy — without changing row 1 (run) or row 2 (thread session) behavior.

Relationship to #53548: this PR delivers the hub/orchestrator slice only; it does not generalize decoupled mode: "session" for all channels or requesters.

Architecture (hub → ACP worker)

Hub-delegated workers are parent-owned background ACP sessions. The hub session stays the only user-visible chat surface; the harness worker stays alive off-channel and is addressed by label, not by opening a Discord/Telegram thread.

Component map

flowchart LR
  subgraph Visible["User-visible hub surface"]
    U[User]
    CH["Channel adapter WebChat WeChat etc"]
    HUB["Hub session agent main webchat main"]
  end

  subgraph Worker["Parent-owned ACP worker background"]
    ACP["Persistent ACP session agent codex acp"]
    HX["External harness Codex Claude Code etc"]
  end

  subgraph Meta["Ownership and naming"]
    HD["hubDelegated ownerSessionKey plus label per owner"]
  end

  subgraph Lifecycle["Operator and maintenance"]
    OPS["acp delegate list status close"]
    SWP["Idle and max-age maintenance"]
  end

  U --> CH --> HUB
  HUB -->|sessions_spawn delegate true| ACP
  HUB -->|sessions_send by label| ACP
  ACP --> HX
  HUB --- HD
  ACP --- HD
  OPS --> HD
  SWP --> HD
  HUB -->|summarize or relay| CH --> U
Loading

Key invariant: the worker does not bind a channel thread/topic. Follow-ups reuse the same harness session via label; the hub agent decides what (if anything) to publish back to the visible channel.

1) Initial spawn (first task)

sequenceDiagram
  autonumber
  actor User
  participant Channel
  participant Hub as Hub session
  participant Spawn as sessions_spawn
  participant GW as Gateway
  participant Worker as ACP worker
  participant Harness as Harness runtime

  User->>Channel: task or message
  Channel->>Hub: inbound dispatch
  Hub->>Spawn: delegate true plus task and optional label
  Spawn->>GW: sessions patch hubDelegated label spawnedBy
  Spawn->>GW: initialize persistent ACP runtime
  GW->>Worker: create worker and store marker
  Worker->>Harness: run initial task
  Harness-->>Worker: progress and result
  Worker-->>Hub: optional progress stream silent notify
  Hub-->>Channel: hub agent reply
  Channel-->>User: response
Loading

Notes for reviewers:

  • No thread: true and no channel binding record is required.
  • delegate: true implies persistent mode: "session"; one-shot mode: "run" is rejected.
  • Label is optional; when omitted OpenClaw assigns delegate-YYYYMMDD-HHMMSS (UTC) and returns it in the spawn result.

2) Follow-up turns (send by label)

sequenceDiagram
  autonumber
  actor User
  participant Channel
  participant Hub as Hub session
  participant Send as sessions_send
  participant GW as Gateway
  participant Worker as ACP worker
  participant Harness as Harness runtime

  User->>Channel: follow-up message
  Channel->>Hub: inbound dispatch
  Hub->>Send: label plus message and timeout
  Send->>GW: sessions resolve label owner scoped
  GW-->>Send: worker session key
  Send->>GW: agent run and agent wait
  Note over Send,Worker: Parent-owned delegate skips A2A loop
  Worker->>Harness: continue persistent session
  Harness-->>Worker: assistant reply
  Worker-->>Send: waited reply snapshot
  Send-->>Hub: tool result
  Hub-->>Channel: hub agent relays or summarizes
  Channel-->>User: response
Loading

Notes for reviewers:

  • sessions.resolve uses owner-scoped label matching for hub-delegated workers (not global label uniqueness across owners).
  • Parent sessions_send into its own hub-delegated worker skips the A2A announce loop because the hub already owns the visible reply channel.
  • Waited sessions_send reads the worker reply from canonical chat.history; hub-delegated turns stay off visible delivery surfaces but still persist assistant/user turns to the session transcript.
  • Hub-delegated worker teardown is via /acp delegate close <label> (operator commands) and maintenance idle/max-age policy; thread-bound ACP sessions continue to use /acp close.

3) How this differs from thread-bound persistent ACP

Hub-delegated (delegate: true) Thread-bound persistent (thread: true, mode: "session")
Visible surface Hub chat only
Follow-up sessions_send(label=…) from hub
Close /acp delegate close <label>
Typical channels WebChat, WeChat, other hub surfaces

Also bundled from live dogfood on this branch:

  • P0: Fail-closed ACP runtime handle reuse after idle; force re-ensure before turn when TTL exceeded.
  • P1: When agent.wait race returns null, abort both waiters immediately so sessions_send honors timeoutSeconds (default 30s) instead of blocking for minutes.

Linked context

Which issues, PRs, or discussions are related?

Does not address:

  • Thread-bound persistent ACP (thread: true, /acp close) — unchanged.
  • Generalized decoupled mode: "session" without delegate: true.
  • Global session-management CLI/UI, cron/hook affinity reuse, channel spawn policy, and agent-tool sessions_close for hub-delegated workers (close is /acp delegate close + maintenance by design).

Was this requested by a maintainer or owner?

Local maintainer dogfood for hub → ACP delegation from WebChat/stable gateway (port 18789).

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: Hub-delegated persistent ACP workers from a main chat surface; follow-up via label; no thread binding; no A2A echo loop; operator lifecycle via /acp delegate.
  • Real environment tested: macOS local source-built OpenClaw gateway on port 18789 (~/.openclaw), WeChat hub session + WebChat delegated ACP worker session, Codex ACP harness via acpx. Close-path proof recorded against current head after the delegate label-routing close fix.
  • Exact steps or command run after this patch:
  1. From hub session: sessions_spawn({ runtime: "acp", delegate: true, agentId: "codex", task: "..." }) (with and without explicit label).
  2. Follow up: sessions_send({ label: "<label>", message: "..." }).
  3. List: sessions_list({ delegated: true }).
  4. Operator: /acp delegate list, /acp delegate status <label>.
  5. Close path (current head): /acp delegate close <label>, then /acp delegate list (expect empty), then sessions_send({ label: "<label>", message: "..." }) (expect rejected / no resolve).
  6. Regression checks for idle reconnect (>10 min) and sessions_send timeout honoring (~30s default).
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): Maintainer dogfood verified manually on stable gateway (port 18789). All proof uses screenshots (not video).

Screenshot 1 — hub-delegated ACP subagent spawn (sessions_spawn({ runtime: "acp", delegate: true, ... }); persistent mode: "session" worker created without thread: true):

acp1

Screenshot 2 — follow-up via sessions_send (hub session sends to the spawned worker by label):

acp2

Screenshot 3 — /acp delegate list empty after close (after /acp delegate close <label> on current head):

p1

Screenshot 4 — sessions_send rejected after close (follow-up with the same closed delegate label):

P3
  • Observed result after fix:

  • Hub-delegated spawn accepted without thread: true.

  • Follow-ups by label work from the same hub session.

  • sessions_list({ delegated: true }) returns owned workers.

  • A2A follow-up skipped for parent-owned hub-delegated targets (delivery.status="skipped" path).

  • Idle stale-handle reconnect and sessions_send timeout fixes verified after long-idle and short-wait scenarios.

  • Spawn/follow-up (screenshots 1–2): hub-delegated spawn succeeds without thread: true; sessions_send({ label: "<label>", ... }) reaches the persistent worker and returns a reply.

  • Close path (screenshots 3–4): /acp delegate close <label> succeeds; /acp delegate list and sessions_list({ delegated: true }) are empty afterward; follow-up sessions_send({ label: "<label>", ... }) is rejected and does not reopen the closed worker.

  • What was not tested:

  • timeoutSeconds: 0 fire-and-forget on hub-delegated follow-up.

  • Remote Crabbox/Testbox or GitHub Actions CI (local CI only; see Tests section).

  • Proof limitations or environment constraints: Proof is from a maintainer local environment, not Crabbox. Four screenshots above cover spawn, sessions_send follow-up, close, and post-close rejection; list/status and edge cases remain covered by unit tests. Duplicate-label conflict, owner-scoped label resolve, expired-delegate reactivation, and close-ordering edge cases remain covered by unit tests.

  • Before evidence (optional but encouraged): Prior dogfood without P0/P1 fixes showed long idle turns hanging until ~900s and sessions_send waits exceeding configured timeout when race waiters stacked.

Tests and validation

Which commands did you run?

# Local changed CI (Crabbox unavailable on host; remote child disabled)
env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 pnpm check:changed

pnpm test:changed

# Targeted proof during development
pnpm test packages/acp-core/src/hub-delegated.test.ts
pnpm test src/acp/hub-delegated-lifecycle.test.ts
pnpm test src/agents/acp-spawn.test.ts -t "hub-delegated|auto-generates|duplicate hub-delegated"
pnpm test src/acp/control-plane/manager.runtime-handles.test.ts
pnpm test src/acp/control-plane/manager.repair-missing-metadata.test.ts
pnpm test src/acp/runtime/session-meta.test.ts
pnpm test src/tasks/task-registry.maintenance.hub-delegated.test.ts
pnpm test src/agents/openclaw-tools.sessions.test.ts -t "hub-delegated|label resolve"
pnpm test src/config/schema.test.ts -t "hub-delegated ACP lifecycle"
pnpm test src/gateway/server.chat.gateway-server-chat.test.ts

What regression coverage was added or updated?

  • packages/acp-core/src/hub-delegated.test.ts — policy, ownership, expiry, auto-label generation/conflict suffix.
  • packages/acp-core/src/session-interaction-mode.test.ts — hub-delegated parent-owned background classification.
  • src/acp/hub-delegated-lifecycle.test.ts — JSON-store sweep without sqlite metadata, close ordering, expired-candidate resolution.
  • src/commands/agent.acp.test.ts — hub-delegated ACP turns persist to canonical transcript for waited sessions_send.
  • src/agents/acp-spawn.test.ts — delegate spawn, auto-label, delegate/thread conflict, duplicate label across ACP harness stores; concurrent auto-label suffix allocation under label lock.
  • src/agents/openclaw-tools.sessions.test.tssessions_send skip-A2A for hub-delegated targets; owner-scoped label resolve via spawnedBy.
  • src/acp/control-plane/manager.repair-missing-metadata.test.ts — hub-delegated persistent repair, one-shot repair, thread-bound binding-key repair, fail-closed with no evidence.
  • src/acp/runtime/session-meta.test.ts — fail-closed session_id drift; explicit rebind only.
  • src/tasks/task-registry.maintenance.hub-delegated.test.ts — expired delegate maintenance via JSON-store sweep and marker-first close.
  • src/config/schema.test.tsacp.delegate.* accepted by strict schema.
  • Gateway/agent tests, ACP manager runtime-handle tests, sessions patch/resolve tests, command tests — hub-delegated metadata, list filter, delegate slash commands, idle reconnect, timeout race.
  • User docs: docs/tools/acp-agents.md, docs/concepts/session-tool.md, docs/gateway/configuration-reference.md.

What failed before this fix, if known?

  • check:changed initially failed on src/agents/tools/sessions-spawn-tool.ts TS5076 (??/|| mixing); fixed with parentheses before CI green.
  • Pre-P0: reused stale ACP socket after idle caused turns to hang until long timeout.
  • Pre-P1: sessions_send could block far longer than timeoutSeconds when agent.wait race returned null but left a waiter alive.

If no test was added, why not?

Targeted unit/integration coverage was added for the main contracts above. Full channel-matrix live proof remains manual dogfood.

Risk checklist

Did user-visible behavior change? (Yes)

Yes. New hub-delegated ACP worker shape, new /acp delegate operator commands, optional auto-generated delegate labels, owner-scoped label follow-up, and user-facing docs for the flow. Existing thread-bound and one-shot ACP paths are unchanged unless the caller opts into delegate: true.

Did config, environment, or migration behavior change? (Yes)

Yes, additive only: acp.delegate.idleHours (default 72) and acp.delegate.maxAgeHours (default 168). Keys are now schema-valid with label/help metadata. No doctor migration required; defaults apply to new hub-delegated workers.

Did security, auth, secrets, network, or tool execution behavior change? (No)

No new auth surfaces. Hub-delegated workers remain parent-owned with internal delivery/control-ui session effects and silent notify policy; waited sessions_send still reads canonical session transcript via chat.history. Visibility stays scoped to the owning requester for list/close/status and label-based follow-up.

What is the highest-risk area?

Parent/child session ownership and sessions_send delivery semantics (skipping A2A while still allowing intentional parent follow-up), plus ACP runtime handle reuse after idle (P0 touch) and lifecycle closure/repair boundaries for expired or partially lost delegates.

How is that risk mitigated?

  • hubDelegated.ownerSessionKey stored in session metadata; list/close/status filter by owner.
  • Label follow-up resolves within the requester owner scope (spawnedBy / hubDelegated.ownerSessionKey).
  • A2A skip uses the same parent-owned-background classification as one-shot ACP children, extended for hub-delegated persistent workers.
  • Explicit label uniqueness enforced per owner across ACP harness stores; auto-label uses UTC timestamp + suffix on collision under the shared hub-delegated label patch lock.
  • Hub-delegated close clears hubDelegated before runtime teardown so missing-metadata repair cannot resurrect closed workers.
  • Maintenance sweeps JSON-store hubDelegated rows even when sqlite metadata is absent or drifted.
  • Missing-metadata repair requires explicit persistent evidence (hubDelegated, binding key shape, or active bindings); session_id drift is fail-closed until explicit metadata rebind.
  • P0 fail-closed on empty/missing runtime status and force re-ensure after idle TTL.
  • Tests cover spawn, send, list, delegate commands, idle handle reuse, wait timeout race, repair mode, session_id drift, label scan/ownership, maintenance expiry, close ordering, and config schema.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution. ClawSweeper proposes closing this for now: the implementation may be reasonable, but passing review and proof does not establish that OpenClaw should add this product surface.

Close: the branch appears technically sound and proof-backed, but it adds a new core ACP delegation mode, persisted session metadata, protocol/tool fields, slash commands, and lifecycle config defaults without maintainer-confirmed product direction.

This is a proposal only until the separate default-off apply policy is enabled and all live maintainer-signal checks pass. A maintainer can sponsor the direction, request a narrower version, or apply clawsweeper:human-review to keep it open.

Review details

Best possible solution:

Close unless a maintainer explicitly sponsors the hub-delegated ACP contract and lifecycle defaults; a sponsored follow-up can reuse this proof and tests or narrow the rollout.

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

Not applicable: this is a new feature PR rather than a current-main bug, and current main has no hub-delegated ACP worker implementation.

Is this the best way to solve the issue?

Yes technically for the proposed shape: explicit delegate=true is cleaner than relaxing mode=session, but the permanent product contract and defaults still need maintainer sponsorship.

Security review:

Security review cleared: No concrete secret, dependency, workflow, or supply-chain regression was found; the session ownership changes remain merge-risk/product-direction concerns rather than confirmed security defects.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: Root AGENTS.md was read fully and applied; it treats config/default additions, session state, plugin/API seams, provider/session routing, and message delivery behavior as compatibility-sensitive merge risk requiring broad review. (AGENTS.md:24, ffd8c6e5d9ab)
  • PR scope and labels: Live PR metadata shows an external contributor PR with 196 changed files, +3319/-928, proof: sufficient, proof: screenshot, feature: showcase, and merge-risk labels, with no maintainer sponsorship/protected human-review label visible. (ef05da463f11)
  • Current main does not already implement this surface: Searching current main for hubDelegated, acp.delegate, and /acp delegate under source/docs returned no implementation, so the PR is a new feature surface rather than obsolete work already on main. (ffd8c6e5d9ab)
  • New tool API: The PR adds an ACP-only delegate boolean to sessions_spawn, documented as a hub-delegated persistent worker without thread binding and followed up by sessions_send(label=...). (src/agents/tools/sessions-spawn-tool.ts:227, ef05da463f11)
  • Delegate spawn contract: The spawn path rejects delegate=true with thread=true, rejects run-mode delegates, requires an active requester session, and records owner-scoped delegate behavior. (src/agents/acp-spawn.ts:1342, ef05da463f11)
  • Config/default surface: The PR adds acp.delegate.idleHours and acp.delegate.maxAgeHours lifecycle config, with defaults of 72 and 168 hours in the ACP core helper. (packages/acp-core/src/hub-delegated.ts:14, ef05da463f11)

Likely related people:

  • steipete: Recent merged ACP metadata, ACP core extraction, session docs, ACP spawn, and maintenance work overlap with the affected surfaces. (role: feature owner; confidence: high; commits: db40fde88c6b, 7dea2837565e, 041fab7b7275; files: src/agents/acp-spawn.ts, packages/acp-core/src/session-interaction-mode.ts, src/tasks/task-registry.maintenance.ts)
  • vincentkoc: Recent task maintenance and session delivery commits touch the same cleanup and message-delivery boundaries. (role: recent area contributor; confidence: medium; commits: 0ea08076c3b5, 29e44f5eba, 126f77315f; files: src/agents/tools/sessions-send-tool.ts, src/tasks/task-registry.maintenance.ts)
  • jalehman: Added the session patch projection seam that this PR extends for hub-delegated metadata and label patching. (role: adjacent owner; confidence: medium; commits: c85bd452846b; files: src/gateway/sessions-patch.ts, src/gateway/session-utils.ts)
  • shakkernerd: Recent ACP metadata key repair work overlaps with this PR's metadata and session listing behavior. (role: recent area contributor; confidence: medium; commits: 3b7631e50db9; files: src/gateway/session-utils.ts)
  • osolmaz: Earlier ACP thread-bound agent work is the sibling persistent-session behavior this PR preserves while adding delegate mode. (role: introduced adjacent behavior; confidence: medium; commits: a7d56e3554d0; files: src/auto-reply/reply/commands-acp.ts)

Codex review notes: model internal, reasoning high; reviewed against ffd8c6e5d9ab.

@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 7, 2026
@scotthuang

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated Real behavior proof on the latest head:

  • Moved the split-screen recording URL into the Evidence after fix field (not only under the Video proof subsection), so proof parsing and reviewers see the artifact link in the required evidence slot.
  • Pushed latest code fixes on 410ca3d460f (parentSessionKey patch guard + delegated list expiry uses ACP activity).

Video: https://github.com/user-attachments/assets/226ddef2-22d1-44b2-9709-4cb2c44deb1f

Please re-check real behavior proof and the P1/P2 review items against current head.

@clawsweeper

clawsweeper Bot commented Jun 7, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 7, 2026
@scotthuang

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Latest head 534093077e6 includes:

  • ClawSweeper P1/P2 fixes (parentSessionKey patch guard; delegated list expiry uses ACP activity).
  • Real behavior proof video URL moved into Evidence after fix (see prior comment).
  • Test follow-ups: hub-delegate label resolve retry expectations (sessions.test.ts) + overflow mock typing for MiniMax reasoning field.

Please re-review proof + merge risk on current head.

@clawsweeper

clawsweeper Bot commented Jun 7, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 7, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 7, 2026
@scotthuang

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updates on current head e4db52fa069:

  • PR body trimmed: related issues reduced to the key Decouple mode="session" from thread binding requirement #53548 link; out-of-scope list consolidated (no long issue-number laundry list).
  • CI fixes pushed: synced hub-delegate gateway protocol Swift models (pnpm protocol:gen:swift) and refreshed codex-runtime prompt snapshots for the sessions tool surface drift.

Please re-review scope wording, proof, and merge readiness on this head.

scotthuang and others added 16 commits June 11, 2026 20:44
…gent registry

Validate hub-delegated lineage before persisting session-store mutations so
rejected patches cannot leave mismatched spawnedBy rows on disk. Skip
registerSubagentRun for delegate ACP spawns that already create a silent task.

Co-authored-by: Cursor <[email protected]>
Align selectAcpSessionRowForEntry with sessionId-only entry picks, skip deleted-agent
rejection for hub-delegated workers, and pass ACP metadata scope through label resolve.

Co-authored-by: Cursor <[email protected]>
Share delegate/store fixtures, table-drive acp-core pure helpers, split lifecycle
tests by close vs maintenance, and move sessions_send boundaries into a focused
suite while removing cross-layer label/owner/expiry duplicates.

Co-authored-by: Cursor <[email protected]>
Drop cross-layer duplicates for label reuse, resolve wiring, activity projection,
and concurrent auto-label suffixes; consolidate lifecycle into one file with only
close/lock/repair and a single maintenance scan test.

Co-authored-by: Cursor <[email protected]>
@batmanscode

Copy link
Copy Markdown

love the demo/tutorial, very nice :D

@clawsweeper

clawsweeper Bot commented Jun 19, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@scotthuang

scotthuang commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

This PR explored a similar direction directly inside OpenClaw core, but the resulting change set is too large and carries a broad impact surface.

To reduce risk and keep the OpenClaw core smaller, I decided to move this capability into an OpenClaw plugin instead.

The plugin implementation is here:
https://github.com/scotthuang/agent-knock-knock

Everyone is welcome to try it out, use it, and share feedback or contributions there.

I am closing this PR and will not continue pursuing this approach in the OpenClaw main repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: irc channel: line Channel integration: line channel: msteams Channel integration: msteams channel: qqbot channel: voice-call Channel integration: voice-call cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: amazon-bedrock extensions: codex extensions: copilot extensions: deepinfra extensions: diffs extensions: kilocode extensions: kimi-coding extensions: minimax feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

2 participants