Repository navigation
docs(rfc): cap how many attended chat turns run at once - #28633
Conversation
b756599 to
7cbc47c
Compare
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This adds a draft RFC and its index row, with no code and no take-away, and the seam it names ( Notes
[DESIGN-REVIEWED] 76a2128 Description read[DESCRIPTION-READ] 1a7adaaa19555e495e11720ef65dbddd0238066911d9d9d5ce7efbfcb3837999 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
7cbc47c to
599012d
Compare
|
Hold: merge conflict. Reviewed at 599012d. GitHub reports this PR as conflicting with main. The conflict is in The RFC itself reads as a sound draft. The two Design Review notes are clarity points: §1.2a already states the re-acquire is queued at priority 0, and the — crew-pr-reviewer (r143) |
599012d to
69e34a5
Compare
|
Rebased onto main (69e34a5), both index rows kept. §1.2 now says a turn waiting on |
69e34a5 to
29aaf66
Compare
|
New head 29aaf66 answers the Opus 5.5 block on 69e34a5. The permit is now taken in |
73436bb to
c9fa177
Compare
|
New head c9fa177 answers the Opus 5.5 block on 73436bb. The ceiling sentence now applies only to |
c9fa177 to
8efbbb6
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Design brief for rfc-attended-turn-cap (read in full at 8efbbb6).
What it does. It adds one attended-turn semaphore on DashboardState, taken in the exit guard of _run_chat beside gate_turn. That is the one seam every turn producer passes, so no call site changes and none can bypass it. Turns over the cap queue with a bounded 1800 s wait that ends in a visible message, and the person's message is kept. A typed send is served ahead of bulk Resumes. A nested turn reuses its outer permit, and a turn waiting on a person keeps its permit. The setting is dashboard.max_attended_turns: auto is twice the cold-start concurrency, clamped to 2..64, and 0 turns the cap off.
Pros.
- It closes the gap #25055 measured: a bulk Resume of 40 sessions no longer runs 40 turns at once once the starts end.
- One place, one check, guarded by a test, instead of per-path limits.
- It is separate from the unattended pool, so crews and people cannot starve each other.
0restores today's behaviour exactly, and no stored format changes.
Cons.
- With
autoon by default, a typed send can now wait when N turns are running or parked on approval prompts. The waiting line and the priority order soften this, but it is a visible change at the cap. - With Shared Crew admission on, a queued turn holds an idle attended permit (open question 3).
spawn_guarded_turnturns spend their wait against their own wall-clock ceiling, so a short ceiling can end the turn before the cap message appears.
Tech debt. No. It adds one well-placed limit, and it names the remaining unattended gap as out of scope rather than hiding it.
Maintainer signs the direction. This is a comment, not an approval. I suggest settling open question 3 in the implementation PR.
8efbbb6 to
a2f8811
Compare
|
HOLD (conflict) at a2f8811. The branch conflicts with main again in On the rebase, please fix the description's What changed, as the Design note says. It still says the permit is taken by one helper that The other Design note (parked turns can block a typed send for up to 1800 s) does not block: §1.2a already states that cost and how the waiting line shows it. Checks are green. A new head needs a fresh review. — crew-pr-reviewer (r146) |
a2f8811 to
d45edb4
Compare
|
@iamwhatever thanks for the r146 HOLD. Rebased onto main as d45edb4, still one commit.
|
iamwhatever
left a comment
There was a problem hiding this comment.
Approve at d45edb45211f5d2806b0c8c2716ed90ce7874166.
This is a docs-only draft RFC. The r146 point is fixed: What changed now matches §1.2, where the permit is taken in _run_chat's guard and kept while a turn waits on a person (rfc#L64-L78). All checks are green, and @bolichen97 signed the direction.
AI findings judged non-blocking
- Design: a turn that waits on another slot's turn would deadlock at cap 1. Does not block: I found no such wait on main.
enqueue_or_run_prompt, whichsession_deliveruses, starts the turn withcreate_taskand returns (chat_slot.py#L1100). A sentence ruling this out would still help the implementation PR. - Design: turns parked on approvals keep their permits, so at a small cap new sends can wait 1800 s. Does not block: §1.2a states and weighs this cost (rfc#L78).
- Opus: the
spawn_guarded_turncaller list leaves outchat_turn/agent_started.py. Does not block: the permit is taken inside_run_chat, so coverage does not depend on that list (rfc#L64).
Note: #28664 and #28632 edit the same README sentence, so the PRs that merge after this one will need another rebase.
— crew-pr-reviewer (r148)
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 76a2128.
This is a docs-only draft RFC plus its index row. The RFC text is identical to d45edb4, which I approved in r148; this head is a rebase onto current main, and the README change is the one new row and audit sentence with no conflict. The description matches §1.2: the permit is taken in _run_chat's guard beside gate_turn and kept while a turn waits on a person (rfc#L64-L78). All checks are green, and @bolichen97 signed the direction.
AI findings judged non-blocking:
- Design (note): parked turns keep their permits, so at a small cap a typed send can wait up to 1800 s. §1.2a already states and weighs this cost (rfc#L78).
- Design (note): the wait ends at the
spawn_guarded_turnceiling on one path and at the 1800 s bound on the others. §1.2 names both outcomes; choosing one message belongs to the implementation PR (rfc#L70).
— crew-pr-reviewer (r149)
Part of #25055
Problem / Motivation
Goal: Main records a design for one cap on how many attended chat turns run at once, at the dispatch every send and Resume reaches, before any code for it is written.
Nothing limits concurrent attended dashboard turns today. The cold-start semaphore paces boots only, and the background-turn cap counts unattended turns only. Resuming many sessions, including with the bulk Resume in #27512, leaves every one of their turns running at once. The maintainers parked #25055 and asked for a design through docs/request-for-change.
Why it matters
A bulk Resume of tens of sessions holds tens of model streams, MCP servers and tool processes together, which falls on host memory and model rate limits.
Not a goal
What changed (motivation → approach → change)
Adds
docs/request-for-change/rfc-attended-turn-cap.md(statusdraft) and its row in the index indocs/request-for-change/README.md. The document covers the problem, alternatives including doing nothing, the recommended design (an attended-turn semaphore beside_bg_turn_sema, taken in theguardedwrapper of_run_chataroundgate_turnso no call site changes and none can bypass it, kept while a turn waits on a person (a tool approval or question card) and while it waits onSessionManager._start_sem, that queues and never rejects and serves typed sends before bulk Resumes), how it relates to #27512, a migration plan and a test plan.Backwards compatibility
Compatible: documentation only.
Tests
N/A: documentation only.
scripts/docs_lint.pyruns in Source Gates.Manual verification
N/A: documentation only.
Screenshots / video
N/A: no UI change.