Skip to content

[Nemoclaw][All Platforms]Telegram token rotation leaves duplicate providerCredentialHashes entries instead of updating a single hash (sandbox registry drift) #3631

Closed

Description

@zNeill

Description

After NemoClaw onboard completes with a Telegram bot token configured (initially TELEGRAM_BOT_TOKEN=fake-token-A) and the sandbox is healthy, a second onboard run with a new Telegram token (TELEGRAM_BOT_TOKEN=fake-token-B) leaves two distinct providerCredentialHashes blocks for the same sandbox in ~/.nemoclaw/sandboxes.json, each with a different hash for TELEGRAM_BOT_TOKEN, instead of updating a single hash entry.

Concretely, after the second onboard:

$ echo $TELEGRAM_BOT_TOKEN
fake-token-B

But ~/.nemoclaw/sandboxes.json contains:

"providerCredentialHashes": {
  "TELEGRAM_BOT_TOKEN": "9bed07906968f9e82ae87b354284e766dc0c0d9547aac7af3334978ed0d0682c"
},
"providerCredentialHashes": {
  "TELEGRAM_BOT_TOKEN": "9b438bf6feb572f4b9b227f8306202a5bed42f9cdedfae94b2f3eccf4e840f82"
},

The first hash corresponds to the original token (fake-token-A), and the second hash corresponds to the new token (fake-token-B). Instead of rotating the hash in a single providerCredentialHashes object, NemoClaw appears to append a second providerCredentialHashes block and leave the old hash in place. This creates ambiguous registry state and diverges from the expected behavior that, after rotation, only the new token's hash is present for TELEGRAM_BOT_TOKEN.

Environment

  • Platform: Any supported NemoClaw platform (e.g. Ubuntu 22.04 / 24.04 / 26.04)
  • GPU: Any
  • Docker: Docker installed and running (supported runtime)
  • NemoClaw CLI: Installed and working
  • Sandbox:
    • Previously onboarded with TELEGRAM_BOT_TOKEN=fake-token-A
    • Healthy before rotation (nemoclaw status shows ready)
  • Credentials state before rotation:
    • ~/.nemoclaw/sandboxes.json contains a single providerCredentialHashes block with one entry for "TELEGRAM_BOT_TOKEN": "<hash-for-fake-token-A>"

(You can also add your exact NemoClaw/OpenShell versions here if needed for the issue.)

Steps to Reproduce

Preconditions

  1. Ensure NemoClaw CLI is installed and Docker is running.

  2. Export an initial Telegram token and onboard a sandbox:

    export TELEGRAM_BOT_TOKEN=fake-token-A
    nemoclaw onboard --non-interactive
  3. Verify the sandbox is healthy:

    nemoclaw status

    Confirm the sandbox shows as ready.

  4. Verify the initial credential hash is stored:

    cat ~/.nemoclaw/sandboxes.json | sed -n '/"providerCredentialHashes"/,/}/p'

    Confirm there is a single providerCredentialHashes block containing:

    "TELEGRAM_BOT_TOKEN": "<hash-for-fake-token-A>"

Rotation steps

  1. Change the Telegram token in the environment to a different value:

    export TELEGRAM_BOT_TOKEN=fake-token-B

    (fake-token-B must differ from fake-token-A.)

  2. Re-run NemoClaw onboard non-interactively:

    nemoclaw onboard --non-interactive
  3. Optionally observe terminal output during this onboard run for any rotation/rebuild messages.

  4. Wait for onboard to complete and note the exit code.

  5. Confirm the sandbox remains healthy:

    nemoclaw status
  6. Inspect the sandbox registry again:

    cat ~/.nemoclaw/sandboxes.json | sed -n '/"providerCredentialHashes"/,/}/p'

    Observe how many providerCredentialHashes blocks are present and what each TELEGRAM_BOT_TOKEN hash is.

Expected Result

  • The environment reflects the new token (echo $TELEGRAM_BOT_TOKEN shows fake-token-B).

  • nemoclaw onboard --non-interactive recognizes the existing sandbox and detects that messaging credentials have changed, performing a rotation and rebuild flow (per docs):

    • Terminal output includes a message such as:

      Messaging credential(s) rotated: TELEGRAM_BOT_TOKEN
      
    • And:

      Rebuilding sandbox to propagate new credentials to the L7 proxy...
      
  • Onboard exits with status 0 and no error.

  • nemoclaw status shows the sandbox as healthy and ready after the rebuild.

  • In ~/.nemoclaw/sandboxes.json for this sandbox:

    • There is one providerCredentialHashes block.
    • The TELEGRAM_BOT_TOKEN entry's hash corresponds to fake-token-B (the new token).
    • The hash for fake-token-A is no longer present.

This confirms that the registry correctly reflects the rotated credential and that the old hash is fully replaced by the new one.

Actual Result

  • After running:

    export TELEGRAM_BOT_TOKEN=fake-token-B
    nemoclaw onboard --non-interactive

    and confirming:

    $ echo $TELEGRAM_BOT_TOKEN
    fake-token-B

    the sandbox registry shows two providerCredentialHashes blocks:

    "providerCredentialHashes": {
      "TELEGRAM_BOT_TOKEN": "9bed07906968f9e82ae87b354284e766dc0c0d9547aac7af3334978ed0d0682c"
    },
    "providerCredentialHashes": {
      "TELEGRAM_BOT_TOKEN": "9b438bf6feb572f4b9b227f8306202a5bed42f9cdedfae94b2f3eccf4e840f82"
    },
  • The first hash is for the original token (fake-token-A), and the second hash is for the new token (fake-token-B).

  • Instead of updating the existing TELEGRAM_BOT_TOKEN hash in a single providerCredentialHashes object, NemoClaw appears to append a second providerCredentialHashes block and leave the previous hash intact.

  • This results in duplicate "providerCredentialHashes" keys at the same JSON level and ambiguous state about which token is authoritative, contrary to the expectation that only the new token's hash is present after a successful rotation.

Bug Details

Field Value
Priority Unprioritized
Action Dev - Open - To fix
Disposition Open issue
Module Machine Learning - NemoClaw
Keyword NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL

[NVB#6181593]

Activity

  1. added
    NV QA
    on May 15, 2026
  2. added
    integration: telegram
    and removed on May 18, 2026
  3. added theissue type on Jun 8, 2026
  4. Thabhelo commented on Jul 13, 2026

    @Thabhelo
    Contributor

    @cv i notice you and @Hadar301 added commits that reference this issue.

    I was intending on checking it out, can i consider claimed and leave it to y'all?

    ps: would be helpful to assign issues that have been claimed under the Assignees\nNo one assigned section.

  5. cv commented on Jul 14, 2026

    @cv
    Collaborator

    Closing as fixed by #6611 in v0.0.81. The focused regression confirms registry rewrites remove legacy providerCredentialHashes while retaining the current Telegram credential binding; no live credential was used, and NVB#6181593 needs a separate update.

  6. mercl-lau commented on Jul 28, 2026

    @mercl-lau
    Contributor

    QA verification update — FAIL on v0.0.96

    Environment:

    • macOS arm64 (Apple M4 Pro)
    • Docker Desktop
    • NemoClaw v0.0.96
    • OpenShell 0.0.85
    • Temporary isolated sandbox
    • Local Ollama model: qwen2.5:1.5b

    Validation:

    1. Fresh non-interactive onboard with placeholder Telegram token A completed successfully and created a healthy sandbox.
    2. The registry contained one Telegram credential binding whose stored hash matched token A.
    3. Non-interactive onboard was rerun against the same sandbox with a different placeholder Telegram token B.
    4. Onboard completed successfully and printed: Detected messaging channel inputs for telegram; refreshing reused sandbox messaging plan.
    5. The sandbox returned Ready and healthy, but registry verification showed:
      • Legacy providerCredentialHashes present: false
      • Telegram credential binding count: 1
      • Old token A hash present: true
      • New token B hash present: false

    The duplicate legacy providerCredentialHashes field addressed by #6611 is gone, but rotation still does not update the authoritative credential binding when the Telegram API is unreachable and no live credential is used. The focused regression for the fix did not require a live credential, so this remains a valid failure.

    Reopening for investigation.

    from kookies

  7. added a commit that references this issue on Aug 12, 2026
    bcf8e60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NV QAintegration: telegram

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions