feat(session): add unbounded connect and linked send - #187
Merged
Merged
Conversation
git fetch origin master
git rebase origin/master
# after resolving the conflicts
git push --force-with-leaseThe |
Add /session connect|disconnect as a 1:1 in-memory link that forwards the target without expiry, and let /send omit the UMO after connect. AI-Generated: true Generated-At: 2026-09-13T20:17:07Z
BegoniaHe
force-pushed
the
feat/session-connect
branch
from
September 13, 2026 20:39
3136ae1 to
32a2f60
Compare
|
✅ Conflicts resolved; removing the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
/session connect//session disconnectso an operator can pair the current session with a target UMO: unbounded forwarding plus/sendwithout repeating the UMO.Related issue
Fixes #186
Behavior
/session connect <UMO>creates or replaces a 1:1 in-memory link. Incoming messages from the target are forwarded until disconnect or process restart. Requiressession.watchon both sessions in the same config./session connectwith no argument shows the current link or usage./session disconnectdrops that link. Requiressession.read, same as/session unwatch./send [content](including attachment-only) delivers to the linked target./send <UMO> [content]still sends to an explicit UMO.Non-goals
Implementation notes
SessionBridgeManager(expires_at=None, no expiry task).envelope_from_send_event(..., target_in_header=False)strips only the/sendtoken.bridges.connect/disconnect/connection/send(..., target_in_header=True).Validation
95 focused pytest cases passed.
make checkand full pytest were not run.Compatibility and risk
/sendstill accepts an explicit UMO; omitting it only works after connect.SessionWatch.expires_atis nowfloat | None. Unbounded links reportremaining_seconds=0; checkexpires_at is None.Checklist
docs/zh/anddocs/en/.docs/public/openapi.json, and tests change together when routes or schemas change.pyproject.toml,requirements.txt, anduv.locktogether.!and aBREAKING CHANGE:footer.Agent note
Goal: give operators an unbounded 1:1 session link that forwards the target and defaults
/sendto it, without persisting across restarts or adding a Dashboard.Paths:
astrbot/core/platform/session_bridge.py,message_projection.py,plugin_context.py, builtin session commands and i18n, bilingual docs, focused unit tests.Checks actually run: ruff on touched Python; pyright on touched Python; 95 focused pytest cases. Did not run
make checkor full pytest.Residual risk: links are in-memory;
expires_attype widened; markdownlint was not run because the local CLI binary was missing.Tools: opencode / grok-4.6, local source, ruff, pyright, pytest, gh. Followed AGENTS.md, AI_POLICY.md, .agents/shared/conventional-commit/REFERENCE.md, and .agents/shared/ai-contribution/REFERENCE.md.