Skip to content

upstream(sync): Tier 1 CLI + dev-mcp — buzz://message links and ~ paths (#6359, #6271) - #300

Merged
cursor[bot] merged 1 commit into
mainfrom
devin/issue-284-message-links-tilde-paths
Aug 23, 2026
Merged

upstream(sync): Tier 1 CLI + dev-mcp — buzz://message links and ~ paths (#6359, #6271)#300
cursor[bot] merged 1 commit into
mainfrom
devin/issue-284-message-links-tilde-paths

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 22, 2026

Copy link
Copy Markdown

Summary

Ports two Tier 1 upstream Buzz changes (block#6359, block#6271) into Crew, without touching Crew-specific behaviour.

CLI — buzz messages thread accepts buzz://message links (block#6359). New links::parse_message_link mirrors parseMessageLink in desktop/src/features/messages/lib/messageLink.ts, so a Desktop "Copy link" can be pasted straight into --event:

buzz messages thread --event 'buzz://message?channel=<uuid>&id=<hex>'
buzz messages thread --channel <uuid> --event <hex>        # unchanged

--channel becomes optional (Option<String>); resolution is:

if is_message_link(event):
    link = parse_message_link(event) or Usage("invalid buzz://message link: …")
    if channel and channel != link.channel_id: Usage("--channel … does not match the link's channel …")
    -> (link.channel_id, link.event_id)     # `thread=` is informational, ignored
else:
    channel or Usage("--channel is required unless --event is a buzz://message link")

dev-mcp — leading ~ expansion (block#6271). read_file and str_replace share paths::resolve_path, so expansion goes in one place: ~ → home, ~/x$HOME/x, ~other/... deliberately left alone (no guessing another user's home), and the existing Windows MSYS conversion still runs after expansion. Adds dirs = "6" to buzz-dev-mcp.

Crew-specific behaviour preserved: --evidence / evidence.rs untouched, channel-first IA intact (#278) — the link only supplies the channel, it never bypasses channel scoping. No divergence from upstream intent found. Docs updated in AGENTS.md and crates/buzz-cli/README.md.

Related issue

Fixes #284 (part of the Buzz 0.5.18 sync stack, meta #285).

Testing

TDD: tests written first (RED), then implementation (GREEN). Non-UI change, so evidence is full terminal logs (attached to the session message).

  • RED: crates/buzz-cli and crates/buzz-dev-mcp failed to compile / failed on the new cases before implementation.
  • GREEN: cargo test -p buzz-cli --lib links + ... commands::messages → 38 passed, incl. thread_accepts_message_link_without_channel_flag, thread_link_conflicting_with_channel_flag_is_input_error, thread_link_with_thread_param_resolves_to_linked_event, thread_rejects_malformed_message_link, thread_without_channel_or_link_is_input_error, thread_keeps_explicit_channel_and_event_flags, and the pre-existing evidence_flag_* tests. cargo test -p buzz-dev-mcp → 108 passed, incl. tilde_slash_expands_to_home_relative_path, tilde_alone_expands_to_home, named_user_tilde_is_not_expanded, tilde_is_left_alone_when_home_is_unknown, resolve_path_reads_home_relative_path_via_tilde.

Gates (all run individually, not via just ci):

Gate Result
pnpm --filter buzz check pass
pnpm --filter buzz typecheck pass
pnpm --filter buzz test pass
just _ensure-sidecar-stubs + just check-compile pass
cargo clippy -p buzz-cli -p buzz-dev-mcp --all-targets -- -D warnings pass
cargo fmt -p buzz-cli -p buzz-dev-mcp -- --check only pre-existing diff in untouched commands/agents.rs
just test-unit 4 pre-existing failures, unrelated (see below)

Pre-existing failures on main, reproduced with this branch's changes stashed:

  • buzz-cli tests::command_inventory_is_stable, tests::subcommand_counts_are_stable, tests::subcommand_names_are_stable — the base already ships the org group and agents call, while the inventory snapshots still expect 23 groups / 5 agents subcommands. This PR adds no commands.
  • buzz-db migration::tests::embedded_migrator_contains_consolidated_initial_schema.

Not fixed here: out of #284's scope and owned by other issues in the sync stack.


Handover NOTES

DONE

Implementation is complete and pushed (devin/issue-284-message-links-tilde-paths, HEAD 1c3c0714c = impl commit 5d4188807 + the parent session's merge of main).

Tests (TDD: RED captured before implementation, GREEN after; re-verified after the main merge): buzz-cli links 6 passed, buzz-cli commands::messages 38 passed, buzz-dev-mcp lib 108 passed.

Gates run individually (never full just ci): pnpm --filter buzz check, pnpm --filter buzz typecheck, pnpm --filter buzz test, just _ensure-sidecar-stubs + just check-compile, cargo clippy -p buzz-cli -p buzz-dev-mcp --all-targets -- -D warnings — all pass. cargo fmt -p buzz-cli -p buzz-dev-mcp -- --check reports only a pre-existing diff in untouched crates/buzz-cli/src/commands/agents.rs. just test-unit has 4 failures that reproduce on main with this branch's changes stashed (3 buzz-cli command-inventory snapshots — base already ships org + agents call; 1 buzz-db migration test).

Evidence (non-UI change, so full untruncated logs). Session-VM paths:

  • Re-captured after a VM restart wiped /tmp/home/ubuntu/evidence-284/: green-cli-links.log (6 passed), green-cli-messages.log (38 passed), green-devmcp.log (108 passed), gate-pnpm-check.log, gate-pnpm-typecheck.log, gate-sidecar-stubs.log, gate-check-compile.log, gate-clippy.log, gate-fmt-check.log (exit 1 only from the untouched commands/agents.rs diff). Each file ends with the command's exit= status.
  • Runtime black-box against the real binaries (fake recording relay + raw stdio JSON-RPC) — /home/ubuntu/pr300-evidence/: cli-output.log, relay-requests.log, relay-requests-snapshot.log, mcp-output.log, mcp-stderr.log, plus the harness scripts cli-tests.sh, mcp-drive.py, fake_relay.py. These prove the resolved channel/event actually sent in the outgoing relay filter (link-only and link+matching-channel resolve identically to the explicit flags; the thread= value never appears), that conflicting/malformed input exits 1 without contacting the relay while valid input against a dead relay exits 2, and that ~/x reads/edits the real home-relative file while ~nonexistentuser/x is left literal.
  • Lost with the /tmp wipe (not re-runnable now without redoing the RED state): the original red-cli.log / red-devmcp.log, gate-pnpm-test.log, gate-just-test-unit.log, and the base-branch reproduction logs preexisting-main-*.log, base-e2e-*.log. Their results are summarised above and in the earlier PR comment; the base-E2E reproduction commands are recorded there verbatim if anyone wants to re-run them.

IN PROGRESS

Nothing. The working tree is clean; every file in the diff is committed and pushed. The only uncommitted artifact is an untracked, intentionally-not-committed suggested skill at .agents/skills/cli-devmcp-blackbox/ on the session VM (submitted separately as a skill suggestion, out of #284's scope).

TODO / NEXT

  • Nothing required for upstream(sync): Tier 1 CLI + dev-mcp — message links and ~ paths (#6359, #6271) #284 itself — this is ready for the parent session to merge once CI is scheduled.
  • CI observed (do not fix here): Desktop Smoke E2E (1/2/3) and Desktop E2E Integration (1/2, 2/2) failed. This PR contains zero desktop/ files, and the identical specs/assertions fail on a clean origin/main worktree — see the earlier comment on this PR for the reproduction. NuncioCrew Gate runs may also show as cancelled: the parent session is deliberately serialising CI because the Actions pool is saturated, which is expected and not a failure of this change.
  • Known risks / conflicts: the only cross-cutting touch points are AGENTS.md and Cargo.lock, so trivial conflicts are possible if sibling sync PRs edit the same doc sections or add dependencies. MessagesCmd::Thread.channel is now Option<String> — any sibling PR adding a call site must pass Option. The stale buzz-cli command-inventory snapshots and the buzz-db migration test will keep failing just test-unit until whichever issue owns them lands.

Link to Devin session: https://app.devin.ai/sessions/18c28cba00b340f1b15aab7f44a72d62
Requested by: @oscarlehuu

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

Runtime verification (binary-level, no relay)

Built cargo build -p buzz-cli -p buzz-dev-mcp at 5d4188807 and drove the real binaries:
the CLI against a recording fake relay (answers POST /query with [] and logs the request body,
so the resolved channel/event are observable), and buzz-dev-mcp over raw stdio JSON-RPC with the
server cwd set to a temp workspace (not $HOME), so an unexpanded ~ would visibly fail.

CLI — messages thread link resolution (all passed)
case result
--help shows link example + --channel optional ✅ Usage requires only --event
link only, no --channel ✅ exit 0, relay got "#h":["9a1657ac-…"] from the link
link + matching --channel ✅ exit 0, identical filter
link + conflicting --channel ✅ exit 1, --channel … does not match the link's channel …, no relay request
bare hex, no --channel ✅ exit 1, --channel is required unless --event is a buzz://message link
buzz://message?channel=&id= / ?id=<hex> / bare buzz://message ✅ exit 1, invalid buzz://message link: … (expected …)
buzz://thread?… (wrong host) ✅ treated as bare id → exit 1 (hex validation), never sent
percent-encoded link (%2D) ✅ relay got decoded UUID
link vs dead relay 127.0.0.1:1 ✅ exit 2 network_error (resolution succeeded; 1 vs 2 distinguished)
regression --channel + --event <hex> ✅ exit 0, correct #h/#e
$ buzz --format compact messages thread --event 'buzz://message?channel=9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50&id=c3b589fa…be1dd1&thread=71d67180…b9224'
[]
[exit=0]

# fake relay received (link's thread= hex appears nowhere):
POST /query
[{"#e":["c3b589fa…be1dd1"],"#h":["9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50"],
  "kinds":[9,40002,40003,40008,45003],"limit":100},
 {"ids":["c3b589fa…be1dd1"],"limit":1}]

$ buzz messages thread --channel 00000000-0000-0000-0000-000000000000 --event '<same link>'
{"error":"user_error","message":"--channel 00000000-0000-0000-0000-000000000000 does not match the link's channel 9a1657ac-f7aa-5db0-b632-d8bbeb6dfb50","retryable":false}
[exit=1]

Across the run the relay logged exactly 4 requests — one per success case; every input-error case
sent nothing.

dev-mcp — leading ~ expansion (all passed)

Server cwd = /home/ubuntu/pr300-evidence/mcp-workspace; probe file at $HOME/dev-mcp-tilde-probe-55306.txt.

→ read_file {"path":"~/dev-mcp-tilde-probe-55306.txt"}
← "~/dev-mcp-tilde-probe-55306.txt (lines 1-3 of 3)\n1:alpha\n2:beta\n3:gamma\n"

→ str_replace {"path":"~/dev-mcp-tilde-probe-55306.txt","old_str":"beta","new_str":"BETA"}
← "Replaced 1 occurrence in /home/ubuntu/dev-mcp-tilde-probe-55306.txt … -beta +BETA"
$ cat /home/ubuntu/dev-mcp-tilde-probe-55306.txt  →  alpha / BETA / gamma   (real home file edited)

→ read_file {"path":"~"}
← error -32602 "not a regular file: /home/ubuntu"                      (expanded, not literal)

→ read_file {"path":"~nonexistentuser/dev-mcp-tilde-probe-55306.txt"}
← error -32602 "path not accessible: /home/ubuntu/pr300-evidence/mcp-workspace/~nonexistentuser/…"
   (left literal — did NOT silently resolve under $HOME; probe file untouched)

→ read_file {"path":"notes.txt"}   (regression)
← "1:workspace\n2:file\n"          (still workdir-relative; no literal `~` dir created)

No failures and nothing unverified. Tested by Devin — session.

@devin-ai-integration

Copy link
Copy Markdown
Author

Desktop E2E failures are pre-existing on main

The failing checks are Desktop Smoke E2E (1/2/3) and Desktop E2E Integration (1/2, 2/2). This PR changes no frontend code — the diff is crates/buzz-cli, crates/buzz-dev-mcp, Cargo.lock and two markdown files (git diff --merge-base origin/main --name-only | grep ^desktop/ → 0 files), and the desktop E2E jobs build only the TS mock-bridge bundle.

Reproduced the same failures on a clean origin/main worktree (9bffb8cab, none of this PR's commits), pnpm --filter buzz build:e2e + xvfb-run pnpm exec playwright test --project=smoke:

✘ message-feedback-snapshots.spec.ts:97  profile hover uses the channel hover surface      (toHaveCSS)
✘ needs-restart-screenshots.spec.ts:278  03-running-restart-action                          (toHaveClass)
✘ project-commit-detail.spec.ts:29/411/493/605/663/729/777  (7 tests)                       (toBeVisible)
9 failed, 11 passed

✘ channel-mute.spec.ts:74               02 — muted channel is dimmed with BellOff icon      (toHaveCSS)
✘ edit-agent.spec.ts:288, :318          instance editor baked/global defaults               (toHaveText)
✘ entity-link-recipient-cards.spec.ts:20 bare buzz:// links render entity cards             (toContainText)
4 failed, 14 passed

Same specs, same assertions, same failure modes as CI — so they are not caused by this PR and there is nothing here to fix. CI Policy, Desktop Fast, Desktop Rust, buzz-acp, Project Relay, Relay-Driven Mesh Lifecycle Smoke, macOS ARM Package and Desktop Release Candidate are green.

@devin-ai-integration

Copy link
Copy Markdown
Author

Handover notes (stop-and-document): see the appended NOTES section in the PR description — same content as below.


Handover NOTES

DONE

Implementation is complete and pushed (devin/issue-284-message-links-tilde-paths, HEAD 1c3c0714c = impl commit 5d4188807 + the parent session's merge of main).

Tests (TDD: RED captured before implementation, GREEN after; re-verified after the main merge): buzz-cli links 6 passed, buzz-cli commands::messages 38 passed, buzz-dev-mcp lib 108 passed.

Gates run individually (never full just ci): pnpm --filter buzz check, pnpm --filter buzz typecheck, pnpm --filter buzz test, just _ensure-sidecar-stubs + just check-compile, cargo clippy -p buzz-cli -p buzz-dev-mcp --all-targets -- -D warnings — all pass. cargo fmt -p buzz-cli -p buzz-dev-mcp -- --check reports only a pre-existing diff in untouched crates/buzz-cli/src/commands/agents.rs. just test-unit has 4 failures that reproduce on main with this branch's changes stashed (3 buzz-cli command-inventory snapshots — base already ships org + agents call; 1 buzz-db migration test).

Evidence (non-UI change, so full untruncated logs). Session-VM paths:

  • Re-captured after a VM restart wiped /tmp/home/ubuntu/evidence-284/: green-cli-links.log (6 passed), green-cli-messages.log (38 passed), green-devmcp.log (108 passed), gate-pnpm-check.log, gate-pnpm-typecheck.log, gate-sidecar-stubs.log, gate-check-compile.log, gate-clippy.log, gate-fmt-check.log (exit 1 only from the untouched commands/agents.rs diff). Each file ends with the command's exit= status.
  • Runtime black-box against the real binaries (fake recording relay + raw stdio JSON-RPC) — /home/ubuntu/pr300-evidence/: cli-output.log, relay-requests.log, relay-requests-snapshot.log, mcp-output.log, mcp-stderr.log, plus the harness scripts cli-tests.sh, mcp-drive.py, fake_relay.py. These prove the resolved channel/event actually sent in the outgoing relay filter (link-only and link+matching-channel resolve identically to the explicit flags; the thread= value never appears), that conflicting/malformed input exits 1 without contacting the relay while valid input against a dead relay exits 2, and that ~/x reads/edits the real home-relative file while ~nonexistentuser/x is left literal.
  • Lost with the /tmp wipe (not re-runnable now without redoing the RED state): the original red-cli.log / red-devmcp.log, gate-pnpm-test.log, gate-just-test-unit.log, and the base-branch reproduction logs preexisting-main-*.log, base-e2e-*.log. Their results are summarised above and in the earlier comment on this PR; the base-E2E reproduction commands are recorded there verbatim if anyone wants to re-run them.

IN PROGRESS

Nothing. The working tree is clean; every file in the diff is committed and pushed. The only uncommitted artifact is an untracked, intentionally-not-committed suggested skill at .agents/skills/cli-devmcp-blackbox/ on the session VM (submitted separately as a skill suggestion, out of #284's scope).

TODO / NEXT

  • Nothing required for upstream(sync): Tier 1 CLI + dev-mcp — message links and ~ paths (#6359, #6271) #284 itself — this is ready for the parent session to merge once CI is scheduled.
  • CI observed (not fixed here, and nothing under .github/ was touched): Desktop Smoke E2E (1/2/3) and Desktop E2E Integration (1/2, 2/2) failed. This PR contains zero desktop/ files, and the identical specs/assertions fail on a clean origin/main worktree — see the earlier comment on this PR for the reproduction. NuncioCrew Gate runs may also show as cancelled: the parent session is deliberately serialising CI because the Actions pool is saturated, which is expected and not a failure of this change.
  • Known risks / conflicts: the only cross-cutting touch points are AGENTS.md and Cargo.lock, so trivial conflicts are possible if sibling sync PRs edit the same doc sections or add dependencies. MessagesCmd::Thread.channel is now Option<String> — any sibling PR adding a call site must pass Option. The stale buzz-cli command-inventory snapshots and the buzz-db migration test will keep failing just test-unit until whichever issue owns them lands.

…xpand ~ in dev-mcp paths

Ports upstream buzz block#6359 (message links) and block#6271 (tilde paths).

buzz messages thread now accepts a Desktop "Copy link"
buzz://message?channel=<uuid>&id=<hex> as --event, taking the channel from
the link (--channel optional; must agree when both are given). The optional
thread parameter is informational.

buzz-dev-mcp read_file and str_replace expand a leading ~ to the home
directory via the shared resolve_path seam; ~other/... is left alone.

Signed-off-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Oscar Le <oscar.lehuu@gmail.com>
@cursor
cursor Bot force-pushed the devin/issue-284-message-links-tilde-paths branch from 1c3c071 to e1aee5e Compare August 23, 2026 02:55
@cursor
cursor Bot merged commit addba59 into main Aug 23, 2026
14 of 28 checks passed
@cursor
cursor Bot deleted the devin/issue-284-message-links-tilde-paths branch August 23, 2026 03:45
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.

upstream(sync): Tier 1 CLI + dev-mcp — message links and ~ paths (#6359, #6271)

1 participant