Skip to content

fix(providers): treat binding-only providers as detached - #13649

Merged
rsliter merged 3 commits into
mainfrom
fix/13644-binding-only-provider-detach
Oct 27, 2026
Merged

rsliter merged 3 commits into
mainfrom
fix/13644-binding-only-provider-detach

Conversation

@jason-ma-nv

@jason-ma-nv jason-ma-nv commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Destroying a Telegram-enabled sandbox no longer warns that it failed to detach the telegram-bridge provider, and it no longer prints residual-state cleanup guidance for a provider that does not exist.

Reason

When a sandbox references a provider only through a credential binding, OpenShell rejects the detach with a wrapped precondition failure: credential_binding references provider '<name>', but that provider is not attached to the sandbox. reportsProviderNotAttached did not recognize that diagnostic, so destroy treated an already-detached provider as a real detach failure.

Related issues

Fixes #13644

Changes

  • provider-diagnostic-cli.ts: add BINDING_ONLY_PROVIDER_PATTERN and bindingOnlyProviderName(). reportsProviderNotAttached now returns true when the diagnostic names the requested provider and carries OpenShell's FailedPrecondition status text. A diagnostic that names a different provider, or has any other status such as a permission error, is still a failure.
  • A new test file, provider-adapter-cli-binding-detach.test.ts, covers the diagnostic as OpenShell wraps it across lines (both x/| and ×/│ box characters, with the provider name split by the wrap). A matching provider returns { ok: true, value: { changed: false } }. A different provider, or the same message with a permission-denied status, returns ok: false. The tests are in a new file because the existing adapter test file is at its growth budget.

Verification

  • Without the fix (HEAD^ source), the new tests fail: the detach is reported as a failure.
  • npx vitest run --project cli src/lib/adapters/openshell/: 49 files, 1203 tests passed locally at 4afd423656.
  • Before the status restriction, the permission-denied test fails: the earlier pattern accepted any status code (PR Review Advisor finding).
  • npm run typecheck:cli, prek run --files on the changed files, and git diff --check: passed.
  • No host verification. This is a logic-only fix covered by Vitest, so local runs plus CI are the evidence. A live destroy of a Telegram-enabled sandbox was not run.
  • The diff contains no secrets, API keys, credentials, or dependency changes.

Review notes

No contributor sensitive paths changed. The commit was created through the GitHub API and is Verified. Independent review is pending.


Signed-off-by: jason-ma-nv [email protected]

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Provider detachment now correctly reports no change when a provider referenced only by a credential binding is already unattached.
    • Diagnostics naming a different provider or reporting a different status continue to be treated as failures, so unrelated CLI messages aren’t mistaken for successful detachment.

OpenShell reports detaching a provider that a sandbox references only through
a credential binding as a wrapped precondition failure: "credential_binding
references provider '<name>', but that provider is not attached to the
sandbox". Destroy treated it as a real detach failure and printed
residual-state cleanup guidance for a provider that does not exist.
Accept that exact diagnostic, for the requested provider only, as an
idempotent detach.

Fixes #13644

Signed-off-by: jason-ma-nv <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jason-ma-nv jason-ma-nv self-assigned this Oct 23, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 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 Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4aa520a and 4afd423.

Files selected for processing: 2
  • src/lib/adapters/openshell/provider-adapter-cli-binding-detach.test.ts
  • src/lib/adapters/openshell/provider-diagnostic-cli.ts

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

Walkthrough

The CLI now treats a matching wrapped credential-binding diagnostic as an unchanged detach result. Tests cover accepted diagnostic formats and rejection of messages that name another provider or use a different status message.

Changes: Provider detach diagnostics

Layer / File(s) Summary
Recognize binding-only provider diagnostics
src/lib/adapters/openshell/provider-diagnostic-cli.ts, src/lib/adapters/openshell/provider-adapter-cli-binding-detach.test.ts
The diagnostic parser recognizes the wrapped credential-binding message when it names the requested provider. Tests cover ASCII and Unicode formatting variants, a different provider name, and a different status message.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested labels: bug-fix

Suggested reviewers: rsliter

Merge Risk: Minimal · up to 4afd4

No actionable issue remains before merge. The reported sandbox-destroy fix has not been verified with a live destroy.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 "fix(providers): treat binding-only providers as detached" matches the main change. The PR adds recognition of OpenShell's wrapped FailedPrecondition diagnostic for a binding-only provider s…
Linked Issues check Passed Issue #13644 requires binding-only Telegram providers to be treated as already detached. The change matches the complete wrapped OpenShell FailedPrecondition diagnostic and requires the diagnostic pro…
Out of Scope Changes check Passed The pull request changes only provider diagnostic handling and adds focused adapter tests. Both changes directly support issue #13644. No unrelated source, dependency, or configuration changes are pre…
Full details: Title check

Explanation

The title "fix(providers): treat binding-only providers as detached" matches the main change. The PR adds recognition of OpenShell's wrapped FailedPrecondition diagnostic for a binding-only provider so that it counts as detached, and the new tests and the reportsProviderNotAttached change in provider-diagnostic-cli.ts support this. The title is short, specific, and follows the conventional commit style. It does not cover the narrowed status matching or the permission-denied test, which is expected.

Full details: Linked Issues check

Explanation

Issue #13644 requires binding-only Telegram providers to be treated as already detached. The change matches the complete wrapped OpenShell FailedPrecondition diagnostic and requires the diagnostic provider name to equal the requested provider. Permission-denied diagnostics and diagnostics for another provider remain failures. The new tests cover ASCII and Unicode wrapped forms, provider-name mismatch, and permission denial. The reported CLI Vitest run passed.

Full details: Out of Scope Changes check

Explanation

The pull request changes only provider diagnostic handling and adds focused adapter tests. Both changes directly support issue #13644. No unrelated source, dependency, or configuration changes are present in the reviewed diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

Copy link
Copy Markdown
Contributor

This repository limits you to 5 open pull requests. Please close or merge an existing PR before opening another one.

@github-actions github-actions Bot closed this Oct 23, 2026
@github-code-quality

github-code-quality Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/plugin

main 63002cd fix/13644-binding-on... 4afd423 +/-
96% 97% +1%
View coverage of the 10 most impacted files.
File main 63002cd fix/13644-binding-on... 4afd423 +/-
nemoclaw/src/onboard/config.ts 98% 96% -2%
nemoclaw/src/index.ts 94% 93% -1%
nemoclaw/src/bl...print/runner.ts 95% 95% 0%
nemoclaw/src/bl...ime-identity.ts 97% 97% 0%
nemoclaw/src/bl...t-management.ts 100% 100% 0%
nemoclaw/src/co.../config-show.ts 100% 100% 0%
nemoclaw/src/commands/slash.ts 100% 100% 0%
nemoclaw/src/ru...time-context.ts 100% 100% 0%
nemoclaw/src/sh...er-boundary.cts 100% 100% 0%
nemoclaw/src/on...native-route.ts 0% 100% +100%

TypeScript / code-coverage/cli

main 63002cd fix/13644-binding-on... 4afd423 +/-
84% 86% +2%
View coverage of the 10 most impacted files.
File main 63002cd fix/13644-binding-on... 4afd423 +/-
src/lib/onboard.ts 62% 50% -12%
src/lib/actions...ess-recovery.ts 65% 81% +16%
src/lib/inferen...ollama/proxy.ts 41% 61% +20%
src/lib/onboard.../application.ts 55% 84% +29%
src/lib/domain/...y/dimensions.ts 0% 72% +72%
src/lib/inferen...er/lifecycle.ts 0% 75% +75%
src/lib/actions...ry/operation.ts 0% 76% +76%
src/lib/actions...try/snapshot.ts 0% 81% +81%
src/lib/inferen...ovider/index.ts 0% 88% +88%
src/lib/actions...ned-recovery.ts 0% 93% +93%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 27, 2026 03:12 UTC

@jason-ma-nv jason-ma-nv reopened this Oct 27, 2026
jason-ma-nv and others added 2 commits October 27, 2026 09:42
Match only the FailedPrecondition status OpenShell uses for a provider that
a sandbox references only through a credential binding. The earlier pattern
accepted any status code, so an authorization failure with the same message
could be read as an idempotent detach. Add a test for that case.

Refs #13644

Signed-off-by: jason-ma-nv <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jason-ma-nv

Copy link
Copy Markdown
Collaborator Author

Advisor disposition for run 40436252180 (verification evidence, P1): valid. The binding-only pattern accepted any status code, so a permission error carrying the same message could be read as an idempotent detach. Fixed in 4afd423: the pattern now matches only OpenShell's FailedPrecondition status text, and a new test asserts that the same message with a permission-denied status stays a detach failure. The test fails against the previous pattern.

@github-actions

Copy link
Copy Markdown
Contributor

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

Request review only when Require no Advisor blockers is green.

All previous runs

@jason-ma-nv
jason-ma-nv marked this pull request as ready for review October 27, 2026 03:49

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

Reviewed exact head 4afd423 against #13644. The parser recognizes only the exact binding-only FailedPrecondition for the requested provider, and tests preserve wrong-provider and permission failures. Exact-head CI and CodeRabbit pass; all Advisor specialists are clear and the plan recommends no E2E selectors. Current-main merge projection is clean.

@rsliter
rsliter merged commit 2d08549 into main Oct 27, 2026
159 of 164 checks passed
@rsliter
rsliter deleted the fix/13644-binding-only-provider-detach branch October 27, 2026 21:54
@wscurran wscurran added area: messaging Messaging channels, bridges, manifests, or channel lifecycle area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: telegram Telegram integration or channel behavior labels Oct 28, 2026
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: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression integration: telegram Telegram integration or channel behavior

Projects

None yet

3 participants