Repository navigation
refactor!: compile web search to an openshell_api with REST rules - #14651
Merged
Merged
Conversation
openshell_api gains a rest block of method and path rules for one host endpoint. The SDK compiles a webSearch integration into that resource, and the openshell provider no longer serves openshell_web_search.
|
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. |
Collaborator
Author
Authoring session — opening
|
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-14651.docs.buildwithfern.com/nemoclaw |
…mes for api integrations
# Conflicts: # docs/agents-inference/agents.md # docs/references/provider.md # docs/security/sandbox-network.md
… refactor/web-search-as-api
kaofelix
marked this pull request as ready for review
November 20, 2026 13:41
cv
pushed a commit
that referenced
this pull request
Nov 21, 2026
…4736) Teams that keep OpenTofu in their own repository and pipelines now have one guide for running NemoClaw's providers without the CLI or SDK. It walks through installing the providers from a bundle, state and locking, CI/CD, credentials, sandbox replacement, and teardown, and says at each step what the SDK would have done for them, so they can pick a path. ## Problem The providers already work from hand-written HCL with any state backend, as the compatibility page says. The steps, though, are spread across the provider reference, the compatibility page, and comments in `examples/hcl`, and installation gets a single bullet. Nothing tells a team how to keep `.terraform.lock.hcl` valid across runners, which inputs a plan job needs, what happens when a create's reply is lost, or that `tofu destroy` deletes the model cache that `nemoclaw destroy` would keep. Resolves #14723. Running under Terraform stays with #14725, and publishing the providers stays with #12638. ## Change - New guide `docs/build-deploy/opentofu-project.md`, under Building and Deploying after Using Desired State: - A table comparing your own project with the CLI or SDK on state, lost creation replies (the pending-creation guard), ownership generations, plan checks, destroy, and recovery. - Installing from the bundle's `providers` directory as a filesystem mirror: the version from `manifest.json`, exact pins for pre-release versions, the `provider_installation` block, and what to do with the lock file when the bundle changes. - State: any backend that locks, kept apart from CLI state, one OpenShell workspace name per project and OpenTofu workspace, and the directory that `NEMOCLAW_KUBERNETES_STATE` names for a managed Kubernetes gateway. - CI/CD: what a job needs, including model endpoints that readiness data sources poll and their 32,400 second default wait; one gateway endpoint everywhere; `tofu providers lock -fs-mirror` for other runner platforms; and a postcondition that stops a plan at an incompatible gateway, since the travel examples do not check `compatible`. - Credentials as variable names: `credential_env` on the travel team's `openshell_api` registration, the gateway's TLS variables, and `kubeconfig_env` on a managed Kubernetes gateway's three `openshell_kubernetes_*` resources, next to the kubeconfig path Helm takes and the variable the gateway's specification names. A model server's key reaches `openshell_inference` through `credential_env` on a literal server, or through `credential_source` on a readiness read's `ref` for a server that requires its generated key. - `terraform_data` with `replace_triggered_by`, from the travel example, plus the `tofu apply -replace` step after an agent start loses its reply. - Teardown: what `tofu destroy` deletes, keeping the OpenShell workspace with `-exclude`, and the GTC DC example's targeted teardown for a managed Kubernetes gateway, whose `openshell_kubernetes_storage` the provider never deletes. - The compatibility page's Hand-Written HCL section now agrees with the guide on what `tofu destroy` deletes and on what state stores for credentials. - The overview, the docs index, and the provider reference link to the guide. The provider reference's install bullet now points to it, and Fern navigation lists it. - Current limits gain rows for Terraform (#14725), the missing lost-reply guard in hand-written HCL (#14726), handing a CLI deployment over (#14721), and the unpublished tested version set (#14722). Every HCL snippet is an excerpt of `examples/hcl/travel` or `examples/hcl/travel-team`, apart from the gateway postcondition, which mirrors the check generated graphs add. The credential example uses `openshell_api` instead of `openshell_web_search`, which #14651 replaces. I left the provider reference's teardown bullet alone because it sits next to a line #14651 rewrites; the guide agrees with it and adds the `-exclude` step. The parent RFC (#14699) is not accepted yet, so here is the decision record: - Decision: document the hand-written HCL path that v1 already has. - Reason: compatibility already supports it with any backend, and an integration test applies both examples unchanged. The guide adds no new support claim. - Placement: one task guide in Building and Deploying. The provider reference keeps the per-type contracts. - Validation: the docs build and link checks, plus the OpenTofu runs below. No test qualifies a complete deployment from hand-written HCL on live resources. The provider reference already says so, and the guide repeats it. No issue tracks adding that qualification yet. ## Beyond CI With OpenTofu 1.13.9 and a development bundle's `providers` directory on macOS ARM64: - `tofu init` with the guide's CLI configuration installed the NVIDIA providers from the mirror at the pinned version, labelled `unauthenticated`, and sent `kreuzwerker/docker` to the registry. - Without an exact pin, `tofu init` found no matching release for the pre-release provider. After a pin changed, `tofu init` needed `-upgrade`. - `.terraform.lock.hcl` held checksums for the local platform only. `tofu providers lock -fs-mirror=... -platform=linux_amd64`, run against a mirror laid out for that platform, added its checksum and kept the existing one. - The gateway postcondition snippet passed `tofu validate` against the bundle's openshell provider. - With built-in `terraform_data` stand-ins, `prevent_destroy` made `tofu destroy` refuse to run, and `tofu destroy -exclude` destroyed everything except the excluded resource. Not run: `tofu init` for the full travel example, because the Docker provider's registry download was blocked in this environment; `tofu validate` or `plan` of the examples; and anything against a live gateway. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added a guide to using the providers from a team-owned OpenTofu project and pipeline, including setup, state management, CI checks, credentials, and teardown. * Added links to the guide from the documentation overview and provider reference. * Updated provider installation guidance and documented limitations for hand-written configurations, including unsupported imports and Terraform testing. * Clarified how state, credentials, and resource protection affect teardown, and added references to tracked provider limitations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Deepak Jain <deepujain@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SDK now compiles a
webSearchintegration into anopenshell_apiresource whose newrestrules admit only the search requests, and the openshell provider no longer servesopenshell_web_search. HCL configurations that declaredopenshell_web_searchmust declare anopenshell_apiinstead; YAML deployments keep theirwebSearchdefinitions.Problem
OpenShell has no web search concept: a search registration is an ordinary provider profile and registration, the same objects
openshell_apicreates. The openshell provider still servedopenshell_web_searchas a separate resource, with its own profile builder, registration naming, credential handling, lifecycle and import code, and Brave and Tavily hard-coded below the SDK.openshell_apicould not replace it, because it granted either full access to each endpoint's path subtree or MCP rules, never specific REST requests such as Brave'sGET /res/v1/web/search. The SDK also wrote a second copy of the search grant into each sandbox's policy.Change
openshell_apiREST rules. Arestblock, besidemcp, lists rules in OpenShell's own allow-rule shape, matching a method, a path glob, or both. With it the resource takes one endpoint naming only a scheme, host and port, and the profile enforces exactly those requests. A resource sets at most one ofrestandmcp, and neither when APF serves its profile.openshell_policy::validate_and_canonicalize_sandbox_policy, so a plan fails on rules that validation rejects. NemoClaw adds no rule checks of its own for REST.SearchProviderand its table of hosts, key headers, default sandbox variables and REST rules move fromnemoclaw-openshellinto the SDK's integration configuration. AwebSearchintegration compiles to anopenshell_apitarget with those values. The OpenShell endpoint grant is the same one the search resource created. On an APF-governed gateway the target sets no rules, because APF's profile does.<provider>-search-<credential reference hash>-<image scope>, so sandboxes that share the provider, credential reference and image still share one registration, and the name fits OpenShell's 40-character limit. Inference provider andapiintegration names cannot use thebrave-searchortavily-searchprefixes, so those names identify a web search, as the plan output's label relies on.nemoclaw-braveornemoclaw-tavily.openshell_web_search,nemoclaw-openshell'ssearchmodule, and the search paths in the provider's profile, registration, connection, lifecycle, import and input code. The deleted module's notice described collector-grant code that an earlier change had already removed.openshell_apitarget, so export also refuses drift in anapiintegration'scredential_env,sandbox_env,auth_styleorheader_name.web search/<provider>. Apply progress names everyopenshell_apirow, search included,API credential.openshell_apiandrestrules; the provider reference, agent, and sandbox network pages describe the new grant; thesandboxEnvdescription now names the provider's default variable, which the sandbox already received.Deployments applied with web search before this change cannot plan or destroy afterwards: their state holds
openshell_web_searchresources, which the openshell provider no longer serves. No state migration is provided; such a deployment must be torn down with the earlier release first. An APF bundle must serve the search profile under its new name,nemoclaw-api-<provider>-search-….Beyond CI
restrules produce the same OpenShell endpoints as the removedsearch_policyfor both Brave and Tavily.cargo ci live-dockerandcargo ci live-kind, and the ignoredmanaged_gateway_liveprofile revision test, which now imports the REST-restricted API profiles in place of search profiles.