Skip to content

fix: persist channel activation state across restarts#432

Merged
ilblackdragon merged 4 commits intonearai:mainfrom
zmanian:fix/392-persist-channel-activation
Mar 1, 2026
Merged

fix: persist channel activation state across restarts#432
ilblackdragon merged 4 commits intonearai:mainfrom
zmanian:fix/392-persist-channel-activation

Conversation

@zmanian
Copy link
Copy Markdown
Collaborator

@zmanian zmanian commented Feb 28, 2026

Summary

Test plan

  • Activate a WASM channel via the web UI, restart IronClaw, verify the channel is auto-activated
  • Remove a channel via the web UI, restart, verify it is not auto-activated
  • Verify channels loaded from disk at startup are not double-activated

🤖 Generated with Claude Code

@github-actions github-actions Bot added scope: extensions Extension management size: M 50-199 changed lines labels Feb 28, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a critical usability issue by ensuring that the activation state of WASM channels is preserved across application restarts. It introduces mechanisms to persist active channel names to the settings store and to automatically re-activate these channels when the application starts, significantly improving the user experience for managing extensions.

Highlights

  • Channel State Persistence: Implemented functionality to save and load the names of actively used channels to and from the application's settings store.
  • Automatic Activation: Configured the application to automatically activate channels that were active in a previous session upon startup.
  • Bug Fix: Resolved an issue where channels activated via the web UI would not remain active after an application restart.
Changelog
  • src/extensions/manager.rs
    • Added persist_active_channels asynchronous function to save current active channel names to the settings store.
    • Added load_persisted_active_channels asynchronous function to retrieve previously saved active channel names from the settings store.
    • Integrated calls to persist_active_channels when a WASM channel is removed.
    • Integrated calls to persist_active_channels when a WASM channel is hot-activated.
  • src/main.rs
    • Created a HashSet to track WASM channels loaded from disk at startup.
    • Implemented logic to load persisted active channels and activate them if they were not already loaded from disk, preventing double-activation.
Activity
  • No human activity (comments, reviews) has occurred on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added risk: medium Business logic, config, or moderate-risk modules contributor: experienced 6-19 merged PRs labels Feb 28, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces persistence for activated channels, ensuring they are automatically re-activated on restart. The implementation correctly adds calls to persist the channel state upon activation and removal, and includes logic at startup to load and activate these persisted channels. My review focuses on improving the robustness of the new loading mechanism. I've suggested a change to add logging for potential database or deserialization errors, which will enhance observability and aid in debugging.

Comment thread src/extensions/manager.rs
zmanian added a commit to zmanian/ironclaw that referenced this pull request Mar 1, 2026
Replace silent catch-all with explicit error logging when
database queries or deserialization fails for activated channels.

Addresses Gemini review feedback on PR nearai#432.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
zmanian and others added 2 commits February 28, 2026 21:38
Channels activated via the web UI were lost on restart because
active_channel_names was only in memory. Now persist activation state
to the settings store under "activated_channels" and auto-activate
persisted channels on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace silent catch-all with explicit error logging when
database queries or deserialization fails for activated channels.

Addresses Gemini review feedback on PR nearai#432.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zmanian zmanian force-pushed the fix/392-persist-channel-activation branch from 49261fe to 5d3f2fb Compare March 1, 2026 05:38
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
ilblackdragon
ilblackdragon previously approved these changes Mar 1, 2026
@ilblackdragon ilblackdragon enabled auto-merge (squash) March 1, 2026 08:35
Refactor error handling for loading activated channels setting.
@ilblackdragon ilblackdragon merged commit fa52df5 into nearai:main Mar 1, 2026
13 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 1, 2026
zmanian added a commit to zmanian/ironclaw that referenced this pull request Mar 1, 2026
* fix: persist channel activation state across restarts (nearai#392)

Channels activated via the web UI were lost on restart because
active_channel_names was only in memory. Now persist activation state
to the settings store under "activated_channels" and auto-activate
persisted channels on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: log warnings for channel activation load failures

Replace silent catch-all with explicit error logging when
database queries or deserialization fails for activated channels.

Addresses Gemini review feedback on PR nearai#432.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
bkutasi pushed a commit to bkutasi/ironclaw that referenced this pull request Mar 28, 2026
* fix: persist channel activation state across restarts (nearai#392)

Channels activated via the web UI were lost on restart because
active_channel_names was only in memory. Now persist activation state
to the settings store under "activated_channels" and auto-activate
persisted channels on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: log warnings for channel activation load failures

Replace silent catch-all with explicit error logging when
database queries or deserialization fails for activated channels.

Addresses Gemini review feedback on PR nearai#432.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Illia Polosukhin <ilblackdragon@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: experienced 6-19 merged PRs risk: medium Business logic, config, or moderate-risk modules scope: extensions Extension management size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Every time ironclaw is (re) launched the telegram channel is not active

2 participants