feat(tools): philips_hue tool for local Hue Bridge#6470
Open
theonlyhennygod wants to merge 1 commit intomasterfrom
Open
feat(tools): philips_hue tool for local Hue Bridge#6470theonlyhennygod wants to merge 1 commit intomasterfrom
theonlyhennygod wants to merge 1 commit intomasterfrom
Conversation
Adds a `philips_hue` Tool that drives a local Philips Hue Bridge over the v2 CLIP API. Read actions (`list_lights`, `get_light`, `list_scenes`, `list_rooms`, `list_groups`) require `ToolOperation::Read`; mutating actions (`set_light`, `recall_scene`, `set_group`) require `ToolOperation::Act` and are further restricted by an operator-controlled `allowed_resource_types` allowlist. `PhilipsHueConfig` is disabled by default and carries `#[integration(category = "ToolsAutomation", display_name = "Philips Hue", ...)]` so the schema-driven registry picks it up automatically post-#6386. The application key is `#[secret]`-encrypted at rest and falls back to `PHILIPS_HUE_APPLICATION_KEY`. `verify_tls` defaults to `false` because Hue bridges ship self-signed certs on the LAN — the operator can flip it on when fronting the bridge with a real cert. Adds setup-guide doc with the push-button pairing flow, a `zeroclaw integrations info "Philips Hue"` hint arm, and a CHANGELOG-next entry. Closes #6449
This was referenced May 6, 2026
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.
Summary
masterphilips_hueTool that drives a local Philips Hue Bridge via the v2 CLIP API. The integration was previously declared with no implementation; this lights up the developer-page card and gives the agent direct control over lights, scenes, rooms, and groups.list_*,get_light) gate onToolOperation::Read; mutations (set_light,recall_scene,set_group) gate onToolOperation::ActAND a configurableallowed_resource_typesallowlist enforced server-side inexecute().#[integration(category = "ToolsAutomation", display_name = "Philips Hue", description = "Smart lighting via local Hue Bridge", status_field = "enabled")]onPhilipsHueConfig— no edits toregistry.rsneeded./api/<user>/lights/...shim).api.meethue.comcloud relay).bridge_address(IP or<id>.local).application_key.zeroclaw-config(additive[philips_hue]block, default disabled),zeroclaw-tools(new module),zeroclaw-runtime/src/tools/mod.rs(config-gated registration + tool re-export),zeroclaw-runtime/src/integrations/mod.rs(setup-hint arm —registry.rsuntouched under the new schema-driven catalog), docs.Validation Evidence (required)
cargo fmt --all -- --check cargo clippy -p zeroclaw-config -p zeroclaw-tools -p zeroclaw-runtime --all-targets -- -D warnings cargo test -p zeroclaw-config -p zeroclaw-tools -p zeroclaw-runtimecargo fmt --all -- --check→ clean (no diff aftercargo fmt --all).cargo clippy ...→Finisheddevprofile [unoptimized + debuginfo] target(s) in 38.47s. No warnings.cargo test -p zeroclaw-config -p zeroclaw-tools -p zeroclaw-runtime→test result: ok. 620 passed; 0 failed; 0 ignored(zeroclaw-config)test result: ok. 1630 passed; 0 failed; 1 ignored(zeroclaw-tools)test result: ok. 1162 passed; 0 failed; 0 ignored(zeroclaw-runtime)philips_hue::tests::*— name, schema shape (action enum), URL/base normalization, allowlist trimming,build_light_statebody shape (omits unset fields, emits all when set), missing-action / unknown-action / missing-id (get/set/recall) / no-state-fields / disallowed-resource-type / empty-allowlist paths,spec()reflection.Philips Hueautomatically — confirmed by reading the newall_integrations(&Config)loop, which consumesConfig::integration_descriptors(), which is auto-generated by the#[integration(...)]attribute theConfigurablederive picks up.zeroclaw integrations info "Philips Hue"prints the push-button pairing steps (new arm inshow_integration_info).set_light/recall_sceneHTTP success paths are not covered. Unit tests exhaustively cover the gating logic (allowlist, missing fields, security policy) and request body assembly (build_light_state)../dev/ci.sh allbecause the change is scoped to three crates + docs + a changelog entry; targeted clippy+test runs already gated those crates with-D warnings.Security & Privacy Impact (required)
https://<bridge_address>/clip/v2/.... Disabled by default; operator opts in.application_keyfield onPhilipsHueConfigcarries#[secret](encrypted at rest when[secrets] encrypt = true) and falls back toPHILIPS_HUE_APPLICATION_KEYenv var.192.0.2.10is RFC 5737 documentation IP,test-key, UUIDs are synthetic).verify_tls = falseis the default because Hue bridges ship with self-signed certs that no public CA chain validates. The risk is a same-LAN MITM swapping bridges. Mitigation: documented in the setup guide; operators on hardened networks can flip toverify_tls = trueif they front the bridge with a reverse-proxied real cert. The flag flows through toreqwest::Client::builder().danger_accept_invalid_certs(!verify_tls).allowed_resource_typescould let the agent recall scenes the operator didn't expect. Mitigation: defaults are conservative (light,grouped_light,scene,room); empty allowlist blocks all mutations; the check fires server-side inexecute()before any HTTP call.Compatibility (required)
enabled: false.Config::default()includesphilips_hue: PhilipsHueConfig::default()so existing configs missing[philips_hue]continue to deserialize unchanged.[philips_hue]block; newPHILIPS_HUE_APPLICATION_KEYenv var fallback. No CLI changes.[philips_hue] enabled = true,bridge_address, and eitherapplication_keyorPHILIPS_HUE_APPLICATION_KEY(after one-time push-button pairing — documented).Rollback (required for
risk: mediumandrisk: high)[philips_hue] enabled = falsein~/.zeroclaw/config.toml(or remove the block) and restart the agent. The tool is unregistered on next boot.philips_hue.enabled(master switch).philips_hue.allowed_resource_types(per-mutation throttle; empty disables all mutations while keeping reads available).philips_hue.verify_tls(TLS posture).philips_hue: enabled but no application key found ...or... bridge_address is empty — skipping registrationindicate config issues.philips_hue: failed to construct HTTP client: ...indicates a system TLS init failure.Philips Hue {action} ... failed (4xx/5xx)indicates upstream bridge problems (key revoked, bridge unreachable, resource ID stale)./api/toolswill not includephilips_hueif eitherbridge_addressorapplication_keyis missing.