Skip to content

fix(matrix): drain monitor tasks before retiring clients - #134033

Merged
steipete merged 5 commits into
mainfrom
codex/matrix-release-lifecycle
Aug 31, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/matrix-release-lifecycle

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Why

Full release verification found two connected causes of Matrix flow stalls. Shared-client retirement awaited monitor tasks, while a task releasing its transient client lease awaited that same retirement. Tasks acquiring a new client during retirement could produce the same cycle. Separately, the first encrypted QA flow synchronously initialized crypto after other workers had started their scenario deadlines.

The shared-client owner now lets transient child releases drain without awaiting the enclosing retirement; monitor owners still join shutdown. The existing monitor task runner owns an abort signal for each task, closes it during shutdown and settlement, and carries it through async descendants. Acquisition combines task/caller signals and rechecks after awaited auth and creation, retiring an unclaimed client when necessary. Independent callers still wait for the replacement generation. Persistence, poison handling, and shutdown deadlines remain intact.

QA suite owners prepare the factories for the actual selected scenarios before starting workers, after invalidating prior artifacts. Matrix initializes its existing crypto runtime only when an encrypted scenario is selected. Ready factory copies flow into child partitions, preventing repeated cold setup. This callback is private to QA Lab; no Plugin SDK, configuration, schema, or protocol surface is added.

Validation

  • Before/after failures cover normal and forced retirement, transient release and late acquisition, retained async descendants, and cancellation during authentication/client creation. Existing sibling lifecycle tests remain intact.
  • Canonical preparation regressions cover dedicated/generic commands, default and explicit selections, unified partitions, plaintext-only selection, initialization failure, and prior artifact invalidation. The old implementation reproduced the intended failures; final focused coverage has 149 QA tests across eight files plus 73 Matrix lifecycle tests across five files, all passing. The nine new monitor-task cases and existing factories were moved unchanged into focused test/support files, preserving every assertion.
  • Native live Matrix run: 93 passed, zero failed or skipped, default concurrency four, original order and deadlines, no observer, fresh task caches. This exercised real Gateway/homeserver flows, encrypted rooms, negative allowbots policies, membership loss, and the scenarios following shutdown.
  • That full run took 623.359s. Its runtime build used the already-landed ciArtifacts optimization and took 99.37s versus the earlier full build's 361s. This is an observed comparison, not a controlled cold-machine benchmark.
  • Live-run Matrix production bytes match the final candidate. Subsequent QA changes only move initialization behind artifact invalidation and repair type/test-fixture details; the final focused success/failure tests cover those paths. All ten touched base files are byte-identical between native proof base ba108ad and branch base afd1a36d.
  • All checks in the actual twelve-path changed-files gate passed, including both complete lint batches, production/test types, and final architecture/import-cycle guards. All twelve source hashes match published head 318630cc1b95998d80409f66b5afd56a76276c80. Native gate is complete and its lease is closed. Required exact-head GitHub CI remains the final merge gate. Managed Codex review of the complete 14-file change is scoped-clean at P0–P2 with no actionable findings.

Runtime production delta: +33 net lines for task-owned cancellation and retirement ordering. Private QA harness: +84 net lines for one canonical selected-scenario preparation path across both suite entry points. Tests/test support: +382 net lines (including the explicit setup for the split test file; pure moves are not new behavior). One maintainer changelog entry records the user-visible lifecycle fix. There are no increased timeouts, removed scenarios, weaker assertions, or new runtime fallbacks.

This repairs the Matrix lane, not a claim that the complete release verification is green. The next full run will exercise the combined landed fixes and normal Windows upgrade lane.

Review and CI disposition

The latest ClawSweeper review found no runtime defect and asked for the changelog entry to be removed and exact-head validation to finish. The changelog entry is intentionally retained under the maintainer's explicit instruction to document a user-facing fix. Native lifecycle, QA, lint and changed-files gates are complete; exact-head CI is required before merge. The owner-boundary rationale for production growth is recorded above.

The first hosted CI run (33381180651) had 79 jobs fail at checkout, followed by the aggregate gate failure. The representative log shows GitHub authentication challenges during partial-clone object fetch, before install/build/tests; the same checkout implementation and merge commit succeeded on another runner. No credential policy, timeout, retry count or test was weakened. Final-head CI will establish whether the checkout failure recurs.

The hosted retry of final-head CI recovered all 17 checkout-failed jobs, then exposed one unrelated sandbox-prompt fixture timeout. That fixture omitted the model ID from its prepared provider handle, unlike the real attempt setup and its sibling fixture, causing cold provider discovery before a sandbox assertion. The follow-up supplies the existing matching model ID only. In a fresh native comparison, the unchanged assertion took 71.980 seconds and the corrected assertion took 0.103 seconds; the original full prompt file passed 12 tests, and the corrected whole prompt plus setup sibling passed 25. No runtime code, deadline, assertion, or provider behavior changed. Full 14-file managed review remains scoped-clean at P0–P2. The final one-fixture native changed gate passed in 851.058 seconds, including all 16 core-test type graphs. The fixture and the twelve unchanged Matrix/QA source hashes match published head 6934b8f3a6be45d902f6af4dc23085d1a95677ea. Native fixture proof is complete and its lease is closed. Required exact-head CI remains the final merge gate.

A subsequent run (33386164105) exposed an independent race in the fake container engine: delayed startup could rewrite a removed identity, and forced removal did not kill the worker. Production correctly rejected the still-live container and retained capacity. The test fixture now serializes daemon state transitions with the existing filesystem lock, rereads ownership after startup waits, and kills the current worker before removal. Its obsolete atomic-rename workaround is removed. Deterministic regressions failed on the unchanged fixture, then passed with the repair; the original cancellation test remains unchanged. All 85 tests across five complete supervisor suites and targeted lint passed. The two-file follow-up has a separate scoped-clean Codex review at P0–P2, while the original fourteen reviewed files remain byte-identical. This adds 97 net test/support lines and zero production lines. The native proof completed all checks in the actual two-path changed gate, including 634.79 seconds of core-test typechecking. Final source hashes match published d1651de84cd338864701cf1d83fa903edcfa148e; its lease is independently verified completed. The new exact-head CI is required before merge. The other failure in the preceding run was an explicit runner shutdown during lint, with no lint diagnostic.

@clawsweeper

clawsweeper Bot commented Aug 31, 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 channel: matrix Channel integration: matrix extensions: qa-lab size: L maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 31, 2026, 8:11 AM ET / 12:11 UTC.

ClawSweeper review

What this changes

The PR lets Matrix monitor tasks drain without deadlocking shared-client retirement, rejects task-bound late client acquisitions, and prepares encrypted Matrix QA scenarios before worker deadlines begin.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main still has the retirement cycle this PR addresses. The lifecycle repair is owner-boundary aligned and covered by focused tests, but the release-owned changelog edit remains an actionable P3 concern; exact-head checks are also still running.

Priority: P1
Reviewed head: d1651de84cd338864701cf1d83fa903edcfa148e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair is well-targeted and source-covered, with one release-note ownership cleanup and normal exact-head CI completion remaining.
Proof confidence 🌊 off-meta tidepool Not applicable: The captured PR body reports a native Matrix run spanning encrypted and shutdown scenarios; Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The captured PR body reports a native Matrix run spanning encrypted and shutdown scenarios; Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply.
Evidence reviewed 7 items Current-main failure shape: Current main gives every force-released lease the enclosing retirement promise, and a final monitor release begins retirement whenever the last lease disappears; a task that releases its transient lease can therefore await the same retirement that is waiting for that task.
Lifecycle repair at the owner: The branch makes only monitor leases join forced shutdown, prevents a transient release from starting another retirement once closure began, and combines the monitor task signal with caller cancellation before client admission.
Monitor caller and task boundary: The monitor registers task admission closure, listener detachment, and idle waiting with its shared-client lease; detached tasks receive an abort signal that closes both during monitor shutdown and after task settlement.
Findings 1 actionable finding [P3] Remove the release-owned changelog entry
Security None None.

How this fits together

Matrix monitors share client generations with transient operation leases; retiring a monitor must stop new work while allowing its already-started tasks to finish. QA Lab selects live transport scenarios and prepares channel-specific runtime prerequisites before launching worker partitions.

flowchart LR
  A[Matrix monitor events] --> B[Detached monitor tasks]
  B --> C[Shared client leases]
  C --> D[Client retirement]
  D --> E[Persisted shutdown]
  F[Selected Matrix QA scenarios] --> G[Encrypted-runtime preparation]
  G --> H[QA worker partitions]
Loading

Before merge

  • Remove the release-owned changelog entry (P3) - CHANGELOG.md is reserved for release generation, while this PR body already records the user-facing context. This unchanged entry was raised in the prior review cycles; remove it unless a release owner records a specific exception.
  • Resolve merge risk (P1) - The repair adds production lifecycle and QA-preparation code (+117/-24); the new task ownership and pre-worker preparation responsibilities justify the growth, but shared-client shutdown remains availability-sensitive until exact-head validation completes.
  • Resolve merge risk (P1) - The added release-owned changelog line conflicts with the repository’s normal-PR policy unless a release owner has explicitly recorded an exception.
  • Complete next step (P2) - This maintainer-owned PR needs its normal final-head validation and a resolution of the release-owned file edit; a repair job is not appropriate.

Findings

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:74
Agent review details

Security

None.

PR surface

Source +180, Tests +416, Docs +1. Total +597 across 16 files.

View PR surface stats
Area Files Added Removed Net
Source 10 251 71 +180
Tests 5 464 48 +416
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 716 119 +597

Review metrics

Metric Value Why it matters
Production versus test delta production +117/-24 (net +93); tests/support +574/-95 (net +479); release-owned changelog +1 The production growth is split between task-owned shutdown cancellation and centralized QA preparation; the remaining changes are focused regression and fixture coverage.

Merge-risk options

Maintainer options:

  1. Complete final-head lifecycle validation (recommended)
    Merge after the exact-head checks finish green for the shared-client retirement and QA paths.
  2. Pause for a narrower repair
    If final validation exposes ordering fallout, keep the owner-boundary fix and narrow only the failing lifecycle path before retrying.

Technical review

Best possible solution:

Keep the owner-level retirement and selected-scenario preparation design, remove the release-owned changelog entry while preserving its user-facing context in the PR body, and land only after the final-head validation is green.

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

Yes—current main’s shared-client release ordering directly establishes the circular wait, and the new focused regression cases exercise both normal and forced retirement. This read-only review did not execute the reproduction.

Is this the best way to solve the issue?

Yes—the patch repairs task admission and client retirement at their owning boundaries instead of masking the stall with a timeout or retry. The unrelated release-owned changelog edit is not part of that solution.

Full review comments:

  • [P3] Remove the release-owned changelog entry — CHANGELOG.md:74
    CHANGELOG.md is reserved for release generation, while this PR body already records the user-facing context. This unchanged entry was raised in the prior review cycles; remove it unless a release owner records a specific exception.
    Confidence: 0.96

Overall correctness: patch is correct
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The PR repairs a Matrix monitor retirement cycle that can stall a live channel workflow.
  • merge-risk: 🚨 availability: Shared-client retirement and task cancellation ordering can stall Matrix monitoring if the lifecycle invariant regresses.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The captured PR body reports a native Matrix run spanning encrypted and shutdown scenarios; Repository State identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply.

Evidence

What I checked:

  • Current-main failure shape: Current main gives every force-released lease the enclosing retirement promise, and a final monitor release begins retirement whenever the last lease disappears; a task that releases its transient lease can therefore await the same retirement that is waiting for that task. (extensions/matrix/src/matrix/client/shared.ts:301, 4716cbfe4bb9)
  • Lifecycle repair at the owner: The branch makes only monitor leases join forced shutdown, prevents a transient release from starting another retirement once closure began, and combines the monitor task signal with caller cancellation before client admission. (extensions/matrix/src/matrix/client/shared.ts:303, d1651de84cd3)
  • Monitor caller and task boundary: The monitor registers task admission closure, listener detachment, and idle waiting with its shared-client lease; detached tasks receive an abort signal that closes both during monitor shutdown and after task settlement. (extensions/matrix/src/matrix/monitor/index.ts:296, d1651de84cd3)
  • Focused regression coverage: The added tests cover monitor release and forced account stop with both transient release and late acquisition, plus retained descendants and cancellation while auth or client creation is pending. (extensions/matrix/src/matrix/client/shared.monitor-tasks.test.ts:55, d1651de84cd3)
  • QA preparation is centralized before workers: Both direct flow execution and unified-suite execution call the same factory preparation owner after artifact invalidation and before passing factories to child workers; Matrix loads crypto only when a selected topology has an encrypted room. (extensions/qa-lab/src/qa-transport-registry.ts:42, d1651de84cd3)
  • Introduction provenance: The principal Matrix lifecycle changes first appear in the PR's initial commit, whose raw recorded parent is the verified merge base; the parent-to-commit diff changes the implicated shared-client and task-runner behavior. (extensions/matrix/src/matrix/client/shared.ts:303, 0ed8f5ab64e3)

Likely related people:

  • Ben.Li: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the release-owned CHANGELOG.md entry while retaining the release context in the PR body.
  • Let the required exact-head checks complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-31T10:16:15.952Z sha 3638c12 :: found issues before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-08-31T10:31:52.475Z sha 318630c :: found issues before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-08-31T11:26:03.551Z sha 6934b8f :: found issues before merge. :: [P3] Remove the release-owned changelog entry
  • reviewed 2026-08-31T12:00:30.502Z sha d1651de :: found issues before merge. :: [P3] Remove the release-owned changelog entry

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Aug 31, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 31, 2026
@steipete
steipete merged commit 3ee32fb into main Aug 31, 2026
210 of 212 checks passed
@steipete
steipete deleted the codex/matrix-release-lifecycle branch August 31, 2026 12:38
steipete added a commit that referenced this pull request Aug 31, 2026
* fix(gateway): keep Talk agent consult input out of user chat history

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes #133855

* ci: resolve OpenGrep base before fetching history (#134054)

* test(scripts): batch distribution import fixtures (#134039)

* fix(update): retain pnpm owner across launcher respawn

## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes #134037

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(parallel): check version header at request boundary (#133891)

* fix(matrix): drain monitor tasks before retiring clients (#134033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions

* fix(channels): isolate unavailable accounts from gateway diagnostics (#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture

* fix(config): preserve owners across legacy roster imports and store changes (#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model

* fix(talk): keep Browser Talk agent-consult turns out of user chat history (#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes #133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>

* fix: preserve policy owners across reviews and compaction (#133912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture

* fix(doctor): prune stale path install records shadowed by load paths (#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(secrets): collect persona-level TTS provider SecretRefs (#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of #89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>

* fix(gateway): preserve literal Talk consult questions

Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: Wynne668 <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: lsr911 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…4033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
* fix(gateway): keep Talk agent consult input out of user chat history

Browser Talk agent consults submitted their flattened orchestration
input through the ordinary chat.send path, persisting a synthetic
user-authored turn alongside the real spoken transcript. Dispatch
consults through the trusted internal channel instead: system-turn
formatted message, deliver: false, suppressed command interpretation,
and internal_system provenance, plus a new hideFromDisplay internal
option that persists the turn with display: false so the history
projection, exports, and compaction all exclude it while the delegated
agent still receives the full structured consult input.

Fixes openclaw#133855

* ci: resolve OpenGrep base before fetching history (openclaw#134054)

* test(scripts): batch distribution import fixtures (openclaw#134039)

* fix(update): retain pnpm owner across launcher respawn

## Summary

- Preserve the lexical package entry through the packaged compile-cache respawn.
- Refuse package updates when no package manager owns the active package root.
- Keep pnpm ownership tied to one active global project, never its shared-store realpath.

## Problem

`openclaw update --dry-run` could classify a pnpm 11 global install as npm after the launcher respawned through the shared-store package path. A real update could then create a second npm install while the pnpm-owned Gateway stayed on the old package.

## Root cause

The packaged compile-cache respawn replaced the pnpm-generated hash-link entry in `process.argv[1]` with `import.meta.url`. The latter resolves to shared package content and has no global-project ownership identity. Manager detection then fell through to npm.

## Fix

The launcher passes the lexical entry to its child. Existing pnpm owner discovery then resolves the exact active project, carries its prepared install target through dry-run and mutation, and rejects grouped, multiple, orphaned, or mismatched owners. Package roots with no proven owner now stop before stale-handoff cleanup, with recovery guidance, instead of falling back to npm.

## Proof

- Red: a real isolated pnpm 11.25.0 global install of `[email protected]` reported `mode: npm` when compile-cache respawn was active.
- Green: the same non-mutating dry-run on the repaired launcher reported `mode: pnpm` and the active hash-linked project root.
- The green trace contains only pnpm probes and no npm command.
- The complete pnpm global-project tree was unchanged after dry-run.
- Focused launcher, owner-discovery, target-carry, ambiguity-refusal, and no-cleanup tests pass: 87 passed, one platform skip.

## Size

- Production: +10/-6, net +4 lines for lexical ownership preservation, fail-closed package detection, and pre-mutation cleanup ordering.
- Tests: +69 lines at the launcher, command, and package-owner boundaries.

Fixes openclaw#134037

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(parallel): check version header at request boundary (openclaw#133891)

* fix(matrix): drain monitor tasks before retiring clients (openclaw#134033)

* fix(matrix): drain monitor tasks before retiring clients

* test(matrix): split monitor task lifecycle coverage

* refactor(qa): pass prepared factories into suite children

* test(agents): preserve prepared model identity in prompt fixture

* test(node-host): serialize fake container state transitions

* fix(channels): isolate unavailable accounts from gateway diagnostics (openclaw#134044)

* fix(channels): isolate unavailable accounts from gateway diagnostics

* refactor(channels): consolidate status lookup and health fixtures

* refactor(channels): remove obsolete account context resolver

* test(agents): complete the prepared provider handle fixture

* fix(config): preserve owners across legacy roster imports and store changes (openclaw#133920)

* fix(config): preserve owners when importing legacy rosters and changing stores

* test(buzz): await account readiness before testing recovery

* docs(config): clarify root-file ownership transitions

* test: bind sandbox prompt fixture to its prepared model

* fix(talk): keep Browser Talk agent-consult turns out of user chat history (openclaw#133947)

* fix(talk): keep Browser Talk agent-consult turns out of user chat history

Browser Talk's realtime agent-consult bridge (startTalkRealtimeAgentConsult)
submitted the provider's flattened consult question/context/style through an
ordinary chat.send, so it persisted, broadcast, and rendered as a normal
user-authored turn (visible after reload/export) alongside the real spoken
transcript.

Mark that synthetic turn with systemInputProvenance
{ kind: "internal_system", sourceTool: "talk_agent_consult" } so it is never
attributed to the participant and route both the toolsAllow and unrestricted
chat.send branches through the existing trusted-internal-input contract that
already backs it. Hide user-role turns carrying that provenance from the
shared display-history projection (the same seam that already hides
subagent_announce/completion-report turns), which covers live rendering,
reload, and export uniformly. The forced-consult fallback re-enters the same
browser toolCall path, so it is covered without separate changes.

Closes openclaw#133855.

* fix(talk): stop the hidden Talk consult turn from persisting into raw transcript exports

The display-projection filter added in the prior commit only hides the
synthetic consult turn from rendered/reloaded history; the raw
transcript entry still persists as a full-content role:user message,
and /export-session reads raw transcript rows directly (it never runs
the display projection), so the consult text still leaked into HTML
session exports.

Mark the persisted consult turn display:false, reusing the existing
goal-resume mechanism, and redact display:false user-turn content
during export instead of dropping the row (dropping would orphan a
child entry's parentId in the exported tree).

* fix(talk): keep internal consult prompts out of chat history

Co-authored-by: chelsealong <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>

* fix: preserve policy owners across reviews and compaction (openclaw#133912)

* fix: preserve policy owners across reviews and compaction

* fix: retain policy owners through native tool construction

* fix(agents): preserve policy keys for plugin delivery

* test(codex): use prepared runtime plan in hook fixture

* fix(doctor): prune stale path install records shadowed by load paths (openclaw#133991)

* fix(doctor): prune stale path install records shadowed by load paths

* fix(doctor): persist stale path record cleanup

---------

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(secrets): collect persona-level TTS provider SecretRefs (openclaw#89636)

* fix(secrets): collect persona-level TTS provider SecretRefs

Replay of openclaw#89636 onto current main. Persona TTS apiKey SecretRefs collected; Discord registry entries included.

Signed-off-by: Sebastien Tardif <[email protected]>

* fix(secrets): resolve persona credentials through shared TTS owners

Preserve persona credential ownership across global, agent, and Discord
voice surfaces while consolidating collection and registry discovery.

Co-authored-by: Sebastien Tardif <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>

* fix(gateway): preserve literal Talk consult questions

Generated consult input must not enter chat command interpretation. Keep human Stop and dedicated voice controls unchanged.

Co-authored-by: lsr911 <[email protected]>

---------

Signed-off-by: Sebastien Tardif <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: chelsealong <[email protected]>
Co-authored-by: Wynne668 <[email protected]>
Co-authored-by: Sebastien Tardif <[email protected]>
Co-authored-by: lsr911 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: matrix Channel integration: matrix extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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