Skip to content

Feat/signal integration#601

Closed
KacperLa wants to merge 11 commits intoHKUDS:mainfrom
KacperLa:feat/signal-integration
Closed

Feat/signal integration#601
KacperLa wants to merge 11 commits intoHKUDS:mainfrom
KacperLa:feat/signal-integration

Conversation

@KacperLa
Copy link
Copy Markdown

This pull request adds support for Signal Messenger integration via the signal-cli daemon and updates the documentation and configuration to reflect this new capability. It also introduces new configuration classes and logic to enable and manage the Signal channel, and ensures user/session metadata is handled for improved context in agent prompts.

Signal Messenger Integration:

  • Added Signal channel support using the signal-cli daemon, including new configuration options and channel initialization logic. (nanobot/channels/manager.py, nanobot/config/schema.py) [1] [2] [3]
  • Updated documentation to announce Signal support, describe setup steps, configuration options, and usage instructions. (README.md) [1] [2] [3]

Agent Context Improvements:

  • Enhanced the agent's build_messages method to accept and process a metadata parameter, allowing user/session information (such as sender name) to be included in the system prompt for better context. (nanobot/agent/context.py, nanobot/agent/loop.py) [1] [2] [3] [4] [5]

# Conflicts:
#	README.md
#	nanobot/agent/context.py
#	nanobot/agent/loop.py
#	nanobot/channels/manager.py
#	nanobot/cli/commands.py
#	nanobot/config/schema.py
@chengyongru
Copy link
Copy Markdown
Collaborator

Hi, thank you for your contribution!

This PR has merge conflicts with the main branch that have remained unresolved for an extended period. To keep the repository healthy, we're closing stale PRs with conflicts.

If you're still interested in this feature, please feel free to reopen with the conflicts resolved. We'd be happy to review a fresh PR!

@chengyongru
Copy link
Copy Markdown
Collaborator

Because this issue has been inactive for a long time, I will close it. If there are any other problems, please feel free to open a new issue.

super-david-ramos pushed a commit to super-david-ramos/nanobot-barnaby that referenced this pull request Mar 17, 2026
…S#657)

* fix: atomic claim prevents scheduled tasks from executing twice (HKUDS#138)

Replace the two-phase getDueTasks() + deferred updateTaskAfterRun() with
an atomic SQLite transaction (claimDueTasks) that advances next_run
BEFORE dispatching tasks to the queue. This eliminates the race window
where subsequent scheduler polls re-discover in-progress tasks.

Key changes:
- claimDueTasks(): SELECT + UPDATE in a single db.transaction(), so no
  poll can read stale next_run values. Once-tasks get next_run=NULL;
  recurring tasks get next_run advanced to the future.
- computeNextRun(): anchors interval tasks to the scheduled time (not
  Date.now()) to prevent cumulative drift. Includes a while-loop to
  skip missed intervals and a guard against invalid interval values.
- updateTaskAfterRun(): simplified to only record last_run/last_result
  since next_run is already handled by the claim.

Closes HKUDS#138, HKUDS#211, HKUDS#300, HKUDS#578

Co-authored-by: @taslim (PR HKUDS#601)
Co-authored-by: @baijunjie (Issue HKUDS#138)
Co-authored-by: @Michaelliv (Issue HKUDS#300)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* style: apply prettier formatting

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

* fix: track running task ID in GroupQueue to prevent duplicate execution (HKUDS#138)

Previous commits implemented an "atomic claim" approach (claimDueTasks)
that advanced next_run before execution. Per Gavriel's review, this
solved the symptom at the wrong layer and introduced crash-recovery
risks for once-tasks.

This commit reverts claimDueTasks and instead fixes the actual bug:
GroupQueue.enqueueTask() only checked pendingTasks for duplicates, but
running tasks had already been shifted out. Adding runningTaskId to
GroupState closes that gap with a 3-line fix at the correct layer.

The computeNextRun() drift fix is retained, applied post-execution
where it belongs.

Closes HKUDS#138, HKUDS#211, HKUDS#300, HKUDS#578

Co-authored-by: @taslim (PR HKUDS#601)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add changelog entry for scheduler duplicate fix

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

* docs: add contributors for scheduler race condition fix

Co-Authored-By: Taslim <9999802+taslim@users.noreply.github.com>
Co-Authored-By: BaiJunjie <7956480+baijunjie@users.noreply.github.com>
Co-Authored-By: Michael <13676242+Michaelliv@users.noreply.github.com>
Co-Authored-By: Kyle Zhike Chen <3477852+kk17@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: gavrielc <gabicohen22@yahoo.com>
Co-authored-by: Taslim <9999802+taslim@users.noreply.github.com>
Co-authored-by: BaiJunjie <7956480+baijunjie@users.noreply.github.com>
Co-authored-by: Michael <13676242+Michaelliv@users.noreply.github.com>
Co-authored-by: Kyle Zhike Chen <3477852+kk17@users.noreply.github.com>
steinnes pushed a commit to steinnes/nanobot that referenced this pull request Apr 7, 2026
- Add SignalConfig, SignalDMConfig, SignalGroupConfig to schema
- Add nanobot/channels/signal.py from PR HKUDS#601

Requires signal-cli daemon running in HTTP mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants