Repository navigation
fix(providers): treat binding-only providers as detached - #13649
Conversation
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]>
|
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. |
|
No actionable comments were generated in the recent review.
|
| 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:
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: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
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
#13644requires 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.
|
This repository limits you to 5 open pull requests. Please close or merge an existing PR before opening another one. |
Code coverage overviewLanguages: TypeScript TypeScript / code-coverage/plugin
View coverage of the 10 most impacted files.
TypeScript / code-coverage/cli
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
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]>
|
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. |
|
PR Review Advisor finished for commit Request review only when Require no Advisor blockers is green. |
rsliter
left a comment
There was a problem hiding this comment.
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.
Outcome
Destroying a Telegram-enabled sandbox no longer warns that it failed to detach the
telegram-bridgeprovider, 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.reportsProviderNotAttacheddid 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: addBINDING_ONLY_PROVIDER_PATTERNandbindingOnlyProviderName().reportsProviderNotAttachednow 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.provider-adapter-cli-binding-detach.test.ts, covers the diagnostic as OpenShell wraps it across lines (bothx/|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, returnsok: false. The tests are in a new file because the existing adapter test file is at its growth budget.Verification
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 at4afd423656.npm run typecheck:cli,prek run --fileson the changed files, andgit diff --check: passed.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