Skip to content

cnb: enforce WIP limit — max 2 in-flight PRs per worker - #263

Merged
ApolloZhangOnGithub merged 1 commit into
masterfrom
lead/wip-limit
May 17, 2026
Merged

cnb: enforce WIP limit — max 2 in-flight PRs per worker#263
ApolloZhangOnGithub merged 1 commit into
masterfrom
lead/wip-limit

Conversation

@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner

Today: lisa-su 7 PRs, musk 5 → cascading rebase. Add Kanban WIP limit (2 per worker, team×2 total) to norms + lead nudge.

Today: lisa-su 7 open PRs, musk 5 — cascading rebase nightmare.
Add Kanban WIP limit to norms + lead nudge instruction:
- per-worker cap: 2
- team cap: workers × 2
- breaching cap = pause dispatch, switch to review/merge mode

Flow efficiency over utilization.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

"lead 不能 idle。这是你的项目,没有用户兜底。"

P2 Badge Keep the lead nudge dedupe marker in the prompt

When the lead session is idle but still has the previous nudge typed at the prompt, the duplicate guard just above this call still looks for "扫描团队"; this rewritten prompt no longer contains that substring. As a result _already_queued will return false for every new lead-idle prompt and the dispatcher can keep stuffing duplicate lead nudges after each cooldown/backoff interval instead of suppressing them as intended.


- 超过 2 → 不派新活,告诉员工"先合掉一个再说"

P2 Badge Block dispatch when the worker already has two PRs

For the documented max of 2 open PRs per worker, this check needs to stop new assignments when the worker is already at 2, not only after they are over 2. In the exactly-two-PR scenario, following this rule still permits assigning another issue, which immediately creates a third in-flight PR and violates the WIP limit the section is trying to enforce.


"员工空闲 → 立即派下一个 issue 给他,但先 gh pr list --author <name> 检查:"

P2 Badge Count GitHub App PRs when enforcing WIP

For sessions that use the repo's GitHub App PR path (_github_app_pr_env / cnb-workspace-<name>), this command does not count their open PRs: the GitHub CLI manual separates --author from --app for GitHub App authors (https://cli.github.com/manual/gh_pr_list). In that common setup, gh pr list --author musk can show zero while cnb-workspace-musk[bot] already has multiple PRs, so the lead is told to dispatch more work despite the WIP limit.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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