Repository navigation
Keep mise wrappers from writing to stdout - #6940
Conversation
There was a problem hiding this comment.
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
--quietwhen 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.
| 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 |
There was a problem hiding this comment.
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) — removedmise use -g --quiet "oh-my-pi"(current) — removedmise 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]>
71bdf8e to
5898b75
Compare
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
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
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
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)
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]>
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]>
mise use -gannounces the resolved tool on stdout, not stderr, so every mise-wrapped command prepended a line liketo 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
grepcalls in unrelated work coming back with atools:line stuck to the front of their output.--quietsuppresses the announcement, keeps errors on stderr, and preserves the exit status, so the|| exit 1guard still works.The obsolete-wrapper check in
migrations/1785846769.shmatched 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 thegithub:can1357/oh-my-piwrapper alone.Existing wrappers in
~/.local/binare stale copies and keep the old line until regenerated.Closes #6908
— 🤖 Claude, posting on behalf of @dhh