Repository navigation
fix: backport #31568, #31953, #32236, #26497 to 0.12.1 - #33748
chenmingwei23 wants to merge 4 commits into
Conversation
…one fsync (#31568) On a loaded host every syscall of a crew-log append re-takes the GIL, and the single writer thread paid the whole lock/stat/open/write/fsync sequence per entry. A pass now writes a session's consecutive run of plain `_write` entries with one `CrewLog.append_many` (one lock, one tail read, one write, one fsync) and acknowledges each member only after that call returned. - writer: `GroupPart` on an APPEND job; a run fails, retains and drops as a whole; a refused run is retried one job at a time; ungrouped jobs are barriers; `group_max_entries` caps a run and skips the window when full. - writer: a waiting `flush()` skips the batching pause; a synchronous caller hands its job over when the writer thread is already running instead of waiting up to 5 s for it to go idle. - store: an append whose rollback failed (IndeterminateAppend) has its bytes cut under the lock before the path's next append, so a retry does not land the run twice. Only line-end digests are kept, for at most 64 files. Part of #31502 Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com> (cherry picked from commit 7b34f18)
…riter lanes (#31953) The crew-log writer drained every session on one executor thread, so one slow session's fsync held every other session's appends behind it, and on a GIL-contended host the single thread got a small share of the interpreter. Up to WriterLimits.lanes (4) drain loops now share the buffer on a pool with one worker per lane. A pass claims one session at a time and holds it until its batch is written, retained or dropped; a held session is claimed by no other lane and written inline by no caller, so each session still has one writer and keeps its order. The units of one slot share one hold (writer_groups.py), so a work entry's append and its publish to the slot's work-unit-order file stay in append order across units. Retry, loss-marker, refusal and lease rules are unchanged. Stall reporting is per thread. WarningBudget moves to writer_warnings.py (re-exported) to keep writer.py under the line cap. Part of #31502 Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com> (cherry picked from commit 39b0c92)
The charge relay read the unit header, the binding file and the board's newest unit inside the append job, on a writer lane, and its first call in a process listed every unit header in the store. The append job now reads only what fixes the board at commit (the unit's slot as the writer noted it, and the binding: one stat, a read only when the file changed) and queues the entry. A consumer thread finds the board's newest unit, builds the copy and hands the writer one follow-on per board unit and run, written with one append_many and one order publish. A full queue (4096 wakes) is decided inline on the writer after every wake queued before it, so no copy is dropped or reordered. flush and drain_for_shutdown wait for the relay. Copies stay in memory until they land, as the follow-on did before, so a crash in that window still loses the copy; a crash-durable relay is a follow-up. Closes #31502 Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com> (cherry picked from commit 3686b1c)
…board (#26497) * fix(chat): localize the gateway status rows composed outside the dashboard (#25829) The status rows whose text the gateway builds from another component's output -- a dropped/discarded queued message, an eager-spawn stop, a turn that failed before it started, the turn-timeout and never-started cards, the restart/close interruption rows, the crew no-permit card and the tool-limits capability card -- shipped bare English the dashboard could not translate. Each now carries a meta.notice token from the gateway_notice table, plus meta.notice_args for the values its copy interpolates (the containment change, a message excerpt, a start error, a command, the limit, the wait, the config path). The row's content stays the same English for channel mirrors and SSE readers; the dashboard renders the localized frame with the variable detail verbatim inside it, so no card loses its detail. The frontend resolver, the legacy pattern table and every shipped locale gain the new tokens; the parity test discovers and pins them on both sides. Rows whose whole text is an exception, a provider instruction or another formatter's output (str(exc) auth/entitlement cards, the credential give-up, the approval and refusal cards, the app-agent admission refusals) keep their English with a written reason in code: a token would localize no frame of ours and would drop that text. The permission-auto-rejected line re-appended from the ACP handle stays English for now: its reason and tool title are fused into the ACP event's text at the source with no structured field to localize from, and adding one changes the event shape other consumers read. A follow-up tracks that ACP token hop. fix(chat): word the turn-limit, wait and excerpt on the frontend (#25829) Address review on the gateway status rows composed outside the dashboard: the turn-limit and never-started cards handed the frontend pre-worded English, so a non-English card read "30-minute limit" and "5 minutes" in the middle of translated prose. - turn_dispatch: pass the limit as a NUMBER plus a unit key (minute/hour) and the scope, and the wait as a minute count, instead of English words. The frontend words them with the catalog's plural keys; the English content (the channel/SSE/model fallback) is byte-identical. - gatewayNotice: compose the limit phrase, the two scope-selected remedy hints, the never-started wait and the dropped/discarded excerpt label from the structured args; a pre-token row on disk still renders its English captures. - delivery_containment: pass the bare redacted excerpt; the frontend owns the localized Text label. - eager_spawn_stopped: pass the failure count as a plural `count` and add `_one`/`_few`/`_many`/`_other` forms per locale (registered in pluralKeys), so the count agrees grammatically (ru no longer uses one fixed plural form). - gateway_notice_meta: accept a float arg value (a 1.5-hour limit); the notice return types are narrowed so the meta builder type-checks. - catalogs: plural + hint keys in every locale with each language's own categories; the pseudolocale is regenerated; catalog values carry no edge whitespace (the separating space is added at render). - tests: a zh-CN row renders no English minute/hour words; the abandoned-turn call site is pinned; the excerpt-redaction test's docstring is made honest. * chore(website): raise the ModelEffortDropdown bundle budget for the added English strings This change adds about 3.6 KB of en.json strings that are part of the fix. They land in the ModelEffortDropdown chunk through the eagerly imported English catalog (i18n/enCatalog.ts), which pushes the measured chunk to 558.6 KB, just over its previous 558 KB budget. Raise the budget to 560 KB. The bundle-size gate is a size budget, not a security gate. --------- Co-authored-by: kirocrew-agent <agent@kirocrew.local> (cherry picked from commit 665858e) Backport conflict resolution for release/0.12.0: release has one gateway token family fewer than main had before this change, so the pinned counts keep that offset (78/78/80 tokens, 35 sites, 91 copy keys, frontend 78). pluralKeys.json keeps the release list and adds only this change's four keys. The SEND_DISCARD_HARD_STOP_STEER test row is dropped: that cause comes from #23772, which is not on release/0.12.0.
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This PR cherry-picks four fixes that already merged to main. The reversed one-writer pin ( What this change shipsInventory (8 items) — 7 justifiedIntent: give 0.12.1 users faster crew-log writes and localized gateway status rows, which main already has. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] c445def Description read[DESCRIPTION-READ] 1594c953e365f328c6e63e75483885642ea38ed16457e4ba4a0e8e1342353612 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots of the localized gateway status rows. The blind read was not performed because the PR supplies no image. Evidence gaps
Notes
[UX-REVIEWED] c445def Description read[DESCRIPTION-READ] b375bb057d72f9a2fbb86879c563a97b4e0aa2b9e53ce7b7c96975288bac9b70 That sha256 names everything this verdict read: the PR description, plus the 3 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Clean cherry-pick backport of four already-merged main fixes. Nothing it removes or moves is still read by code outside the patch, and the localization part only translates existing rows without changing any surface. Notes
[DESIGN-REVIEWED] c445def Description read[DESCRIPTION-READ] 290649af6cb2a0fe9e24e5897e0c1b187fa42db329d2da54e13639df30cae561 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 |
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: |
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: |
Problem / Motivation
Goal: Ship 3 crew-log write-path performance fixes and 1 chat localization fix that merged to main after the 0.12 cut to 0.12.1 users.
Why it matters
On 0.12, every queued crew-log append pays its own write and fsync, all sessions share one writer, and the board relay decision runs on that writer thread. Busy crews see log writes back up behind each other. Separately, gateway status rows built outside the dashboard (a discarded queued message, a turn timeout, an eager-spawn stop, restart/close interruptions) stay in English on a non-English dashboard.
Not a goal
What changed (motivation -> approach -> change)
One
git cherry-pick -xof each main merge commit, onrelease/0.12.0atd684523f65. The 3 crew-log commits depend on each other and on #31415 (already on the branch asb628d827ae), so they go in this order:7b34f182ba39b0c928ed3686b1ce7f665858eabb#31568, #31953 and #32236 picked cleanly.
Conflict resolution in #26497 (test and catalog files only; no source file conflicted):
test/test_transient_notice_parity.py,website/src/test/gatewayNotice.test.tsx: these pin token, site and copy counts.release/0.12.0has one gateway token family fewer than main had before fix(chat): localize the gateway status rows composed outside the dashboard #26497, so the counts keep that offset and add fix(chat): localize the gateway status rows composed outside the dashboard #26497's own deltas: 78 backend tokens / 78 frontend families / 80 legacy entries (main: 79/79/81), 35 tokenized sites (main: 36), 91 copy keys (main: 92).website/src/i18n/pluralKeys.json: keeps the release list and adds only fix(chat): localize the gateway status rows composed outside the dashboard #26497's 4 plural keys.test/test_queue_discard_sender_notice.py(picked without a conflict, but failed collection): dropped theSEND_DISCARD_HARD_STOP_STEERparametrize row. That cause comes from feat(session-control): let a peer steer Claude Code and Codex turns #23772, which is not onrelease/0.12.0. The fix(chat): localize the gateway status rows composed outside the dashboard #26497 source code does not reference it.Backwards compatibility
Compatible. The crew-log changes keep the on-disk log format and the order of entries within a session. #26497 adds
meta.notice/meta.notice_argsto existing rows and keeps their Englishcontentbyte-identical for channel mirrors and SSE readers. Each main PR states its own compatibility.Removes nothing: no field, API, key or config is removed.
Tests
Run on this branch at
c445defc77, in a clean Python 3.12 venv (uv sync --frozen --all-extras --python 3.12), with a tempKIROCREW_HOME,pytest -n 2, over every test file the 4 source PRs added or changed:test/test_crew_log_cut_counter.py,test/test_crew_log_emit_write_path.py,test/test_crew_log_relay_feed.py,test/test_crew_log_writer_group_commit.py,test/test_crew_log_writer_lanes.py,test/test_gateway_notice_sites.py,test/test_queue_discard_sender_notice.py,test/test_session_turn_timeout.py,test/test_transient_notice_parity.py,test/test_turn_dispatch.py: 263 passedwebsite/src/test/gatewayNotice.test.tsx(vitest run): 130 passedtsc -p tsconfig.app.json: clean;check-i18n-strings.mjs: OK (218 untranslated, baseline 332)flake8,isort --check-onlyon the 42 touched Python files: clean;mypyon the 32 touched source files:Success: no issues found in 32 source filesProof: not provable -- other: a cherry-pick batch of already-merged main fixes, each proven in its own main PR
Manual verification
N/A: each fix was verified in its own main PR, and this batch carries them with only the test-count resolution above.
Screenshots / video
Why no screenshot: the #26497 frontend pick carries the same rendered change as its main PR, which shows it.
Related Issues
0.12.1 backport batch: #31568, #31953, #32236, #26497.
Checklist
cherry-pick -xof a main commit with a Conventional Commits titleContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.