Skip to content

Keep mise wrappers from writing to stdout - #6940

Merged
dhh merged 1 commit into
quattrofrom
fix-mise-wrapper-stdout
Aug 15, 2026
Merged

dhh merged 1 commit into
quattrofrom
fix-mise-wrapper-stdout

Conversation

@dhh

@dhh dhh commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

mise use -g announces the resolved tool on stdout, not stderr, so every mise-wrapped command prepended a line like

mise ~/.config/mise/config.toml tools: [email protected]

to its own output. That corrupts anything speaking a protocol over stdout, such as codex app-server.

This one is easy to confirm from the outside: it bit repeatedly while triaging the post-4.0 issues, with several grep calls in unrelated work coming back with a tools: line stuck to the front of their output.

--quiet suppresses the announcement, keeps errors on stderr, and preserves the exit status, so the || exit 1 guard still works.

The obsolete-wrapper check in migrations/1785846769.sh matched the generated command verbatim, so it is loosened to match the package rather than the flags. Confirmed it still matches both the old and new bare-package wrapper forms and still leaves the github:can1357/oh-my-pi wrapper alone.

Existing wrappers in ~/.local/bin are stale copies and keep the old line until regenerated.

Closes #6908

— 🤖 Claude, posting on behalf of @dhh

Copilot AI balanced review requested due to automatic review settings August 15, 2026 09:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents generated mise wrappers from polluting command stdout.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Adds --quiet when resolving wrapped tools.
  • Broadens obsolete-wrapper detection.
  • Updates wrapper argument assertions.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
bin/omarchy-mise-install Generates quiet mise wrappers.
migrations/1785846769.sh Recognizes old and quiet bare-package wrappers.
test/shell.d/default-agent-test.sh Expects the quiet mise invocation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread migrations/1785846769.sh
omarchy-mise-install npm:@xai-official/grok grok
omarchy-mise-install crush
elif [[ -f $HOME/.local/bin/omp ]] && grep -Fq 'mise use -g "oh-my-pi"' "$HOME/.local/bin/omp"; then
elif [[ -f $HOME/.local/bin/omp ]] && grep -Eq 'mise use -g .*"oh-my-pi"' "$HOME/.local/bin/omp"; then

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair — the fixture went through omarchy-mise-install, so it only ever exercised whichever form the current generator emits. Added explicit fixtures for all three:

  • mise use -g "oh-my-pi" (historical) — removed
  • mise use -g --quiet "oh-my-pi" (current) — removed
  • mise use -g --quiet "github:can1357/oh-my-pi" (fully qualified) — kept

Confirmed the new fixtures actually bite: reverting the matcher to the old grep -Fq makes the test fail rather than pass silently.

— 🤖 Claude, posting on behalf of @dhh

mise use -g announces the resolved tool on stdout, so every wrapped command
prepended a "tools:" line to its own output. That corrupts anything speaking a
protocol over stdout, such as codex app-server. Pass --quiet, which keeps errors
on stderr and preserves the exit status.

The obsolete-wrapper check in the agent migration matched the generated command
verbatim, so loosen it to match the package instead of the flags.

Closes #6908

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 15, 2026 14:14
@dhh
dhh force-pushed the fix-mise-wrapper-stdout branch from 71bdf8e to 5898b75 Compare August 15, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

@dhh
dhh merged commit 1c3da94 into quattro Aug 15, 2026
4 checks passed
@dhh
dhh deleted the fix-mise-wrapper-stdout branch August 15, 2026 15:00
AI091 added a commit to AI091/omarchy that referenced this pull request Aug 15, 2026
mise use -g rewrites ~/.config/mise/config.toml from its own view of the file,
so wrappers launched at the same time race and drop each other's tools or leave
the file truncated. Agent hosts do exactly that: t3code probes claude, codex and
gh concurrently on startup, after which every mise-backed tool fails with a TOML
parse error until the config is repaired by hand.

Wrap the mise use -g call in flock so concurrent wrappers take turns. In 10 runs
of 12 concurrent launches the unserialized wrapper lost tools 4 times (down to
1 of 7); the serialized one lost none.

Regenerate existing wrappers with a migration, which also delivers --quiet to
installs that predate omacom#6940.

Claude-Session: https://claude.ai/code/session_01LUwsy8YsMtkjbgmQp9YEzq
AI091 added a commit to AI091/omarchy that referenced this pull request Aug 15, 2026
mise use -g rewrites ~/.config/mise/config.toml from its own view of the file,
so wrappers launched at the same time race and drop each other's tools or leave
the file truncated. Agent hosts do exactly that: t3code probes claude, codex and
gh concurrently on startup, after which every mise-backed tool fails with a TOML
parse error until the config is repaired by hand.

Wrap the mise use -g call in flock so concurrent wrappers take turns. In 10 runs
of 12 concurrent launches the unserialized wrapper lost tools 4 times (down to
1 of 7); the serialized one lost none.

Regenerate existing wrappers with a migration, which also delivers --quiet to
installs that predate omacom#6940.

Claude-Session: https://claude.ai/code/session_01LUwsy8YsMtkjbgmQp9YEzq
AI091 added a commit to AI091/omarchy that referenced this pull request Aug 15, 2026
mise use -g rewrites ~/.config/mise/config.toml from its own copy of the file.
When two wrappers start at the same time, they race: one drops the tool of the
other, or leaves the file half-written. Agent hosts start wrappers this way.
t3code runs claude, codex and gh at the same time on startup. After that, every
mise-backed tool fails with a TOML parse error until the file is repaired by
hand.

Run mise use -g under flock, so wrappers that start at the same time take
turns. In 10 runs of 12 concurrent starts, the current wrapper lost tools 4
times (down to 1 of 7). The wrapper with the lock lost none.

A migration regenerates existing wrappers. This also brings --quiet (omacom#6940) to
installs that predate it.

Claude-Session: https://claude.ai/code/session_01LUwsy8YsMtkjbgmQp9YEzq
dhh added a commit that referenced this pull request Aug 23, 2026
mise use -g announces the resolved tool on stdout, so every wrapped command
prepended a "tools:" line to its own output. That corrupts anything speaking a
protocol over stdout, such as codex app-server. Pass --quiet, which keeps errors
on stderr and preserves the exit status.

The obsolete-wrapper check in the agent migration matched the generated command
verbatim, so loosen it to match the package instead of the flags.

Closes #6908

Co-authored-by: Claude Opus 5 <[email protected]>
(cherry picked from commit 1c3da94)
@dhh dhh mentioned this pull request Aug 23, 2026
thecdrz added a commit to thecdrz/omarchy that referenced this pull request Aug 24, 2026
Existing ~/.local/bin wrappers still run `mise use -g` without --quiet, so they pollute stdout until regenerated. New installs already got --quiet from omacom#6940.

Co-authored-by: Cursor <[email protected]>
@thecdrz thecdrz mentioned this pull request Aug 24, 2026
3 tasks done
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
mise use -g announces the resolved tool on stdout, so every wrapped command
prepended a "tools:" line to its own output. That corrupts anything speaking a
protocol over stdout, such as codex app-server. Pass --quiet, which keeps errors
on stderr and preserves the exit status.

The obsolete-wrapper check in the agent migration matched the generated command
verbatim, so loosen it to match the package instead of the flags.

Closes omacom#6908

Co-authored-by: Claude Opus 5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

mise wrappers pollute stdout and break protocol-based tools

3 participants