MessageTool writes to session; remove max_messages limit #11

Closed
wylab wants to merge 57 commits from feature/message-session-write into main
Owner

Summary

  • MessageTool now writes sent messages to session history via SessionManager
  • Agent loop wires SessionManager into MessageTool constructor
  • Session.get_history() returns full history (removed max_messages limit)

Implementation

When message() tool is called (e.g., from heartbeat forks), the sent message is now recorded in the corresponding session's conversation history. This ensures the main conversational agent can see messages sent by other invocations.

Files changed:

  • nanobot/agent/tools/message.py - Added SessionManager parameter, writes to session after send
  • nanobot/agent/loop.py - Wires SessionManager into MessageTool
  • nanobot/session/manager.py - Removed max_messages limit (server-side API handles trimming)

Testing

Unit test confirms MessageTool writes to session correctly
No circular dependencies
All imports clean

Design

See: docs/plans/2026-02-21-message-session-write-design.md

## Summary - **MessageTool** now writes sent messages to session history via SessionManager - **Agent loop** wires SessionManager into MessageTool constructor - **Session.get_history()** returns full history (removed max_messages limit) ## Implementation When `message()` tool is called (e.g., from heartbeat forks), the sent message is now recorded in the corresponding session's conversation history. This ensures the main conversational agent can see messages sent by other invocations. **Files changed:** - `nanobot/agent/tools/message.py` - Added SessionManager parameter, writes to session after send - `nanobot/agent/loop.py` - Wires SessionManager into MessageTool - `nanobot/session/manager.py` - Removed max_messages limit (server-side API handles trimming) ## Testing ✅ Unit test confirms MessageTool writes to session correctly ✅ No circular dependencies ✅ All imports clean ## Design See: `docs/plans/2026-02-21-message-session-write-design.md`
wylab added 1 commit 2026-02-22 00:06:24 +01:00
MessageTool writes to session; remove max_messages limit
Build Nanobot OAuth / cleanup (pull_request) Has been skipped
Build Nanobot OAuth / build (pull_request) Successful in 23m57s
deb1fcd68b
- MessageTool now writes sent messages to session history via SessionManager
- Agent loop wires SessionManager into MessageTool constructor
- Session.get_history() returns full history (removed max_messages limit)
  Server-side context editing API handles trimming, so we send full history

This ensures messages sent via the message() tool (e.g., from heartbeat forks)
are visible in the main conversational agent's context.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
code-server closed this pull request 2026-02-22 00:24:10 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wylab/nanobot#11