Repository navigation
fix(credentials): reject untrusted gateway endpoint overrides (#11414) - #11865
Conversation
Fixes #11414 Signed-off-by: Deepak Jain <[email protected]>
Signed-off-by: Deepak Jain <[email protected]>
Fixes #11414 Signed-off-by: Deepak Jain <[email protected]>
Signed-off-by: Deepak Jain <[email protected]>
Signed-off-by: Deepak Jain <[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. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change stops endpoint-override probing before command execution. It adds an ChangesGateway endpoint override diagnostics
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant CredentialsAdd as credentials add
participant Recovery as recoverGatewayOrExit
participant Observer as gateway-observer-cli
CredentialsAdd->>Recovery: Recover gateway
Recovery->>Observer: Observe gateway
Observer-->>Recovery: Return endpoint_override transport failure
Recovery-->>CredentialsAdd: Report OPENSHELL_GATEWAY_ENDPOINT guidance
Suggested reviewers: Merge Risk: ⚪ Minimal · up to Endpoint overrides and unreachable gateway failures stop credential creation before provider mutation, with condition-appropriate remediation. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Resolution Probe the selected or ambient endpoint with the bounded, read-only, credential-free ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall line coverage in commit e33c113 in the TypeScript / code-coverage/cliThe overall line coverage in commit e33c113 in the Show a line coverage summary of the most impacted files.
Updated |
Signed-off-by: Deepak Jain <[email protected]>
|
Addressed the PR Advisor security, recovery, and verification findings on commit 8004299. Ambient endpoint overrides are now rejected locally before any host-side probe, the diagnostic names OPENSHELL_GATEWAY_ENDPOINT and tells the operator to unset or correct it, and the PR no longer claims to fully close #11414. Plugin build, CLI build, CLI typecheck, and 41 focused tests pass. |
Signed-off-by: Deepak Jain <[email protected]>
|
Addressed the current-head Advisor finding in |
Signed-off-by: Deepak Jain <[email protected]>
Signed-off-by: Deepak Jain <[email protected]>
|
Fixed the broken CI assertion in daac724 by aligning the integration test with the current endpoint-recovery guidance and guarding against the retired wording. Validation: 9 focused credential-recovery tests passed, formatting passed, and passed. |
Signed-off-by: Deepak Jain <[email protected]>
|
Addressed the exact-head PR Advisor finding in signed commit e33c113. Added direct add, list, and reset coverage for endpoint-override recovery, including assertions that provider, registry, and authority side effects do not run. Validation: 22 focused tests passed and all pre-commit hooks passed, including growth guardrails. The local full CLI build remains blocked by existing portable inferred-type errors in unrelated test fixtures; fresh CI is running on the exact head. |
|
PR Review Advisor finished for commit Request review only when Require no Advisor blockers is green. |
<!-- markdownlint-disable MD041 --> ## Outcome OpenShell inference route reads now flow through one typed observer for the accepted first slice of #9809. Existing gateway targeting, native lifecycle behavior, list/status redaction, and external command behavior remain unchanged. ## Reason Inference consumers independently constructed `openshell inference get` commands and interpreted raw CLI results. Centralizing the read boundary gives each consumer the same scoped, typed, and redacted observation without changing mutation or recovery behavior. ### Related issues Refs #9809 ## Changes - Add typed configured and unconfigured observations plus distinct validation, authentication, timeout, schema, transport, and command failures. - Keep named-gateway scoping, bounded capture, control-sequence cleanup, endpoint-override refusal, and the base gateway's legacy output compatibility inside the OpenShell adapter. - Migrate the accepted CLI, onboarding, connect, readiness, doctor, inventory, status, and config-export readers to typed results. - Remove the superseded production reader and protect the boundary with adapter and consumer tests. Route mutation and rollback (#11738), plugin transport (#9813), generated gRPC transport (#9828), credentials, provider or gateway lifecycle changes, new routing semantics, status lifecycle suppression, and live E2E remain excluded. ## Verification - `NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cli` — passed. - `npm run checks:repository` — all 19 repository checks passed with no architecture cycles. - Focused CLI unit selection — 16 files and 377 tests passed, covering the adapter and migrated source consumers. - Focused integration selection — 8 files and 157 tests passed; the status JSON integration suite passed 21/21. - `npm run test:changed` — 3,182 tests passed. The route-observation acceptance set is complete with no candidate-owned failure. Two process-heavy suites were classified environmental after focused replay; `snapshot-auto-create-failure` passed 4/4 unchanged and `runtime-provider-contract` passed 75/75 with a 15-second local diagnostic timeout. - The remaining launch group was classified inherited: 18 cases fail with the same sandbox-replacement journaling error on this candidate and on exact base `3c6591ddba4a321ab8e6b766203e44d6e3b8002e`; this PR changes none of the three owning launch/probe files. - Commit hooks passed, including repository structure, formatting, lint, tests selected by the commit, DCO, and secret checks. - The diff contains no secrets, API keys, or credentials. No live E2E is required because the accepted behavior is fully observable at deterministic adapter and consumer boundaries and does not mutate external state. ## Review notes Sensitive inference and onboarding paths are changed. Pre-publication review covered exact gateway targeting, refusal of endpoint overrides, bounded capture, typed failure separation, redaction, current lifecycle ownership, and the criterion-to-evidence ledger. The refreshed head still requires exact-head CodeRabbit, PR Review Advisor, CI, and human approval before merge. The current-main refresh incorporates related lifecycle and test-contract changes from #11741, #11776, #11792, #11821, #11829, #11865, #11889, #11891, #11908, and #11913 without expanding this PR's behavior. Accepted scope: #9809 (comment) --- Signed-off-by: Rebecca Sliter <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added structured inference-route checks for configured and unconfigured gateways. - Improved support for named gateways and provider/model verification. - Added clearer handling for timeouts, authentication, connectivity, validation, and schema errors. - Improved sandbox connection, launch readiness, status, onboarding, and recovery flows with verified route information. - **Bug Fixes** - Prevented untrusted or unavailable inference routes from being treated as healthy. - Added recovery guidance and preserved relevant failure details when restoration cannot be confirmed. - **Documentation** - Documented inference-route behavior, gateway scoping, sanitization, timeouts, and error reporting. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Rebecca Sliter <[email protected]> Signed-off-by: San Dang <[email protected]> Co-authored-by: Rebecca Sliter <[email protected]> Co-authored-by: San Dang <[email protected]>
Outcome
nemoclaw credentials addnow rejects an ambientOPENSHELL_GATEWAY_ENDPOINToverride locally before any host-side network probe or provider mutation.The diagnostic names the override and tells the operator to unset or correct it before retrying.
Changes
endpoint_overrideresult through gateway recovery.Refs #11414.
This same-repository PR supersedes fork PR #11676.
The security-safe repair does not claim to distinguish a responding override from an unreachable override because doing that would require the host to contact an untrusted ambient destination.
Verification
npm --prefix nemoclaw run buildnpm run build:cliNODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cligit diff --checkSigned-off-by: Deepak Jain [email protected]
Summary by CodeRabbit
New Features
Bug Fixes