Remove restart infrastructure, generalize WASM channel setup#493
Remove restart infrastructure, generalize WASM channel setup#493think-in-universe merged 3 commits intomainfrom
Conversation
…fic code Remove the gateway restart mechanism (hot-activation works, restart won't fix activation failures) and generalize Telegram-specific hardcoded checks so all WASM channels get equal treatment. Part 1 - Remove restart infrastructure: - Remove needs_restart from ActionResponse, restart_requested from GatewayState - Remove gateway_restart_handler, /api/gateway/restart route, exit code 75 - Remove restart overlay JS/CSS (dead code - restartGateway() never called) - Surface actual activation errors instead of suggesting restart Part 2 - Generalize Telegram-specific code: - Replace telegram_owner_id: Option<i64> with generic wasm_channel_owner_ids: HashMap<String, i64> (backwards-compatible via TELEGRAM_OWNER_ID env var) - Pairing status check now applies to all active WASM channels - All channels get 3-step stepper in web UI, remove "coming soon" note - Remove dead setup_telegram() code (~700 lines) - Telegram's capabilities.json declares required_secrets, so the generic setup_wasm_channel() path handles it Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the channel management system by eliminating the defunct gateway restart functionality and generalizing the setup process for WASM channels. The changes streamline the codebase, remove dead code, and ensure that all WASM-based channels benefit from a consistent and robust activation and configuration flow, moving away from Telegram-specific special casing. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively removes the gateway restart infrastructure and generalizes the WASM channel setup, removing Telegram-specific logic. The changes are consistent across the backend, frontend, and tests. I've identified one area for improvement regarding test coverage for the new configuration setting.
Note: Security Review did not run due to the size of the PR.
| #[test] | ||
| fn test_telegram_owner_id_default_none() { | ||
| fn test_wasm_channel_owner_ids_default_empty() { | ||
| let settings = Settings::default(); | ||
| assert_eq!(settings.channels.telegram_owner_id, None); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_telegram_owner_id_via_set() { | ||
| let mut settings = Settings::default(); | ||
| settings | ||
| .set("channels.telegram_owner_id", "987654321") | ||
| .unwrap(); | ||
| assert_eq!(settings.channels.telegram_owner_id, Some(987654321)); | ||
| assert!(settings.channels.wasm_channel_owner_ids.is_empty()); | ||
| } |
There was a problem hiding this comment.
The test test_telegram_owner_id_via_set was removed. While the telegram_owner_id field is gone, this test was covering the Settings::set functionality. With the new wasm_channel_owner_ids being a HashMap, it would be beneficial to add a new test to ensure that setting values in this map via the set method works as expected. This would prevent potential regressions in configuration management.
#[test]
fn test_wasm_channel_owner_ids_via_set() {
let mut settings = Settings::default();
settings
.set("channels.wasm_channel_owner_ids.telegram", "987654321")
.unwrap();
assert_eq!(
settings.channels.wasm_channel_owner_ids.get("telegram"),
Some(&987654321)
);
}There was a problem hiding this comment.
Good catch — added the test in 20e6f65. The Settings::set() dotted-path API handles this correctly: "987654321" is parsed as a JSON number by the fallback path (line 837) and deserializes into HashMap<String, i64> without issues.
Addresses review feedback: verify that setting per-channel owner IDs via the dotted-path Settings::set() API works correctly with the new HashMap<String, i64> type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
loadPairingRequests only refreshed the pairing section, not the stepper status. Call loadExtensions() instead so the stepper updates from "Awaiting Pairing" to "Active" immediately after approval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…pdate Comprehensive v0.14.0 documentation review across all 19 docs files: - Add v0.13.1 and v0.14.0 release sections to README - Fix OAuth schema in BUILDING_CHANNELS (remove fabricated fields, correct validation_endpoint structure, add full field reference, OAuth callback env vars, all credential injection location types, secrets-in-on_start note) - Add workspace initialization files docs (TOOLS.md/BOOTSTRAP.md) to AGENT_README - Fix WASM channel hot-activation (v0.14.0 nearai#493), remove all "requires restart" refs - Remove non-existent POST /api/gateway/restart route from channels.md - Add TOOLS.md/BOOTSTRAP.md to workspace-memory seeded files and identity table - Add disk-to-DB import section to workspace-memory - Add Brave Web Search tool documentation (v0.13.1 nearai#474) - Add OAuth for WASM tools section to config.md with WASM_CHANNEL_OWNER_IDS env var - Add Worker SSE streaming and routine thread_id isolation to agent.md - Update all 19 files to v0.14.0 version headers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pdate Comprehensive v0.14.0 documentation review across all 19 docs files: - Add v0.13.1 and v0.14.0 release sections to README - Fix OAuth schema in BUILDING_CHANNELS (remove fabricated fields, correct validation_endpoint structure, add full field reference, OAuth callback env vars, all credential injection location types, secrets-in-on_start note) - Add workspace initialization files docs (TOOLS.md/BOOTSTRAP.md) to AGENT_README - Fix WASM channel hot-activation (v0.14.0 nearai#493), remove all "requires restart" refs - Remove non-existent POST /api/gateway/restart route from channels.md - Add TOOLS.md/BOOTSTRAP.md to workspace-memory seeded files and identity table - Add disk-to-DB import section to workspace-memory - Add Brave Web Search tool documentation (v0.13.1 nearai#474) - Add OAuth for WASM tools section to config.md with WASM_CHANNEL_OWNER_IDS env var - Add Worker SSE streaming and routine thread_id isolation to agent.md - Update all 19 files to v0.14.0 version headers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
) * refactor: remove restart infrastructure and generalize Telegram-specific code Remove the gateway restart mechanism (hot-activation works, restart won't fix activation failures) and generalize Telegram-specific hardcoded checks so all WASM channels get equal treatment. Part 1 - Remove restart infrastructure: - Remove needs_restart from ActionResponse, restart_requested from GatewayState - Remove gateway_restart_handler, /api/gateway/restart route, exit code 75 - Remove restart overlay JS/CSS (dead code - restartGateway() never called) - Surface actual activation errors instead of suggesting restart Part 2 - Generalize Telegram-specific code: - Replace telegram_owner_id: Option<i64> with generic wasm_channel_owner_ids: HashMap<String, i64> (backwards-compatible via TELEGRAM_OWNER_ID env var) - Pairing status check now applies to all active WASM channels - All channels get 3-step stepper in web UI, remove "coming soon" note - Remove dead setup_telegram() code (~700 lines) - Telegram's capabilities.json declares required_secrets, so the generic setup_wasm_channel() path handles it Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: add Settings::set() test for wasm_channel_owner_ids Addresses review feedback: verify that setting per-channel owner IDs via the dotted-path Settings::set() API works correctly with the new HashMap<String, i64> type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(web): refresh extension stepper after pairing approval loadPairingRequests only refreshed the pairing section, not the stepper status. Call loadExtensions() instead so the stepper updates from "Awaiting Pairing" to "Active" immediately after approval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
restartGateway()was already dead code (defined but never called).setup_telegram()code — Telegram's capabilities.json declaresrequired_secrets, so the genericsetup_wasm_channel()path handles it.Test plan
cargo clippy --all --benches --tests --examples --all-features— zero warningscargo test— all passcargo fmt --check— cleangrep -rn 'channel_name == "telegram"\|ext\.name == "telegram"\|isTelegram\|telegram_owner_id' src/— zero hitsTELEGRAM_OWNER_IDenv var still works (backwards compat)🤖 Generated with Claude Code