Files
ironclaw/channels-src
firat.sertgoz 06527e4f22 fix(channels): unify hot-activation owner_id type and capabilities fallback (#2471)
* Fix WASM channel owner_id fallback

* ci: ignore rand advisory

* ci: satisfy cargo-deny path dependency versions

* fix(telegram): handle null/string owner_id and propagate to WASM config

The bundled Telegram capabilities.json ships `"owner_id": null`. The
previous code only called `Value::as_i64()`, which returns `None` for
`Null`, so the fallback silently produced no owner — the fix never
actually worked for Telegram.

Changes:
- Handle `Null`, `String`, and `Number` variants in
  `owner_actor_id_for_channel()` so the real production payload works.
- Propagate the *resolved* owner_id into the WASM runtime config map
  regardless of whether it came from runtime config or capabilities
  fallback (previously only the runtime-config path injected it).
- Add `tracing::debug!` for non-scalar owner_id values to aid debugging.
- Add tests: null config, missing capabilities file, empty string,
  non-scalar value, and caller-level register_channel tests that verify
  config injection and null-owner-id handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(channels): unify owner_id type and add capabilities fallback to hot-activation

Address two follow-up items from PR #2349 review:

1. Type consistency: boot path injected owner_id as Value::String, but
   hot-activation path (build_wasm_channel_runtime_config_updates) used
   Value::Number. Changed the function to accept Option<&str> and inject
   as Value::String, matching the boot path.

2. Capabilities fallback: hot-activation paths (complete_loaded_wasm_channel_activation
   and refresh_active_channel) only checked runtime HashMap and settings store.
   Now they also consult capabilities.json via the extracted
   owner_id_from_capabilities() helper, matching the boot path's behavior.

Also updates the telegram WASM module to accept both string and number
JSON for owner_id via a custom deserializer, since all other channels
already use Option<String>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
2026-04-18 13:22:09 +09:00
..