feat(app): merge local and remote message sources#1
Merged
Conversation
Add --after-id to the team messages endpoint so polling clients can fetch rows strictly after a cursor. Forward pages select the oldest matching rows before emitting them in ascending order, preventing gaps when more than the requested limit arrives between polls; backward history keeps its existing newest-page behavior. Reject simultaneous before/after cursors and cover both cursor exclusivity and multi-page forward ordering in the API tests.
Allow Team Room to combine the implicit local agmsg installation with read-only installations reached over SSH. Sources are configured in ~/.agmsg/config/app-sources.json and queried through the public api.sh interface with the system SSH client; the app never mounts, copies, or synchronizes messages.db and does not store credentials. Keep history pages and live cursors independent per source, deduplicate messages with source-qualified ids, and merge them in stable timestamp order. Modern remotes use lossless --after-id polling while older cores fall back to refreshing their latest 100 messages. Show source badges and remote members for filtering while keeping spawn, rename, leave, and compose operations local-only. Add source validation, Rust and frontend coverage, and configuration documentation.
Resolve the sidebar member list, where fujibee#385 (agent and team status) and multi-source support both rewrote the same block. Everything else merges cleanly. Take the pane status dot from fujibee#385 and drop the running dot it replaced. Keep the source-qualified key, since two sources can carry members with the same name. Keep the read-only guards for members that come from a remote source: no spawn, no context menu, source label in the title. Read-only members have no local pane, so their status is null and the check slot renders empty.
A read-only member from a remote source showed the status dot of a local pane when both carried the same name. Reproduce by joining claude-win on both a Windows and a Mac installation, then spawning the Windows one: the Mac claude-win shows a running dot although nothing runs on the Mac. Panes are local-only, and member names are unique per source rather than globally, so matching a pane on the name alone breaks as soon as two sources carry the same name. Exclude read-only members before the lookup. Both fujibee#385 and the multi-source work matched panes by name, so the gap predates this branch and only surfaced once the two met. The 91 frontend tests stayed green throughout; it took spawning an agent against a real two-source setup to see it.
The multi-source work reformatted the tests module's import list to add message_sources, shell_quote, and valid_source_id, and dropped run_script while doing so. The four tests that call it are gated on #[cfg(not(target_os = "windows"))], so on Windows they are compiled out and the missing import never surfaces — cargo test stays green. macOS compiles them and fails with E0425. Found by running the suite on a fork PR before proposing this upstream; the Windows-only local runs could not have caught it.
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.
fork 側に取り込む。upstream には fujibee#389 として提案済みだが、方針に合わなければ閉じられる想定なので、こちらの main では使える状態にしておく。
CI をここで通しておく意味もある。upstream の PR は fork からの初回コントリビューターのため
action_requiredで承認待ちになり、fujibee さんが見るまでチェックが走らない。bats / macOS / Windows のレグはローカルでは回せていないので、ここで確認する。内容は fujibee#389 と同じ:
~/.agmsg/config/app-sources.jsonで宣言、api.sh経由で取得--after-id未対応の古い core には最新100件 fallback実機の Windows + Mac 2台構成で確認済み。