Skip to content

fix(onboard): refresh stale reused messaging plan from env inputs - #5715

Closed
yimoj wants to merge 1 commit into
NVIDIA:mainfrom
yimoj:fix/5680-telegram-reachability-reuse
Closed

fix(onboard): refresh stale reused messaging plan from env inputs#5715
yimoj wants to merge 1 commit into
NVIDIA:mainfrom
yimoj:fix/5680-telegram-reachability-reuse

Conversation

@yimoj

@yimoj yimoj commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Non-interactive nemoclaw onboard reusing an existing sandbox whose stored messaging plan has zero active channels (the reporter's empty/stale Messaging: none state) silently refreshed credential hashes and skipped messaging channel setup. Newly supplied messaging env inputs (e.g. TELEGRAM_BOT_TOKEN) were never discovered, so the Telegram getMe reachability probe was bypassed even with NEMOCLAW_SKIP_TELEGRAM_REACHABILITY unset. This fix makes the reused-sandbox path honor fresh messaging env inputs so the reachability probe runs.

Related Issue

Fixes #5680

Changes

  • src/lib/onboard/machine/handlers/sandbox.ts: in the reused-registryMessagingPlan branch, when the plan has no active channels but this run supplies complete messaging env inputs, rebuild the plan via setupMessagingChannels (which runs channel reachability checks) instead of silently refreshing hashes. Plans that already have active channels are preserved as-is, so an existing channel is never dropped when its token is absent from this run. The explicit env-staged plan branch above stays authoritative for rebuild/resume.
  • src/lib/onboard/messaging-channel-setup.ts: add detectMessagingChannelsFromEnv, a pure, side-effect-free probe that reports which built-in channels currently have complete required inputs, reusing the same manifest input rules as setupMessagingChannels. NEMOCLAW_POLICY_PRESETS is intentionally ignored — policy presets are not messaging channel selection.
  • Tests for both the rebuild path and the preserve-active-channel regression guard, plus unit coverage of detectMessagingChannelsFromEnv (including that NEMOCLAW_POLICY_PRESETS=telegram alone does not select messaging).

Type of Change

  • Code change (feature, bug fix, or refactor)

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push
  • Targeted tests pass for changed behavior (sandbox.test.ts, messaging-channel-setup.test.ts — 39 tests)
  • Full npm test (cli project) passes — 8126 passed, 18 skipped
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs reviewed — no user-facing doc changes required (internal onboarding state-machine correctness fix; no new flags/env/API)

End-to-end verification (real worktree CLI vs live OpenShell 0.0.44 sandbox)

Built the worktree CLI (npm run build:cli) and drove real node ./bin/nemoclaw.js onboard commands against a live OpenShell 0.0.44 Docker-driver sandbox (CPU host, hosted NVIDIA Endpoints inference). Created the reporter's buggy state — a sandbox compat-tg-5680 whose registry messaging plan is non-null with zero active channels (telegram configured-but-disabled) — then ran the reporter workflow with a fake TELEGRAM_BOT_TOKEN and NEMOCLAW_SKIP_TELEGRAM_REACHABILITY unset.

Exact command (same for both builds):

export NVIDIA_INFERENCE_API_KEY=...                 # hosted inference
export TELEGRAM_BOT_TOKEN="123456789:AAFfake-token-for-5680-e2e-reproduction-xyz"
export TELEGRAM_ALLOWED_IDS="123456789"
export NEMOCLAW_POLICY_PRESETS="telegram"
export NEMOCLAW_NON_INTERACTIVE=1 NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1
export NEMOCLAW_SANDBOX_NAME=compat-tg-5680
unset NEMOCLAW_SKIP_TELEGRAM_REACHABILITY
node ./bin/nemoclaw.js onboard --non-interactive --no-gpu --no-sandbox-gpu --yes-i-accept-third-party-software

Unpatched build (bug reproduced — probe silently bypassed):

  Messaging:     none
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it
  [non-interactive] Applying policy presets: telegram

(No [5/8] Messaging channels, no reachability output — matches the reporter's exact observation.)

Patched build (fixed — messaging setup + reachability probe run):

  Messaging:     none
  [non-interactive] Detected messaging channel inputs for telegram; refreshing reused sandbox messaging plan.
  [5/8] Messaging channels
  [non-interactive] Messaging channel inputs detected: telegram
  Telegram integration will be disabled for this enrollment run because api.telegram.org is unreachable.
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it

The patched run discovers the env-supplied Telegram input on the reused sandbox and runs the getMe reachability probe, emitting reachability diagnostics instead of silently skipping. (This E2E host's egress to api.telegram.org is firewall-blocked, so the probe reports "unreachable" rather than a token rejection — both prove the probe executed rather than being bypassed; on a host that can reach Telegram a fake token yields the Telegram bot token was rejected. log.) The test sandbox was destroyed after verification.


Signed-off-by: Yimo Jiang yimoj@nvidia.com

Summary by CodeRabbit

  • New Features

    • Messaging channel setup now automatically detects which channels are available from current environment settings, and can restore or refresh the active messaging plan during sandbox resume.
  • Bug Fixes

    • Fixed sandbox resume to preserve an existing active messaging plan when environment changes don’t affect the active channel.
    • Fixed cases where an empty reused messaging plan is correctly refreshed once messaging credentials (e.g., Telegram token) become available later, ensuring messaging setup runs.

@yimoj
yimoj force-pushed the fix/5680-telegram-reachability-reuse branch from 2b1d486 to 00f65e6 Compare June 24, 2026 06:55
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 0d1bec59-a2a4-4f4c-9141-fb64097583f0

📥 Commits

Reviewing files that changed from the base of the PR and between 33818d9 and 47a3d2c.

📒 Files selected for processing (4)
  • src/lib/onboard/machine/handlers/sandbox.test.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/messaging-channel-setup.test.ts
  • src/lib/onboard/messaging-channel-setup.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/lib/onboard/messaging-channel-setup.ts
  • src/lib/onboard/messaging-channel-setup.test.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/machine/handlers/sandbox.test.ts

📝 Walkthrough

Walkthrough

Adds detectMessagingChannelsFromEnv, which checks the current environment for enabled messaging channels, and updates the sandbox resume path to reuse that detection when deciding whether to rebuild a registry messaging plan. Tests cover both the detection helper and the sandbox resume cases.

Changes

Env-driven messaging plan refresh

Layer / File(s) Summary
Detect messaging channels from env
src/lib/onboard/messaging-channel-setup.ts, src/lib/onboard/messaging-channel-setup.test.ts
detectMessagingChannelsFromEnv(agent?) filters built-in messaging manifests by environment-satisfied inputs and returns matching channel IDs. Tests cover no inputs, TELEGRAM_BOT_TOKEN, and NEMOCLAW_POLICY_PRESETS alone.
Sandbox registry plan reuse
src/lib/onboard/machine/handlers/sandbox.ts, src/lib/onboard/machine/handlers/sandbox.test.ts
handleSandboxState now checks env-detected messaging channels when reusing a registry plan. It reruns messaging setup for empty active plans and otherwise keeps the refresh-and-write path; tests cover the rebuilt-plan and preserved-plan behaviors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5673: Changes the manifest-availability filtering that detectMessagingChannelsFromEnv depends on.

Suggested labels

area: cli

Suggested reviewers

  • cv

Poem

🐇 I sniffed the breeze and found a clue,
A token sparked a channel new.
The sandbox woke, the registry sighed,
And messaging plans stayed neat inside.
Hop hop hooray, the env knows best!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: refreshing a reused messaging plan from current env inputs.
Linked Issues check ✅ Passed The changes make non-interactive onboarding rediscover Telegram env inputs and re-run messaging setup, which should unblock the reachability probe path for reused empty plans.
Out of Scope Changes check ✅ Passed The diff stays focused on messaging-plan refresh logic and related tests, with no clear unrelated feature work.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/onboard/machine/handlers/sandbox.ts`:
- Around line 358-359: The rebuild path in sandbox setup is seeding from the
wrong plan source: the branch that repairs the registry-backed configuration
should use the authoritative registryMessagingPlan instead of
session?.messagingPlan. Update the existing channel extraction and the
subsequent deps.setupMessagingChannels call in sandbox.ts to derive channels
from registryMessagingPlan so the refresh stays aligned with the registry copy
and does not overwrite newer sandbox-recorded channel/config state with stale
session data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e460df43-0200-4732-ad9d-49c47beabf18

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb9754 and 00f65e6.

📒 Files selected for processing (4)
  • src/lib/onboard/machine/handlers/sandbox.test.ts
  • src/lib/onboard/machine/handlers/sandbox.ts
  • src/lib/onboard/messaging-channel-setup.test.ts
  • src/lib/onboard/messaging-channel-setup.ts

Comment thread src/lib/onboard/machine/handlers/sandbox.ts Outdated
@yimoj
yimoj force-pushed the fix/5680-telegram-reachability-reuse branch from 00f65e6 to 33818d9 Compare June 24, 2026 07:29
@yimoj

yimoj commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed CodeRabbit feedback (head 33818d905): the empty-registry-plan rebuild path now seeds existing channels from the authoritative reused registryMessagingPlan (with a session-plan fallback) instead of session?.messagingPlan, so a previously-configured in-sandbox-QR channel like WhatsApp (no host-side token) is preserved across the refresh. Updated the rebuild test to assert the registry-derived seed and that a divergent session plan is not used.

The earlier cli-test-shards (2) failure was an unrelated timing flake in test/nemoclaw-start-gateway-health.test.ts (gateway-watchdog probe count) — not in this PR's diff; it passes locally (19/19) and should clear on re-run. Targeted tests pass (39); typecheck + biome clean.

@yimoj yimoj added the v0.0.68 label Jun 24, 2026
@wscurran wscurran added area: messaging Messaging channels, bridges, manifests, or channel lifecycle bug-fix PR fixes a bug or regression integration: telegram Telegram integration or channel behavior labels Jun 24, 2026
@wscurran

Copy link
Copy Markdown
Contributor

@cjagwani cjagwani self-assigned this Jun 24, 2026
Non-interactive `nemoclaw onboard` reusing an existing sandbox whose
registry messaging plan has zero active channels (the reporter's empty/
stale "Messaging: none" state) silently refreshed credential hashes and
skipped messaging channel setup. Newly supplied messaging env inputs
(e.g. TELEGRAM_BOT_TOKEN) were never discovered, so the Telegram getMe
reachability probe was bypassed even with NEMOCLAW_SKIP_TELEGRAM_REACHABILITY
unset.

When the reused registry plan has no active channels but this run supplies
complete messaging env inputs, rebuild the plan via setupMessagingChannels
so newly supplied channels are discovered and run their reachability checks.
Plans that already have active channels are preserved as-is so an existing
channel is never dropped when its token is absent from this run. Policy
presets alone (NEMOCLAW_POLICY_PRESETS=telegram) do not select messaging.

Adds detectMessagingChannelsFromEnv, a pure manifest-input probe reusing the
same input rules as setupMessagingChannels, to compare current env inputs
against the reused plan before treating it as authoritative.

Fixes NVIDIA#5680

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
@yimoj
yimoj force-pushed the fix/5680-telegram-reachability-reuse branch from 33818d9 to 47a3d2c Compare June 25, 2026 00:40
@yimoj

yimoj commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #5788, opened from NVIDIA/NemoClaw branch so trusted PR advisor workflows can run.

@yimoj

yimoj commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #5788.

@yimoj yimoj closed this Jun 25, 2026
cv pushed a commit that referenced this pull request Jun 26, 2026
)

## Summary

Non-interactive `nemoclaw onboard` reusing an existing sandbox whose
stored messaging plan has **zero active channels** (the reporter's
empty/stale `Messaging: none` state) silently refreshed credential
hashes and skipped messaging channel setup. Newly supplied messaging env
inputs (e.g. `TELEGRAM_BOT_TOKEN`) were never discovered, so the
Telegram `getMe` reachability probe was bypassed even with
`NEMOCLAW_SKIP_TELEGRAM_REACHABILITY` unset. This fix makes the
reused-sandbox path honor fresh messaging env inputs so the reachability
probe runs.

## Related Issue

Fixes #5680

## Changes

- `src/lib/onboard/machine/handlers/sandbox.ts`: in the
reused-`registryMessagingPlan` branch, when the plan has **no active
channels** but this run supplies complete messaging env inputs, rebuild
the plan via `setupMessagingChannels` (which runs channel reachability
checks) instead of silently refreshing hashes. Plans that already have
active channels are preserved as-is, so an existing channel is never
dropped when its token is absent from this run. The explicit env-staged
plan branch above stays authoritative for rebuild/resume.
- `src/lib/onboard/messaging-channel-setup.ts`: add
`detectMessagingChannelsFromEnv`, a pure, side-effect-free probe that
reports which built-in channels currently have complete required inputs,
reusing the same manifest input rules as `setupMessagingChannels`.
`NEMOCLAW_POLICY_PRESETS` is intentionally ignored — policy presets are
not messaging channel selection.
- Tests for both the rebuild path and the preserve-active-channel
regression guard, plus unit coverage of `detectMessagingChannelsFromEnv`
(including that `NEMOCLAW_POLICY_PRESETS=telegram` alone does not select
messaging).

## Type of Change

- [x] Code change (feature, bug fix, or refactor)

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push
- [x] Targeted tests pass for changed behavior (`sandbox.test.ts`,
`messaging-channel-setup.test.ts` — 39 tests)
- [x] Full `npm test` (cli project) passes — 8126 passed, 18 skipped
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs reviewed — no user-facing doc changes required (internal
onboarding state-machine correctness fix; no new flags/env/API)

### End-to-end verification (real worktree CLI vs live OpenShell 0.0.44
sandbox)

Built the worktree CLI (`npm run build:cli`) and drove real `node
./bin/nemoclaw.js onboard` commands against a live OpenShell 0.0.44
Docker-driver sandbox (CPU host, hosted NVIDIA Endpoints inference).
Created the reporter's buggy state — a sandbox `compat-tg-5680` whose
registry messaging plan is non-null with **zero active channels**
(telegram configured-but-disabled) — then ran the reporter workflow with
a fake `TELEGRAM_BOT_TOKEN` and `NEMOCLAW_SKIP_TELEGRAM_REACHABILITY`
unset.

Exact command (same for both builds):

```bash
export NVIDIA_INFERENCE_API_KEY=...                 # hosted inference
export TELEGRAM_BOT_TOKEN="123456789:AAFfake-token-for-5680-e2e-reproduction-xyz"
export TELEGRAM_ALLOWED_IDS="123456789"
export NEMOCLAW_POLICY_PRESETS="telegram"
export NEMOCLAW_NON_INTERACTIVE=1 NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1
export NEMOCLAW_SANDBOX_NAME=compat-tg-5680
unset NEMOCLAW_SKIP_TELEGRAM_REACHABILITY
node ./bin/nemoclaw.js onboard --non-interactive --no-gpu --no-sandbox-gpu --yes-i-accept-third-party-software
```

**Unpatched build (bug reproduced — probe silently bypassed):**

```text
  Messaging:     none
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it
  [non-interactive] Applying policy presets: telegram
```

(No `[5/8] Messaging channels`, no reachability output — matches the
reporter's exact observation.)

**Patched build (fixed — messaging setup + reachability probe run):**

```text
  Messaging:     none
  [non-interactive] Detected messaging channel inputs for telegram; refreshing reused sandbox messaging plan.
  [5/8] Messaging channels
  [non-interactive] Messaging channel inputs detected: telegram
  Telegram integration will be disabled for this enrollment run because api.telegram.org is unreachable.
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it
```

The patched run discovers the env-supplied Telegram input on the reused
sandbox and runs the `getMe` reachability probe, emitting reachability
diagnostics instead of silently skipping. (This E2E host's egress to
`api.telegram.org` is firewall-blocked, so the probe reports
"unreachable" rather than a token rejection — both prove the probe
executed rather than being bypassed; on a host that can reach Telegram a
fake token yields the `Telegram bot token was rejected.` log.) The test
sandbox was destroyed after verification.

---

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added environment-aware detection of supported messaging channels,
improving onboarding and resume behavior when messaging is already
configured.

* **Bug Fixes**
* Fixed reused messaging-plan handling when prior channels are no longer
active: onboarding now refreshes the plan from current environment
configuration.
* Avoided unnecessary messaging-plan rebuilds when an existing active
channel remains valid, even if additional environment inputs are
present.

* **Tests**
* Expanded coverage for environment-based messaging channel detection
and reused-plan scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---
Supersedes #5715 (reopened from NVIDIA/NemoClaw branch so trusted
advisor workflows can run).

---------

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…IDIA#5788)

## Summary

Non-interactive `nemoclaw onboard` reusing an existing sandbox whose
stored messaging plan has **zero active channels** (the reporter's
empty/stale `Messaging: none` state) silently refreshed credential
hashes and skipped messaging channel setup. Newly supplied messaging env
inputs (e.g. `TELEGRAM_BOT_TOKEN`) were never discovered, so the
Telegram `getMe` reachability probe was bypassed even with
`NEMOCLAW_SKIP_TELEGRAM_REACHABILITY` unset. This fix makes the
reused-sandbox path honor fresh messaging env inputs so the reachability
probe runs.

## Related Issue

Fixes NVIDIA#5680

## Changes

- `src/lib/onboard/machine/handlers/sandbox.ts`: in the
reused-`registryMessagingPlan` branch, when the plan has **no active
channels** but this run supplies complete messaging env inputs, rebuild
the plan via `setupMessagingChannels` (which runs channel reachability
checks) instead of silently refreshing hashes. Plans that already have
active channels are preserved as-is, so an existing channel is never
dropped when its token is absent from this run. The explicit env-staged
plan branch above stays authoritative for rebuild/resume.
- `src/lib/onboard/messaging-channel-setup.ts`: add
`detectMessagingChannelsFromEnv`, a pure, side-effect-free probe that
reports which built-in channels currently have complete required inputs,
reusing the same manifest input rules as `setupMessagingChannels`.
`NEMOCLAW_POLICY_PRESETS` is intentionally ignored — policy presets are
not messaging channel selection.
- Tests for both the rebuild path and the preserve-active-channel
regression guard, plus unit coverage of `detectMessagingChannelsFromEnv`
(including that `NEMOCLAW_POLICY_PRESETS=telegram` alone does not select
messaging).

## Type of Change

- [x] Code change (feature, bug fix, or refactor)

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push
- [x] Targeted tests pass for changed behavior (`sandbox.test.ts`,
`messaging-channel-setup.test.ts` — 39 tests)
- [x] Full `npm test` (cli project) passes — 8126 passed, 18 skipped
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [x] Docs reviewed — no user-facing doc changes required (internal
onboarding state-machine correctness fix; no new flags/env/API)

### End-to-end verification (real worktree CLI vs live OpenShell 0.0.44
sandbox)

Built the worktree CLI (`npm run build:cli`) and drove real `node
./bin/nemoclaw.js onboard` commands against a live OpenShell 0.0.44
Docker-driver sandbox (CPU host, hosted NVIDIA Endpoints inference).
Created the reporter's buggy state — a sandbox `compat-tg-5680` whose
registry messaging plan is non-null with **zero active channels**
(telegram configured-but-disabled) — then ran the reporter workflow with
a fake `TELEGRAM_BOT_TOKEN` and `NEMOCLAW_SKIP_TELEGRAM_REACHABILITY`
unset.

Exact command (same for both builds):

```bash
export NVIDIA_INFERENCE_API_KEY=...                 # hosted inference
export TELEGRAM_BOT_TOKEN="123456789:AAFfake-token-for-5680-e2e-reproduction-xyz"
export TELEGRAM_ALLOWED_IDS="123456789"
export NEMOCLAW_POLICY_PRESETS="telegram"
export NEMOCLAW_NON_INTERACTIVE=1 NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1
export NEMOCLAW_SANDBOX_NAME=compat-tg-5680
unset NEMOCLAW_SKIP_TELEGRAM_REACHABILITY
node ./bin/nemoclaw.js onboard --non-interactive --no-gpu --no-sandbox-gpu --yes-i-accept-third-party-software
```

**Unpatched build (bug reproduced — probe silently bypassed):**

```text
  Messaging:     none
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it
  [non-interactive] Applying policy presets: telegram
```

(No `[5/8] Messaging channels`, no reachability output — matches the
reporter's exact observation.)

**Patched build (fixed — messaging setup + reachability probe run):**

```text
  Messaging:     none
  [non-interactive] Detected messaging channel inputs for telegram; refreshing reused sandbox messaging plan.
  [5/8] Messaging channels
  [non-interactive] Messaging channel inputs detected: telegram
  Telegram integration will be disabled for this enrollment run because api.telegram.org is unreachable.
  [non-interactive] Sandbox 'compat-tg-5680' exists and is ready — reusing it
```

The patched run discovers the env-supplied Telegram input on the reused
sandbox and runs the `getMe` reachability probe, emitting reachability
diagnostics instead of silently skipping. (This E2E host's egress to
`api.telegram.org` is firewall-blocked, so the probe reports
"unreachable" rather than a token rejection — both prove the probe
executed rather than being bypassed; on a host that can reach Telegram a
fake token yields the `Telegram bot token was rejected.` log.) The test
sandbox was destroyed after verification.

---

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added environment-aware detection of supported messaging channels,
improving onboarding and resume behavior when messaging is already
configured.

* **Bug Fixes**
* Fixed reused messaging-plan handling when prior channels are no longer
active: onboarding now refreshes the plan from current environment
configuration.
* Avoided unnecessary messaging-plan rebuilds when an existing active
channel remains valid, even if additional environment inputs are
present.

* **Tests**
* Expanded coverage for environment-based messaging channel detection
and reused-plan scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---
Supersedes NVIDIA#5715 (reopened from NVIDIA/NemoClaw branch so trusted
advisor workflows can run).

---------

Signed-off-by: Yimo Jiang <yimoj@nvidia.com>
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 bug-fix PR fixes a bug or regression integration: telegram Telegram integration or channel behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Policy&Network][GitHub Issue #5680] Telegram reachability probe does not log or fail for fake tokens when NEMOCLAW_SKIP_TELEGRAM_REACHABILITY is unset

3 participants