Skip to content

fix(messaging): preserve Slack credential revisions - #10280

Closed
rsliter wants to merge 23 commits into
mainfrom
codex/fix-10153-slack-alias-revision
Closed

rsliter wants to merge 23 commits into
mainfrom
codex/fix-10153-slack-alias-revision

Conversation

@rsliter

@rsliter rsliter commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

OpenClaw startup removed the OpenShell credential revision when it converted Slack placeholders to Bolt-compatible aliases. OpenShell could no longer resolve those aliases to the active credential revision in either the child environment or generated OpenClaw configuration.

This change preserves the exact OpenShell credential revision in both paths, including revisions longer than 20 digits, and retains the existing missing and wrong-key runtime diagnostics. E2E evidence redaction now preserves those credential-free managed references instead of treating long-revision aliases as token-shaped values.

Related Issue

Part of #10153.

E2E Root-Cause Claim

E2E root cause: OpenClaw startup removed the OpenShell credential revision when it converted Slack placeholders to Bolt-compatible aliases.

Source run: https://github.com/NVIDIA/NemoClaw/actions/runs/32841422570, attempt 2

Affected job: messaging-providers, job 97810107452

Scope: one root cause. PR #10275 separately owns the endpoint credential-binding failure from the same job.

Exact-candidate follow-up: run https://github.com/NVIDIA/NemoClaw/actions/runs/33018568261 stopped during onboarding because the Discord credential binding referenced an unattached provider owned by #10275. The Slack assertions did not run, so this PR does not claim passing exact-candidate E2E yet.

Changes

  • Preserve vN_ credential identity when creating Bolt-compatible Slack bot and app environment aliases.
  • Refresh persisted Slack bot and app aliases to the active OpenShell credential revision.
  • Retain diagnostics for missing and wrong-key runtime placeholders after aliases become revision-scoped.
  • Cover startup and persisted configuration with a representative 21-digit credential revision, consistent with the Slack manifest's v[0-9]+_ grammar.
  • Preserve grammar-valid OpenShell and Slack references with numeric revisions longer than 20 digits in E2E evidence while malformed references, canonical token shapes, and registered explicit secret values remain redacted.
  • Ratchet test/agents/openclaw/runtime/nemoclaw-start.test.ts to its measured 4,618-line budget.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior. Justification:
  • Tests not applicable. Justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded. Reviewer/approval link/justification: Codex Desktop reviewed the complete seven-file diff at f76187157d5c78e2fcac8f90bb51107be43858e9 across secrets, input validation, authorization, dependencies, error handling, cryptography, configuration, tests, and system interaction. Raw Slack credentials remain in OpenShell custody. Only validated placeholder identities are transformed, values are not logged, and credential scope is unchanged. The E2E redactor preserves credential-free managed references; malformed references, canonical token shapes, and registered explicit secret values remain redacted. No injection, authorization, credential-custody, network, filesystem, dependency, logging, or denial-of-service blocker was found.
  • Non-success, skipped, or missing CI check accepted by maintainer. Check name, approval link, and follow-up issue: None accepted. CLI shard 4 timed out in the unrelated sandbox-create-plan test; its exact focused replay passed locally, and required CI remains unresolved.

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit: Not applicable
  • Station profile/scenario: Not applicable
  • Result: Not applicable
  • Supporting evidence: Not applicable

Verification

  • PR description includes a Signed-off-by: line for every contributor and every commit appears as Verified in GitHub. Every commit is verified; awaiting Charan Jagwani's DCO declaration.
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable. npm run validate:pr passed at f76187157d5c78e2fcac8f90bb51107be43858e9 after the isolated clone built the CLI artifacts required by the type check.
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above. The E2E redaction entry tests passed 40/40, the growth-guardrail tests passed 32/32, the focused Slack runtime alias tests passed 9/9, and the persisted-configuration test with a numeric revision longer than 20 digits passed 1/1.
  • Applicable broad gate passed. Not run; this focused change does not require the repository-wide coverage baseline. Automatic CLI shard 4 remains failed after an unrelated test timeout.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: Reviewed the complete seven-file effective diff at f76187157d5c78e2fcac8f90bb51107be43858e9 against origin/main. OpenClaw startup preserves numeric OpenShell credential revisions in Bolt-compatible Slack aliases and persisted configuration. The E2E redactor preserves grammar-valid managed references with revisions longer than 20 digits while malformed lookalikes, canonical token shapes, and registered explicit secret values remain redacted. Raw Slack credentials remain in OpenShell custody. No public command, configuration, default, diagnostic contract, or operator procedure changes, and existing docs do not describe alias encoding or revision width. Focused validation passed 40 E2E-support redaction tests, 32 growth-guardrail integration tests, 9 Slack runtime alias tests, and 1 persisted-configuration test with a numeric revision longer than 20 digits. The test-size budget matches the measured 4,618 lines.
  • Agent: Codex Desktop

Signed-off-by: Rebecca Sliter [email protected]

Summary by CodeRabbit

  • Bug Fixes

    • Improved Slack credential alias handling when using revision-specific placeholders.
    • Preserved credential revision identifiers during runtime configuration, including very long revisions.
    • Added stronger validation for missing or mismatched runtime placeholders.
    • Improved compatibility when converting OpenShell credential values into Bolt-compatible aliases.
  • Tests

    • Expanded coverage for bot and app tokens, environment aliases, revision-specific runtime scenarios, and E2E evidence redaction.

@rsliter rsliter self-assigned this Aug 25, 2026
@copy-pr-bot

copy-pr-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 27e1141b-bff4-47c8-ab6a-e70391ab2060

📥 Commits

Reviewing files that changed from the base of the PR and between cbf48e4 and b12d7f3.

📒 Files selected for processing (1)
  • ci/test-file-size-budget.json

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The runtime script preserves revision-scoped Slack credential aliases, validates matching environment keys, and applies revisions to messaging aliases. Tests cover these cases and update the test size budget.

Changes

Slack placeholder revision support

Layer / File(s) Summary
Runtime placeholder handling
scripts/nemoclaw-start.sh
Provider and messaging alias processing recognizes revision-scoped environment suffixes, preserves matching revisions, and rejects mismatched keys.
Revision validation coverage
test/agents/openclaw/runtime/nemoclaw-start-runtime-env-alias.test.ts, test/agents/openclaw/runtime/nemoclaw-start-slack-runtime.test.ts, test/agents/openclaw/runtime/nemoclaw-start.test.ts, ci/test-file-size-budget.json
Tests cover revision preservation, prefix removal, missing placeholders, and mismatched environment keys. The legacy line budget changes from 2016 to 1979.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to b12d7

The Slack credential-revision fix is localized and the reported checks pass, but an outstanding changes-requested gate still prevents merge until it is cleared or explicitly accepted; no additional code-level blocker is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving Slack credential revisions during messaging startup and configuration rebuilds.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-10153-slack-alias-revision

Comment @coderabbitai help to get the list of available commands.

@github-code-quality

github-code-quality Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall line coverage in commit d65ff2b in the codex/fix-10153-slac... branch remains at 96%, unchanged from commit 7409b8f in the main branch.


Updated August 27, 2026 20:46 UTC

@wscurran wscurran added area: messaging Messaging channels, bridges, manifests, or channel lifecycle bug-fix PR fixes a bug or regression integration: slack Slack integration or channel behavior labels Aug 25, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The Slack manifest accepts revisions with v[0-9]+_ at src/lib/messaging/channels/slack/manifest.ts:19,26. The new rewrite paths restrict revisions to 1–20 digits at scripts/nemoclaw-start.sh:1772,1780,2133. A valid longer revision can lose credential identity or leave the persisted alias stale. Use one revision grammar across manifest validation, runtime alias conversion, config refresh, and warnings. Add a revision longer than 20 digits to both runtime-alias and persisted-config tests.

@rsliter

rsliter commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Focused E2E still fails on exact head 448e3d63635422a5466288e6b51f0f30adae700d.

Run 32884662419 is bound by its dispatch receipt to this candidate, base 4da64a3bcd5d30a9c8770ad1f69fdfa67fb44f00, and trusted workflow d910fde70f0a4eece7adc8c752d8a2d3c831bc3d. The messaging-providers target completed install and WhatsApp rebuild, then failed the Slack boundary this PR changes:

  • the persisted OpenClaw config still contains identityless xoxb-OPENSHELL-RESOLVE-ENV-SLACK_BOT_TOKEN and xapp-OPENSHELL-RESOLVE-ENV-SLACK_APP_TOKEN aliases;
  • both fake Slack endpoints returned HTTP 500 with credential_injection_failed for an unresolved credential;
  • the fake service did not receive either host-side Slack token;
  • the installed Slack runtime proof produced no valid result because its send helper failed.

This is the current issue signature, not an unrelated runner failure. In addition to using the manifest's unbounded revision grammar, update the persisted-config path so the rebuilt config retains the actual revision-scoped Slack aliases. Add a deterministic rebuild assertion for both aliases, then rerun the same focused target.

Evidence: https://github.com/NVIDIA/NemoClaw/actions/runs/32884662419/job/97922694790

@senthilr-nv

Copy link
Copy Markdown
Collaborator

The long-revision and persisted-alias findings are addressed at current head 2ac1562d461bc6c2d9fcd9e256048172e8cdb9c3.

  • Slack revision parsing now uses the manifest-compatible v[0-9]+_ grammar.
  • Runtime aliases and rebuilt persisted config retain the complete bot-token and app-token revisions.
  • The focused Slack alias regressions passed.
  • The provider placeholder refresh selection passed 24/24.
  • Ordinary CI, managed startup, all-agent activation, and both MCP discovery passes succeeded. The PR Review Advisor synthesis job itself failed before publishing an updated assessment; its prior blocker is covered by the current code and tests.

I am not redispatching messaging-providers on this head yet. The exact branch tree intentionally omits #10275 endpoint bindings, and run 32884662419 already shows the resulting unresolved Slack placeholder failure. A new run would repeat that known dependency failure.

@senthilr-nv
senthilr-nv marked this pull request as ready for review August 25, 2026 20:24
@rsliter

rsliter commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Exact-head review for 2ac1562d461bc6c2d9fcd9e256048172e8cdb9c3.

The prior unlimited-revision code blocker is fixed. All three Slack placeholder paths now use the manifest-compatible v[0-9]+_ grammar, exact environment-key matching remains anchored, and the value retained in aliases is credential metadata rather than the raw Slack credential.

One candidate-owned test blocker remains. The new 21-digit case exercises only runtime alias creation in nemoclaw-start-slack-runtime.test.ts. The same commit also removes the 20-digit bound from the persisted-config rewrite at scripts/nemoclaw-start.sh:1769-1780, but the persisted bot/app assertion in nemoclaw-start.test.ts still uses short revision v42. Add an over-20-digit revision to that persisted-config rebuild path and prove both bot and app aliases retain it.

The security and documentation receipts in the PR body still bind 448e3d6363, not this head. Refresh both after the final test commit. Exact-head messaging-providers E2E remains blocked on the separately owned #10275 endpoint bindings, as already documented.

No approval submitted.

@rsliter

rsliter commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Commit 2ac1562d461bc6c2d9fcd9e256048172e8cdb9c3 is authored and committed by Charan Jagwani <[email protected]>, but this PR body contains only Rebecca Sliter's DCO declaration.

@Charjags, please add your own PR-body declaration for that contribution:

Signed-off-by: Charan Jagwani <[email protected]>

Repository policy does not permit another maintainer or agent to add this declaration on your behalf. Until you add it, #10280 cannot merge and its material commit cannot be transferred to another PR. #10275 will continue independently and must merge first. After that merge, this PR can update from main and run the focused messaging-providers E2E test.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rsliter

rsliter commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Focused E2E is waiting on #10275.

Exact candidate f76187157d5c78e2fcac8f90bb51107be43858e9 passed the managed-image publication prerequisite in run https://github.com/NVIDIA/NemoClaw/actions/runs/33016084433. The focused messaging-providers run https://github.com/NVIDIA/NemoClaw/actions/runs/33018568261 stopped during onboarding before the Slack assertions: the Discord credential binding referenced an unattached provider, the root cause owned by #10275. This PR's Slack revision fix was not evaluated by that run, so no passing E2E claim is made yet.

After #10275 merges, this branch needs to update from main and rerun messaging-providers on the new latest PR commit.

@rsliter

rsliter commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Focused trusted messaging-providers E2E passed for exact PR commit 495d60f5a352cd5b23e8bb8a44e929e3cfaf0322.

Slack evidence passed inside the single live contract:

  • M-S3 and M-S4 observed revision-scoped bot and app placeholders for the same numeric credential revision.
  • M-S15, M-S15a, M-S16, and M-S16a proved the fake Slack endpoints received the host-side bot and app credentials after OpenShell rewrote those placeholders, without raw capture leakage.
  • M-S17 through M-S17d returned an installed OpenClaw Slack runtime proof with ok: true, a successful channel message, the configured-user allow decision, and one bounded denied-user feedback action.
  • The live Vitest contract passed 1/1. Artifact upload and cleanup passed; all five cleanup actions succeeded with no failures.

This proves the Slack assertions that previously failed no longer fail with #10275 included.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor finished for commit d65ff2b. Include the Advisor findings in the complete PR feedback collection. Verify and group valid findings before repair.

All previous runs

@rsliter

rsliter commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this because #10275 resolved the operational failure that motivated this PR.

On main commit 7409b8f, the relevant jobs in E2E run 33111284865 completed successfully without this PR. The run used the managed image built from the #10275 merge commit. The messaging-providers job verified revision-scoped Slack bot and app placeholders, host token injection, and the installed Slack runtime proof.

This PR still changes an internal representation: it preserves the exact OpenShell revision in Bolt-compatible aliases. Current main does not preserve that representation. The passing run exercised a 20-digit revision, not a value longer than 20 digits. We do not have a separate accepted requirement for that representation or revision length.

This PR is therefore no longer needed to fix the reported E2E failure.

@rsliter rsliter closed this Aug 27, 2026
@wscurran wscurran added area: security Security controls, permissions, secrets, or hardening and removed security labels Oct 29, 2026
@cv
cv deleted the codex/fix-10153-slack-alias-revision branch November 21, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: messaging Messaging channels, bridges, manifests, or channel lifecycle area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression integration: openclaw OpenClaw integration behavior integration: slack Slack integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants