Skip to content

Fix idle zsh PR probes triggering chpwd hooks - #16553

Merged
teamleaderleo merged 2 commits into
mainfrom
fix/3191-pr-probe-chpwd
Oct 2, 2026
Merged

teamleaderleo merged 2 commits into
mainfrom
fix/3191-pr-probe-chpwd

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Idle zsh PR polling now uses quiet cd, so it stops firing user chpwd hooks and inflating zoxide rankings. The probe still runs gh in the repository and caches the returned PR.

Closes #3191.

Validation: the test-only commit reproduces the unwanted hook execution locally. After the fix, all 6 PR watcher tests, the stale-cwd shell tests, first-prompt spawn tests, zsh syntax check, and git diff --check pass. The test-only CI run skipped the macos-shell lane, so its green guards are not regression-test evidence.

No user-facing strings changed; localization audit found no strings to translate.

Marshmallow g1 🎐
run: run_cx_bl_bugs_a_old_20261001
session: cx-bl-bugs-a-oldest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: beee5338-2898-45e9-9b48-a559317aa9af

📥 Commits

Reviewing files that changed from the base of the PR and between 8b8762a and bdd5460.

📒 Files selected for processing (2)
  • Resources/shell-integration/cmux-zsh-integration.zsh
  • tests/test_shell_pr_watch_private_state.py
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/test_shell_pr_watch_private_state.py Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Resources/shell-integration/cmux-zsh-integration.zsh">

<violation number="1" location="Resources/shell-integration/cmux-zsh-integration.zsh:1655">
P2: `cd -q` (chpwd suppression) was added in zsh 5.9. On older zsh the option is rejected, and because `2>/dev/null` swallows the error the `&& gh pr view ...` chain never runs, so the PR probe silently returns `1` forever and the badge stops updating/never appears — the same silent-failure class of regression this file avoids elsewhere by falling back for zselect/jobstates. Confirm the zsh floor (cmux ships on macOS 14+, whose system zsh is 5.9, so this only bites custom/older zsh builds) or gate the option with `is-at-least 5.9` and use a plain `cd` fallback for older zsh. Note a plain-`cd` fallback re-runs chpwd hooks on shells < 5.9, so if old zsh is out of support, documenting the requirement is the simpler fix.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

[[ -n "$err_file" ]] || return 1
gh_output="$(
builtin cd "$repo_path" 2>/dev/null \
builtin cd -q "$repo_path" 2>/dev/null \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: cd -q (chpwd suppression) was added in zsh 5.9. On older zsh the option is rejected, and because 2>/dev/null swallows the error the && gh pr view ... chain never runs, so the PR probe silently returns 1 forever and the badge stops updating/never appears — the same silent-failure class of regression this file avoids elsewhere by falling back for zselect/jobstates. Confirm the zsh floor (cmux ships on macOS 14+, whose system zsh is 5.9, so this only bites custom/older zsh builds) or gate the option with is-at-least 5.9 and use a plain cd fallback for older zsh. Note a plain-cd fallback re-runs chpwd hooks on shells < 5.9, so if old zsh is out of support, documenting the requirement is the simpler fix.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At Resources/shell-integration/cmux-zsh-integration.zsh, line 1655:

<comment>`cd -q` (chpwd suppression) was added in zsh 5.9. On older zsh the option is rejected, and because `2>/dev/null` swallows the error the `&& gh pr view ...` chain never runs, so the PR probe silently returns `1` forever and the badge stops updating/never appears — the same silent-failure class of regression this file avoids elsewhere by falling back for zselect/jobstates. Confirm the zsh floor (cmux ships on macOS 14+, whose system zsh is 5.9, so this only bites custom/older zsh builds) or gate the option with `is-at-least 5.9` and use a plain `cd` fallback for older zsh. Note a plain-`cd` fallback re-runs chpwd hooks on shells < 5.9, so if old zsh is out of support, documenting the requirement is the simpler fix.</comment>

<file context>
@@ -1652,7 +1652,7 @@ _cmux_report_pr_for_path() {
     [[ -n "$err_file" ]] || return 1
     gh_output="$(
-        builtin cd "$repo_path" 2>/dev/null \
+        builtin cd -q "$repo_path" 2>/dev/null \
             && gh pr view "$branch" \
                 "${gh_repo_args[@]}" \
</file context>

@teamleaderleo
teamleaderleo merged commit 5c7dca1 into main Oct 2, 2026
67 checks passed
@teamleaderleo
teamleaderleo deleted the fix/3191-pr-probe-chpwd branch October 2, 2026 00:25
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Merge receipt for bdd5460cc5: every check was green at merge (14 verified; 19 skipped by policy). Full suite runs on main after merge.

rustybret pushed a commit to rustybret/bmux that referenced this pull request Oct 2, 2026
0bfd027 test(cloud): fix the Cloud header and moved-panel focus tests that never ran (manaflow-ai#16539)
c5c4345 localization: accept numbered placeholders in any order (manaflow-ai#16376)
456edeb fix(settings): replace custom sidebar mockups with real previews (manaflow-ai#16569)
98dc3ab Prototype: cmux Cloud as a remote MCP server (manaflow-ai#16568)
6c22525 test(remote): isolate tmux stale-surface fixture (manaflow-ai#16566)
3ec9918 Re-land "fix(coderouter): initialize Cloud VM account pools (manaflow-ai#16397)" (manaflow-ai#16572)
2b895a5 Fix browser paste routing with terminal text box beta (manaflow-ai#6380) (manaflow-ai#16560)
2bd3455 localization: check Swift defaultValue literals against their catalog en value (manaflow-ai#16396)
c43086e test(cli): expect --mark-read to mark every listed inbox message (manaflow-ai#16537)
fcda4f0 test(feed): wait for zero-wait Codex permission acceptance before checking attention (manaflow-ai#16536)
7d57a03 fix(remote): evict stale persistent SSH bridge leases (manaflow-ai#16558)
d630cb8 docs: add protected-folder diagnostics for tmux sessions (manaflow-ai#12219)
7dceaac test: create cwd fixtures that new terminals now resolve on disk (manaflow-ai#16538)
28cc575 docs: cover surface resume binding CLI contract (manaflow-ai#16473)
5c7dca1 Fix idle zsh PR probes triggering chpwd hooks (manaflow-ai#16553)

# Conflicts:
#	.github/workflows/ci-guards.yml
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.

Suspected periodic zsh chpwd trigger in idle cmux workspace causes zoxide rank inflation

1 participant