Repository navigation
fix: backport 0.12.1 wide batch 1 (14 user-facing fixes) - #32787
Conversation
#30225) On the claude backend every chat ran with Claude Code's auto-memory on, so an incognito or temporary chat read the project's MEMORY.md into its context and wrote memory files with no permission request. Such a session now carries CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 in _meta.claudeCode.options.env, and in the flag tier's settings.env so a user or project settings env cannot set it back. A persistent session is unchanged. Co-authored-by: Shubham Kurkure <19431169+shubhamkurkure@users.noreply.github.com> (cherry picked from commit 664ae5b)
read_rotated_messages marks a rotated archive segment it cannot read as incomplete and then raises OSError, which both history consumers turn into a retryable 503 instead of serving a shortened corpus. The read caught only OSError, so a segment whose bytes are not UTF-8 raised UnicodeDecodeError, a ValueError the consumers do not catch. Such a segment now takes the same path as an unreadable one: the read reports the archive incomplete and raises the OSError the consumers already handle. (cherry picked from commit 344a5da)
When _get_db found the V1 FTS index corrupt it deleted it and created an empty one, and the on-disk drift scan skips an empty index, so every search returned nothing until a separate rebuild ran. Flag the heal and let the next drift scan queue every source for the existing catch-up. Co-author on main: Zezhen Xu. (cherry picked from commit ddf065f)
(cherry picked from commit 42f5170)
Compaction archives the rows it drops, then replaces the transcript. When that replace raised with the transcript unchanged (a full disk on its fsync, a held file on Windows), the archive stayed while the transcript still held the same rows, so each retry under a lasting fault wrote one more archive copy of them. Compaction now removes the archive it just wrote when the transcript's identity is unchanged after the failed rewrite, through the same check the rotation path uses. A rewrite that replaced the file before failing keeps its archive, which is then the rows' only copy. (cherry picked from commit d2131cd)
#30871) meta.json is parsed with json.loads, which accepts Infinity and NaN, and the events log and metadata blocks reach the artifact routes' replies as stored. Written out as-is those are not JSON, so the dashboard's Response.json() refused the whole reply: one hand-edited artifact blanked the Library list and its activity timeline. _json_response, which every artifact route answers through, now sends a non-finite number at any depth as null. Every finite value is sent unchanged, and the stored file is not rewritten. (cherry picked from commit 0c56b24)
…#31523) A failed startup read of session_map.json made every later session-map write raise for the rest of the process, and nothing read the file again, so one transient sharing violation cost every binding made until someone restarted the gateway. The deferred flush and aflush wait for one shared re-read, run in a worker thread, before they claim a snapshot. It adopts the file beside the keys written since only when none of its keys was written in memory and no channel thread or mirror was bound there; otherwise, or when the re-read fails, writes keep failing until a restart, as before. Closes #24979 (cherry picked from commit 47d2b8c)
…#30576) A steering file created with a name written wholly outside the ASCII filename set (a Chinese name such as 编码规范) was saved as ----.md, and a second such name of the same length got 409 steering_exists. Each path segment the rewrite leaves with no ASCII letter or digit now becomes slug_hash_fallback(<typed segment>, "steering"), the stable hash the artifact, theme and workflow slugs already fall back to, so distinct names derive distinct files and a name always derives the same one. Segments that keep some ASCII are rewritten exactly as before. Closes #30413 (cherry picked from commit 6d036f8)
…on (#32084) * fix(memory): offload declared_store_names to thread in store resolution KiroCrewConfig.load() inside declared_store_names() reads config.json from disk synchronously. resolve_requested_memory_store and _admin_store both called it on the asyncio event loop thread, so concurrent PUT /api/memory/semantic requests (e.g. the E2E spec that writes 65 memories in batches of 5) each block the loop for the duration of a file stat + JSON parse + logging round. With batches of 5 concurrent writes, these serialised config reads hold the loop long enough to starve the heartbeat past the 25s watchdog exit_after window, which fires SIGALRM and kills the gateway with -14. Playwright's 10s per-request timeout is a symptom of the same stall. Fix: wrap the two synchronous declared_store_names() calls with asyncio.to_thread(), matching the pattern already used in markdown_memory_for_store and memory_admin.api_memory_stores in this same package. * fix(memory): offload three more sync config loads in memory handlers api_memory_settings, api_memory_stats, and api_memory_consolidate each called KiroCrewConfig.load() synchronously on the asyncio event loop thread. While these handlers are not on the concurrent-batch write path that triggers the E2E flake, a loop-blocking call in a request handler is wrong regardless of call frequency. Offload all three with asyncio.to_thread(), matching the pattern already used in markdown_memory_for_store and the PUT /api/memory/settings config write path in the same file. --------- Co-authored-by: CrysisDeu <crysisdeu@users.noreply.github.com> (cherry picked from commit befba1e)
The crewmate opt-in store, the app dependency ledger and the connection mint manifest were each rewritten from a reader that answers an empty document on any OSError, so a transient EACCES or EIO published an empty file over every other entry. Each reader gains a strict mode for the base of a rewrite: only a missing file reads as empty. reserve_offer raises (the card is refused with 503 opt_in_unrecorded), _record_mint_spec returns False (the mint fails as before), and the two ledger rewrites leave the file as it was and log a warning. An install whose ownership was not recorded reports that dependency as failed, so a later install or enable records it instead of a later uninstall treating another app as its sole owner. The remaining sites in these modules write only after changing an entry the read found, and the ratchet records that reason for them. Part of #24607 (cherry picked from commit 7a4830a)
) A Discord, Teams or Webex message queued while a dashboard, cron or auto-nudge turn held the conversation's session waited for the person's next message, because only the channel's own turn drains its queue. Queueing now waits for the session to free and drains then, as Telegram already does. Closes #29792 (cherry picked from commit 10a2d17)
…32308) A gateway started from inside an agent session inherits that session's TMPDIR/TMP/TEMP, a per-process scratch directory another pid owns. The hourly sweep reclaims it once that owner is dead, and tempfile caches its default once, so every tempfile write in the gateway then fails with ENOENT until a restart. At gateway start, drop every inherited scratch export that names a directory under the managed scratch root from the gateway's own environment, using the rule agent spawns already apply to a child, clear tempfile's cached default, and re-point each dropped temp key at the default it resolves next. An operator temp directory outside the root is kept. Closes #12808 (cherry picked from commit c200d2d)
…31940) A crons.json record no job can be built from was skipped on load and then dropped by the next save, which rewrote jobs[] from memory. Any mutation closed that window within seconds, so a hand-edited record was usually lost before anyone read the warning. decode_store now returns each skipped record as read, the service holds it, and every save writes it back after the jobs. Every writer (gateway, CLI, sandboxed mcp_cron) saves through the same path, so none drops it; the record still never runs and each load warns about it. On a store older than version 3 it gets the same UTC stamp as the loaded jobs, and the stamp's lookup now takes any id a skipped record carries. While that upgrade waits on an unreadable config, a save keeps a skipped record on the unzoned_follow_default list when the store listed it, so once fixed it is not stamped. A store moved aside after a read failure takes its kept records and newer-build keys with it. Only an object that leaves the store within user_json's MAX_DOCUMENT_NESTING is kept: a snapshot restore refuses a non-object job entry or a deeper store, and the indent=2 save raises RecursionError about a thousand levels down. Any other skipped entry is still dropped, and its warning says so. (cherry picked from commit 9f46c9c) # Conflicts: # src/kiro_crew/cron_service/store.py Originally authored on main by Bolin Chen (bolichen97); authored here with the public identity because the commit guard refuses the original address.
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the only frontend change is a cherry-pick of #30639's turn grouping, which adds no control, label or string. All other picks are backend-only. Notes
[UX-REVIEWED] f4b0e16 Description read[DESCRIPTION-READ] 439e5fabb651b8c50a921a4933cfcf90f19123079d6930bcbcd66511658b761c 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: every pick is an already-merged What this change shipsInventory (10 items) — 10 justifiedIntent: give 0.12.0 users fourteen fixes that are already merged on
[FIRST-PRINCIPLES-REVIEWED] f4b0e16 Description read[DESCRIPTION-READ] 5ace0cd7ced81ac74f56eb39ad3a5a9b6d897eb398417e6f5c98ec662e95a60a That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS cannot evaluate: missing screenshot or recording of a cron-driven chat session's transcript on this revision. The #30639 pick changes how turns are drawn, and this PR includes no rendered evidence of it. BlockersThe turn-grouping change in the chat transcript has no rendered evidence for this revision Notes
[DESIGN-REVIEWED] f4b0e16 Description read[DESCRIPTION-READ] 3441be7f1a12d0bf81dd4680739edbdd4958029dca4be59299053ca82ca86b83 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: |
Problem / Motivation
Goal: Bring fourteen fixes for problems a 0.12.0 user can hit, merged on
mainafterv0.12.0, ontorelease/0.12.0, one commit each, in a PR of its own.Why it matters
Each fix changes behaviour a user of 0.12.0 can run into today; most close a filed issue. Every pick applied to
release/0.12.0, so the code each one replaces is on release; the right-hand column names where.acp/client_claude_session.py:427(_claude_session_metanever turns auto-memory off)history_projection_reads.py:188memory.py:1166dashboard/chat_handlers.py:942,pages/chat/groupDisplayItems.ts:402history_rewrite.py:423InfinityorNaNin an artifact'smeta.jsonmakes the artifact list and events replies invalid JSON.dashboard/handlers/artifacts_parts/route_plumbing.py:73session_map_store.py:144(_load)----.md, and a second Chinese name overwrites it.dashboard/handlers/steering.py:642dashboard/handlers/_shared_memory_stores.py:176apps/dependencies.py:208,apps/dependency_ledger.py:197,mate_tool_access.py,connections/mint.pyteams/transport_dispatch.py:1032,webex/transport_dispatch.py:711,discord/transport_dispatch_midturn.py:161TMPDIR, and uploads fail hours later once it is swept.slack/gateway_runtime/process_entry.py:444crons.jsonrecord that fails to load is erased by the next cron write.cron_service/store.py:861(decode_store),cron_service/readers.py:45session_storage_parts/pinned_delete.py:427,platform_compat_links.py:519Not a goal
main; nothing is changed only here.CHANGELOG.mdchange.What changed (motivation → approach → change)
Each main squash commit was cherry-picked with
-xontorelease/0.12.0@7ea28ed960, in merge order onmain, one commit each.664ae5bdae3e4a9ac9bf344a5da4b0ef77d0efe0ddf065ffb36c90b769e742f51701b5b1f0f327d1d2131cd7570b0f1728d50c56b24f3796220de76247d2b8c9b98a4543ac006d036f82739340b844e4befba1e0b33d973afa2e7a4830a060bd67a5468810a2d1735e71d4542b96c200d2d20a3204aab1a09f46c9cdacc9ba35dd25614b0ebb12f4b0e16974Thirteen picks applied cleanly. #31940 hit two conflicts in
cron_service/store.py, both in comments only: the_job_from_recorddocstring paragraph onAttributeError, and the comment above the per-entry loop indecode_store. Both took the main wording; no code line was resolved by hand.#31940 is authored with the public identity, and its message names the original author, because the commit guard refuses the original address. #30585's internal co-author trailer is rewritten as a plain "Co-author on main" line for the same reason.
Backwards compatibility
Compatible: each change is the one already merged on
main, and its compatibility note applies unchanged.Removes nothing: no setting, key or caller is removed.
Tests
Proof: not provable -- other: a backport of main commits whose proofs ran on their own PRs
release/*, so the related set was run here after each pick: the direct test modules of every touched file, about 13,000 tests in total. Every failure seen also fails on a cleanrelease/0.12.0@7ea28ed960on the same host: twotest_folder_steering_provider_dedup.pycases, twotest_acp_launch_goldens.py[copilot]cases andtest_cron_run_scratch.py::TestUnderTheRealSandbox::test_script_cron_writes_into_its_temp_dir.tsc -p tsconfig.app.json --noEmitpasses;vitest run ChatMessageList.test.tsx groupDisplayItems.test.ts: 87 passed.mypy src/kiro_crewandgen-ui-index --checkpass.check_file_line_capfails only ondashboard/chat_api/resume.py, which is already over the cap on release and is not touched here.Manual verification
N/A - each fix was verified on its own main PR. The 0.12.1 RC soak is the end-to-end check.
Screenshots / video
Why no screenshot: the one frontend pick (#30639) carries the same rendered change as its main PR, which shows it.
Related Issues
Backport to the 0.12 line for 0.12.1 of #30225, #30290, #30585, #30639, #31114, #30871, #31523, #30576, #32084, #31998, #32462, #32308, #31940 and #31676. Source issues: #30289, #30420, #30638, #28995, #30869, #24979, #30413, #29792, #12808, #5705, #7566.
Sibling sweep
Siblings: none -- each source PR carried its own sibling sweep; this PR only carries those fixes.
Pattern harvest
Not generalizable: this PR only carries fixes already on
main. The source PRs have their own harvest.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.