Skip to content

feat(openshell-provider): add openshell_web_search - #13246

Merged
cv merged 2 commits into
v1from
feat/web-search
Oct 15, 2026
Merged

cv merged 2 commits into
v1from
feat/web-search

Conversation

@cv

@cv cv commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Part of #13228. Part of #13131.

Failure

Web search took two resources, a search provider profile and a registration, that had to agree on names, owner, and generation. Generated graphs got those right by construction, but hand-written HCL had to reproduce NemoClaw's hashed naming scheme and keep the two in sync by hand.

Decision

  • New resource openshell_web_search owns both OpenShell objects. It takes:

    • workspace, a ref; its owner comes from the workspace, so the resource takes no owner;
    • name, which scopes the objects; their OpenShell names derive from it, the provider, and credential_env, as before;
    • provider_type, brave or tavily; provider is an OpenTofu meta-argument;
    • credential_env;
    • binaries.

    Any input change replaces it.

  • Composite backend. The openshell provider delegates to its profile and registration kinds: the profile first, then the registration. Removal goes in reverse, deleting each half through its observed row.

  • Recovery. When only one half exists, refresh reports the missing half's inputs as empty, so the plan shows drift and replaces the resource. A failure between the two halves returns a partial result carrying the identity, so OpenTofu taints the resource and the next apply replaces it. Recreating with a fresh generation would otherwise conflict with the surviving half forever.

  • Optional fields. credential_env and binaries are optional in the schema only so that the drift above is observable; plans reject them when missing.

  • Shared ref type. Registrations and web search export refs of a shared type, openshell_provider, with a computed registration naming the OpenShell registration. openshell_sandbox.providers takes those refs. openshell_inference will use the same type in the next PR.

  • Derived attributes stay out of backend rows (nemoclaw-tofu). Backends never observe them, and the OpenShell read-back compares every field it was given.

  • Generated graphs emit one openshell_web_search per provider, credential reference, and image in place of the profile and registration; its binaries come from the harness, as profiles' did. Sandbox grants use the derived profile name, export checks web search drift, and the CLI labels it web search/<provider>.

  • Old state. The SDK record version is now 14, so state holding the separate search profile and registration is rejected with a recovery message.

Validation

  • New contract test web_search_owns_its_profile_and_registration against the OpenShell fixture covers:

    • creating both objects, with a sandbox attaching the ref;
    • a no-op re-plan;
    • recovery by replacement after the registration disappears;
    • removal without destroy mode once the sandbox is gone.

    It failed before the change: first with an invalid resource type, then on the recovery step, which led to the partial-result and drift handling.

  • SDK, e2e, and fixture tests are updated, and the compiled fixtures regenerated. The schema rule now accepts an owner carried by a reference.

  • Plain cargo ci passes locally: 1540 unit tests and 143 lifecycle tests.

cv added 2 commits October 15, 2026 01:08
Contract test web_search_owns_its_profile_and_registration still fails:
the profile ensure returns BindingMismatch.
One resource owns a web search provider's OpenShell profile and
registration. Its owner comes from its workspace ref, its OpenShell names
derive from its inputs, and a missing half shows as drift and replaces
it. Registrations and web search export refs of the shared
openshell_provider type that sandboxes take in providers. Generated
graphs emit it in place of the search profile and registration, and the
SDK record version moves to 14.
@cv
cv enabled auto-merge (squash) October 15, 2026 08:43
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit cacc165 into v1 Oct 15, 2026
@cv
cv deleted the feat/web-search branch October 15, 2026 08:55
cv added a commit that referenced this pull request Oct 15, 2026
…hell_provider_registration (#13257)

Closes #13228. Part of #13131.

## Failure

`openshell_inference` (#13252) and `openshell_web_search` (#13246)
replace the separate provider profile and registration types. Generated
graphs stopped emitting the old types in #13253. They were still served,
though, and fell short in ways that only showed once nothing else
covered them:

- `openshell_inference` replaced itself on any input change, including a
rotated credential reference. OpenShell refuses to delete a registration
a sandbox attaches, so rotating a key on a running deployment would have
failed. The old registration rotated keys in place.
- A missing profile replaced the resource for the same reason, and
failed the same way. The old profile resource simply recreated it.
- Omitting an optional input such as a credential, `binaries`, or
`cluster_source` silently kept the previous value instead of resetting
it.
- The composite read didn't report the registration's observed owner and
generation, so a registration taken over by another owner went
unnoticed.

## Decision

- **Old types removed.** The `openshell` provider no longer serves
`openshell_provider_profile` or `openshell_provider_registration`. The
profile and registration kinds remain only as the backend operations the
composite resources delegate to. Their type names, exports, references,
and structured inputs are gone from `nemoclaw-openshell`.
- **Credential rotation in place.** `openshell_inference` treats
`credential_env` as mutable and replaces only when authentication is
added or removed, the rule the old registration had.
- **Missing profile recreated in place.** For both composite resources,
`binaries` is mutable, and a change replaces only when the refreshed
value was non-empty. An empty value means the profile was missing, so
the change becomes an update that recreates it and leaves the attached
registration alone. A missing registration still replaces the resource;
nothing attaches a profile directly.
- **Omission resets.** Both resources declare `reset_when_omitted` for
their optional inputs, so omission selects the default.
- **Identity checked.** The composite read reports the registration's
owner and generation, and refuses when the profile and registration
disagree.
- **Tests and docs.** The standalone and Fabric contract configurations
use `openshell_inference`. The adapter refresh tests use the composite
definitions, and the fixture helpers and e2e expectations drop the old
types. One refresh test of the old profile's `bound_fields` rule is
removed: no served definition declares that rule now, and
`nemoclaw-tofu` tests it directly. `docs/provider.md` drops the old
types and describes the in-place cases.

The earlier attempt to give Ollama proxy registrations their readiness
read's `ref` (#13255) is closed. That read runs during apply, so the
`ref` was unknown at every plan and forced a replacement on each apply;
details are in #13254. Generated graphs keep literal `inference_server`
objects. Reading servers instead is tracked in #13254 (one root) and
#13256 (external server checks).

## Validation

- Standalone contract tests cover the new rules: credential rotation
keeps the registration's ID, adding or removing authentication replaces
it, a missing profile plans an update with one effect, a missing
registration plans a replacement, and a foreign owner is refused. The
two adapter refresh tests for omission defaults failed until
`reset_when_omitted` was added.
- Plain `cargo ci` passes locally: 1538 unit tests and 144 lifecycle
tests.
- `cargo ci live-docker` passes locally, including
`sdk_docker_proxy_lifecycle_preserves_readiness_and_storage_guards`,
which caught #13255.
@wscurran wscurran added area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality integration: brave Brave integration behavior labels Oct 15, 2026
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality integration: brave Brave integration behavior v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants