Skip to content

cmux: suppress OK output from notify RPC calls#15

Open
ErebusBat wants to merge 1 commit into
0xCaso:mainfrom
ErebusBat:fix/cmux-notify-ok-output
Open

cmux: suppress OK output from notify RPC calls#15
ErebusBat wants to merge 1 commit into
0xCaso:mainfrom
ErebusBat:fix/cmux-notify-ok-output

Conversation

@ErebusBat

Copy link
Copy Markdown

The cmux CLI outputs 'OK' to stdout on success for notification.create. When opencode-cmux calls the CLI, this pollutes the user's terminal with visual noise.

This PR redirects stdout/stderr to /dev/null so notifications are silent.

Fix: Changed .quiet().nothrow() to >/dev/null 2>&1.nothrow()` in src/cmux.ts:52

Fixes visual noise in live terminal where opencode-cmux is active.

The cmux CLI outputs 'OK' to stdout on success for notification.create.
When opencode-cmux calls the CLI, this pollutes the user's terminal.
Redirect stdout/stderr to /dev/null so notifications are silent.

Fixes visual noise in live terminal where opencode-cmux is active.
@ErebusBat ErebusBat force-pushed the fix/cmux-notify-ok-output branch from d653270 to 34a782c Compare June 1, 2026 15:14

@0xCaso 0xCaso left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @ErebusBat thanks!

review from my agent:

Thanks for this, and for flagging the noise — silent notifications are absolutely the right goal. Before merging I dug into it, and unfortunately this change can't go in as-is. Two issues, both verified locally against bun 1.3.10:

  1. > /dev/null 2>&1 is invalid syntax in Bun Shell and throws a parse error.

Bun's $ only supports a single redirect per command. The combined form fails to parse:

error: expected a command or assignment but got: "Redirect"

I tested every variant (>/dev/null 2>&1, > /dev/null 2> /dev/null, with and without spaces, and the exact interpolated form from this PR) — all of them throw at parse time. A single redirect like > /dev/null works, but two do not.

Because the call is wrapped in try { … } catch { /* swallow */ }, that parse error is swallowed silently (it's a thrown JS exception, so .nothrow() doesn't apply). The net effect is that notification.create would never run — notifications would stop working entirely, with no error surfaced. That's strictly worse than the current behavior.

  1. .quiet() already suppresses both stdout and stderr.

The line has used .quiet() since v0.2.4. I confirmed that .quiet() keeps both the command's stdout and stderr from reaching the terminal, so dropping it in favor of a redirect is moving the wrong way.

Quick summary of what each form does:

  • .quiet().nothrow() (current): stdout and stderr suppressed ✅
  • > /dev/null (single redirect): valid ✅
  • > /dev/null 2>&1 (this PR): parse error → notifications silently break ❌

On the OK you're seeing: since .quiet() already captures stdout/stderr, the most likely cause is that cmux writes OK directly to the controlling TTY (/dev/tty), bypassing its stdout fd. If so, neither .quiet() nor an stdout/stderr redirect would suppress it — it would need a quiet flag on the cmux side (e.g. cmux rpc … --quiet) or an upstream fix.

Could you share a quick repro? Specifically:

  • which opencode-cmux version you're running,
  • and confirmation that the OK comes from notification.create (vs. another call).

That'll tell us whether this needs a cmux-side flag or something else.

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