Repository navigation
fix(channels): isolate unavailable accounts from gateway diagnostics - #134044
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
The final head passed the dependency check and all five core lint groups. This verifies removal of the obsolete account resolver and the earlier integration cleanup in hosted CI. The remaining failed jobs stopped during checkout with the GitHub HTTPS username error; their tests did not run. I am retrying only failed jobs on the unchanged head. The isolated built-Gateway missing/disabled/resolved credential matrix and built Slack mode proofs remain recorded in the PR; final merge still waits for the required CI result. |
|
The current head remains unchanged at The UI test file passed unchanged locally (50 cases), and its full 269-file CI composition also passed (3,607 cases, 53 skipped). A bounded trace and source audit did not identify the extra fetch's producer, so no assertion or implementation was changed. The SQLite file passed unchanged (48 runnable cases, one platform-only skip); the live MEMORY-journal case completed in 124 ms. Its source matches main. No leaked writer was found; continuous-writer contention is a possible explanation, not a proven cause. Retrying only the failed jobs on the same head. No timeout, lock policy, assertion, or production behavior was changed. The unresolved UI fetch and SQLite contention remain named follow-ups if they recur. |
|
Validation is complete on The built-Gateway matrix keeps UI, RPC and CLI diagnostics available with missing, disabled and resolved SMS credentials; degraded readiness identifies SMS while the healthy sibling remains running. Operational credential resolution remains strict. The separate built Slack inspection/health/heartbeat proof preserves HTTP and relay behavior while socket mode still requires its token. These are synthetic Gateway and transport-mode proofs, not external Slack or Twilio message claims. Earlier unchanged UI and SQLite cases passed their rerun, and the two lint jobs interrupted by runner shutdown passed with runner diagnostics enabled on the unchanged source. No timeout or assertion was relaxed. The latest ClawSweeper state contains only its acknowledgement, with no published actionable findings or Rank-up moves; the recorded independent source audits and isolated reviews are complete. |
|
Merged via squash.
|
* 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]>
…penclaw#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(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]>
Following the channel-surfaces contract and the Telegram split in openclaw#134044: isConfigured and the message tool now require both credentials to resolve, while describeAccount, the status snapshot and the setup wizard keep an account whose credential file cannot be read visible as configured but unavailable. unconfiguredReason names the credential that could not be read. The status warning no longer claims a configured token is missing.
Closes #133977
Additional instructions
Keep Allow edits from maintainers enabled.
What Problem This Solves
Fixes an issue where an unavailable channel SecretRef made Gateway status fail and readiness report an internal error even while healthy accounts were running. Disabled accounts with unresolved credentials could break the same diagnostics.
Why This Change Was Made
Channel diagnostics now consume recorded unavailable-owner state and read-only inspection metadata. Operational hooks receive resolved accounts, while the Gateway preserves the public runtime facts already recorded by each plugin. The bundled inspectors retain their existing configuration rules, duplicate-token suppression, and diagnostic fields through shared owner predicates.
The repair also removes repeated account resolution from channel status, keeps partial external inspection metadata honestly unknown, and prevents heartbeat owner discovery and health identity logging from activating unavailable accounts. Slack inspection also follows its transport credential contract: unused app-token references in HTTP and relay modes cannot suppress healthy probes or heartbeat owner routes. Strict operational credential validation is preserved. No configuration, environment, protocol-version, or database-schema surface is added.
User Impact
Operators can inspect Gateway health, channel status, and the dashboard while one account is unavailable. The affected account remains visible with a recovery reason, and healthy accounts continue running. Readiness identifies the affected channel; disabled accounts do not make readiness fail.
Evidence
The original built-Gateway reproduction returned an internal readiness failure and rejected status RPCs. The candidate was exercised with isolated state, synthetic credentials, the actual bundled SMS webhook runtime, and a healthy sibling plugin:
smsEvery scenario retained a running healthy SMS account and sibling plugin. Explicitly starting the cold account still returned
SECRET_SURFACE_UNAVAILABLE. All three Gateway children exited cleanly; no provider messages or external API probes were sent.Focused lifecycle, account-inspection, owner-policy, health, and status suites passed, including regressions captured before the fixes. Coverage includes stale owners, partial metadata, duplicate tokens, cached Discord diagnostics, safe credential projection, and strict Nextcloud credentials. Full build and the final runtime refresh passed; all eight built channel entrypoint memory profiles passed. Core and plugin production/test type checks passed. The final isolated Codex review reported no actionable findings at its configured threshold; an independent broader audit found a runtime-metadata regression that was fixed and reverified.
The full changed-surface gate passed, including production/test type checks, lint, migration/schema guards, and runtime import-cycle checks. The final Slack delta passed its separate changed-surface gate; its regression failed before the owner fix and the focused account/channel suite passed 111 tests. After a final runtime refresh, the actual built Slack inspector, resolver, health context, and heartbeat owner-route flow retained HTTP/relay accounts with unused app-token references, while socket mode still rejected the missing active credential. The built Slack entrypoint profile also passed. This proof used isolated synthetic state and did not call Slack transport APIs.
After a patch-identical rebase onto main (
b9b2f455071efcacad5cba0bb7ac2b0d27671d79), the exact candidate3c5291510badb6b5927fc87168adc64ecce6f3ebpassed 171 tests acrossserver-channels.test.ts,channels.status.test.ts, andhealth.test.ts, covering integration with the landed channel-recovery and dashboard health changes.Hosted CI identified two integration cleanups. The channel RPC now returns its typed runtime lookup directly, and the health fixture builder supplies the repeated empty-channel default; actual type-aware lint and all 64 affected status/start RPC and health tests passed without lint exemptions. The replaced default-account helper had also lost its last production caller, so its 159 lines and four obsolete tests were removed. Both
pnpm deadcode:dependenciesandpnpm deadcode:unused-filespassed, including zero production and full-tree unused files; all 14 replacement owner/link tests and a fresh isolated review passed. No unrelated dependency-gate finding remained.The second attempt of CI run
33384289228cleared all 19 checkout failures. Eighteen rerun jobs passed; the remaining Node shard reached its tests and timed out in the first sandbox prompt fixture (131 seconds; 1,466 sibling tests passed). The fixture supplied a provider-only handle despite the model-scoped preparation contract, causing repeated provider preparation and discovery. This PR includes the same one-line test repair verified in #134029: the prepared handle now carries its existing model ID. The fixture and owning preparation/hook modules are byte-identical to that verified repair; the recorded trace changes from four preparations/two discoveries to zero/zero. On this branch all 12 focused cases passed, including the formerly timed-out case in 424 ms, and the relevant test type shard, actual type-aware lint, and fresh isolated review passed. Assertions, timeouts, and production code are unchanged by this shared fixture repair.Other observed CI failures were infrastructure failures: GitHub fetches during checkout or retrieval of a pinned historical reader, plus a reset connection while downloading the Matrix native dependency before lint execution. These are separate from the repaired size and unused-file findings.
Known follow-ups:
src/infra/outbound/message-account-selection.ts(resolveMessageBroadcastAccountPlan) still passes inspection metadata to runtime enablement hooks; no bundled user failure was established in this investigation. Separately,src/gateway/server-channels.ts(startChannelInternal) resolves an account before checking enablement, so a disabled unresolved SMS account can still log a startup credential error even though the repaired status and readiness paths remain healthy. Both are recorded for their owning outbound/startup flows.Two additional pre-existing Slack follow-ups were identified by source audit:
extensions/slack/src/monitor/provider.tsresolves the signing secret before the transport-mode check, although that secret is only active for HTTP mode;src/commands/status-all/channels-token-summary.tsinfers bot+app requirements from field presence, which can mislabel relay or user-identity accounts. These paths were not changed or exercised through live Slack transport in this repair.Production delta: +737/-661 (net +76) across 37 files. Tests/support: +1197/-295 (net +902); docs: +13; assertion baseline: +2/-5. The remaining production growth establishes one metadata-only snapshot projection and recorded unavailable-owner handling, preserving bundled plugin configuration predicates and runtime diagnostic facts while removing the obsolete fallback, repeated resolution, and duplicate policy. Passing partial inspection records to operational hooks cannot express this boundary safely. No generated or lockfile changes.