Skip to content

fix(channels): keep healthy accounts running when credential files fail - #110360

Merged
steipete merged 9 commits into
mainfrom
fix/legacy-channel-credential-degradation
Jul 18, 2026
Merged

steipete merged 9 commits into
mainfrom
fix/legacy-channel-credential-degradation

Conversation

@steipete

@steipete steipete commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #110320

What Problem This Solves

Fixes an issue where operators using explicit credential files for legacy channel accounts could get inconsistent startup behavior when a file was missing or unreadable. Affected accounts could fail before account-scoped degradation, while healthy sibling accounts could be disrupted.

Why This Change Was Made

All affected resolvers now preserve explicit-file failures as one shared configured-unavailable result with a redacted canonical config path. Account snapshots carry that state into Gateway startup, which isolates the degraded owner and starts healthy siblings. Existing env/file inputs remain supported, and an unavailable explicit file never falls through to a lower-precedence value.

User Impact

Telegram, LINE, IRC, Nextcloud Talk, and Google Chat accounts with unavailable explicit credential files are reported as degraded without exposing the filesystem path. Other configured accounts continue starting normally.

Evidence

  • 221 focused tests passed across the affected account resolvers, adapters, snapshots, degraded-owner state, and Gateway startup on Blacksmith Testbox.
  • After rebasing onto current main, pnpm check:changed passed on exact head 5cbc771c7819 with Blacksmith Testbox tbx_01kxssnsct811gsv6n08rrkkar (run); generated SDK contract, typecheck lanes, formatting, boundaries, guards, and lint all passed.
  • The Apple catalog regression exposed by the prior GitHub merge tree passes 13/13 locally and on Linux Node 24 after the rebase.
  • Full branch autoreview used the landed openclaw/agent-skills scanner fix at exact head 5cbc771c7819 and returned no accepted actionable finding.
  • Exact-head GitHub CI is green at 5cbc771c7819, including build, type, lint, all compact test shards, security/critical-quality lanes, and the required openclaw/ci-gate (run).

@steipete
steipete requested a review from a team as a code owner July 18, 2026 03:14
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: line Channel integration: line channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram gateway Gateway runtime channel: irc size: XL maintainer Maintainer-authored PR labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef990e215f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md Outdated

### Fixes

- **Legacy channel credential files:** isolate unavailable explicit credential files to the affected Google Chat, IRC, LINE, Nextcloud Talk, or Telegram account, keep healthy sibling accounts running, and report redacted degradation without falling through to lower-precedence credentials.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the manual changelog entry

For this normal fix commit, adding an Unreleased entry conflicts with the repo changelog contract: AGENTS.md:311 says CHANGELOG.md is release-only and release generation owns it, while AGENTS.md:313 says release generation derives entries from merged PRs and direct main commits. Leaving this line in can make the generated release notes duplicate or diverge from the release tooling; keep this release-note context in the commit/PR body instead.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64a9d52b02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +150 to +151
apiCredentialResolution.status === "configured_unavailable"
? apiCredentialResolution.diagnostic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't put optional API credentials in account degradation

For a Nextcloud Talk account with a valid botSecret but a missing or unreadable apiPasswordFile, adding the API password diagnostic here makes the account look degraded to Gateway startup; src/gateway/server-channels.ts:581-591 treats any credentialDiagnostics as an account-level SecretSurfaceUnavailableError before calling startAccount. The API credentials are optional for the webhook bot path: extensions/nextcloud-talk/src/room-info.ts:69-75 just skips room lookup without them, extensions/nextcloud-talk/src/bot-preflight.ts:95-106 skips the status probe, and docs/channels/nextcloud-talk.md:88-90 documents them as enabling lookups/probes rather than starting the bot. Keep this diagnostic out of account-level degradation, or scope it to the optional room-info/status surface, so a bad optional API password file does not keep an otherwise healthy bot cold.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 12:48 AM ET / 04:48 UTC.

Summary
The branch introduces typed, redacted unavailable-file credential states across legacy channel resolvers and uses Gateway startup handling to isolate only the affected account.

PR surface: Source +486, Tests +450, Generated 0. Total +936 across 42 files.

Reproducibility: yes. from source and focused regression coverage: configure two supported channel accounts, make one explicit credential file unavailable, and start Gateway; the changed test models the broken-account/healthy-sibling outcome. This review did not receive an after-fix live runtime transcript.

Review metrics: 1 noteworthy metric.

  • Credential isolation scope: 5 channel families plus shared Gateway startup. A single credential-file failure policy now affects Telegram, LINE, IRC, Nextcloud Talk, Google Chat, and the common startup path.

Stored data model
Persistent data-model change detected: serialized state: extensions/irc/src/accounts.test.ts, serialized state: extensions/nextcloud-talk/src/api-credentials.test.ts, serialized state: extensions/telegram/src/account-inspect.test.ts, serialized state: src/infra/secret-file.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #110320
Summary: This PR is the candidate implementation for the open report about account-scoped handling of unavailable legacy credential files.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted live Gateway or terminal capture showing unavailable-file degradation and healthy-sibling startup.
  • Make the observed no-fallback explicit-file precedence visible in that proof or accompanying runtime log.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides tests and CI evidence but no after-fix live Gateway, terminal, or redacted runtime-log proof that a failed credential-file account is isolated while a healthy sibling starts; please redact paths, tokens, IPs, and private endpoints. Updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] This changes channel-startup availability behavior across several legacy credential-file paths; focused tests cover it, but the PR lacks redacted real-runtime proof that Gateway keeps a healthy sibling running while reporting the broken account as degraded.
  • [P1] The branch intentionally prevents an unavailable explicit file from falling through to a lower-precedence credential, so the final maintainer review should confirm that this fail-closed precedence is the desired upgrade behavior for existing installations.

Maintainer options:

  1. Prove account isolation before merge (recommended)
    Add redacted after-fix Gateway or terminal evidence showing the unavailable account is degraded without exposing filesystem paths and a healthy sibling remains running.
  2. Pause for compatibility direction
    Pause the PR if maintainers want unavailable explicit files to retain a lower-precedence fallback instead of adopting the proposed fail-closed behavior.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require redacted live startup proof for one unavailable explicit-file account and one healthy sibling, confirming that no filesystem path appears in the diagnostic.

Next step before merge

  • [P1] The protected maintainer label and missing contributor-supplied live behavior proof require human review rather than an automated repair attempt.

Maintainer decision needed

  • Question: Should OpenClaw adopt account-scoped degradation, rather than startup fallback, for every legacy channel account whose explicitly configured credential file is unavailable?
  • Rationale: The implementation is broad and changes runtime availability and credential-precedence behavior across multiple bundled channels; real runtime proof and maintainer confirmation of the fail-closed upgrade contract are needed before merge.
  • Likely owner: steipete — They authored the paired report and the candidate implementation, so they are best positioned to provide the requested redacted runtime evidence and clarify the intended credential precedence.
  • Options:
    • Require runtime proof, then accept scoped degradation (recommended): Require a redacted live Gateway or terminal capture showing one unavailable account stays degraded while a valid sibling starts, then merge if the observed precedence matches the intended no-fallback contract.
    • Preserve fallback behavior: Revise the proposal to retain lower-precedence fallback for existing explicit-file setups if maintainers consider that behavior a required compatibility contract.

Security
Cleared: The diff adds redacted typed diagnostics and reuses existing secret-file safety handling; no new dependency, workflow, permission, or credential-exposure concern was identified.

Review details

Best possible solution:

Retain the shared redacted configured-unavailable contract, add a redacted live Gateway/terminal capture demonstrating broken-account isolation and healthy-sibling startup, then make the explicit-file precedence decision visible in maintainer review.

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

Yes, from source and focused regression coverage: configure two supported channel accounts, make one explicit credential file unavailable, and start Gateway; the changed test models the broken-account/healthy-sibling outcome. This review did not receive an after-fix live runtime transcript.

Is this the best way to solve the issue?

Yes, the shared typed and redacted unavailable-file state is a more maintainable solution than per-channel throws or fallback behavior, provided maintainers accept the stated explicit-file precedence and live startup proof confirms it.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label justifications:

  • P1: A deterministic credential-file failure can prevent channel availability for affected operators, and the patch is intended to preserve healthy sibling accounts.
  • merge-risk: 🚨 availability: Merging changes account startup and recovery behavior when configured credential files are missing, unreadable, empty, or disallowed.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides tests and CI evidence but no after-fix live Gateway, terminal, or redacted runtime-log proof that a failed credential-file account is isolated while a healthy sibling starts; please redact paths, tokens, IPs, and private endpoints. Updating the PR body should trigger re-review, or a maintainer can comment @clawsweeper re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +486, Tests +450, Generated 0. Total +936 across 42 files.

View PR surface stats
Area Files Added Removed Net
Source 27 608 122 +486
Tests 14 526 76 +450
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 4 4 0
Other 0 0 0 0
Total 42 1138 202 +936

What I checked:

  • Gateway isolation path: The changed startup path clears any prior runtime credential-degraded state, resolves the account, converts typed credential diagnostics into account degradation, and continues processing other accounts. (src/gateway/server-channels.ts:578, 4859c7f98a4d)
  • Credential diagnostic contract: The shared secret-file helper now distinguishes missing input from an explicitly configured but unavailable file and returns a diagnostic containing a canonical config path rather than the filesystem path. (src/infra/secret-file.ts:30, 4859c7f98a4d)
  • Recovery coverage: The Gateway test covers a broken account being held cold, then recovering without restarting healthy siblings, which directly exercises the intended availability invariant. (src/gateway/server-channels.test.ts:1324, 4859c7f98a4d)
  • Prior review continuity: The earlier optional Nextcloud Talk API-credential concern is no longer present in the proposed account-level diagnostic flow: the branch represents it separately as apiCredentialStatus, while the account credential diagnostic remains tied to bot-secret resolution. (extensions/nextcloud-talk/src/accounts.ts:84, 4859c7f98a4d)
  • Paired canonical bug: The PR body links the open canonical report as its implementation target; that issue should remain open until this candidate fix lands. (4859c7f98a4d)

Likely related people:

  • steipete: Authored the paired report and every commit in the candidate implementation, including the follow-up commits that addressed the prior review findings. (role: feature proposer and recent implementation contributor; confidence: medium; commits: aea816567b78, c7cbeedce9ca, 4859c7f98a4d; files: src/gateway/server-channels.ts, src/infra/secret-file.ts, extensions/telegram/src/token.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-18T04:07:05.113Z sha 64a9d52 :: needs real behavior proof before merge. :: [P2] Keep optional API password failures out of account degradation
  • reviewed 2026-07-18T04:23:34.298Z sha c7cbeed :: needs real behavior proof before merge. :: [P2] Remove the manual changelog entry

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 18, 2026
@steipete
steipete force-pushed the fix/legacy-channel-credential-degradation branch from 4859c7f to 5cbc771 Compare July 18, 2026 05:21
@steipete
steipete merged commit 3e74534 into main Jul 18, 2026
126 checks passed
@steipete
steipete deleted the fix/legacy-channel-credential-degradation branch July 18, 2026 05:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…il (openclaw#110360)

* fix(channels): isolate unavailable credential files

* fix(channels): complete credential file type contract

* fix(channels): preserve credential path handling

* test(channels): cover credential file edge cases

* fix(channels): ignore blank credential file paths

* test(secrets): keep empty credential files unavailable

* test(googlechat): keep temp cleanup plugin-local

* fix(channels): keep credential diagnostic internal

* chore: defer release note to release automation
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…il (openclaw#110360)

* fix(channels): isolate unavailable credential files

* fix(channels): complete credential file type contract

* fix(channels): preserve credential path handling

* test(channels): cover credential file edge cases

* fix(channels): ignore blank credential file paths

* test(secrets): keep empty credential files unavailable

* test(googlechat): keep temp cleanup plugin-local

* fix(channels): keep credential diagnostic internal

* chore: defer release note to release automation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat channel: irc channel: line Channel integration: line channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy channel credential files bypass account-scoped degradation

1 participant