Skip to content

fix: backport 0.12.1 wide batch 1 (14 user-facing fixes) - #32787

Merged
buluoray merged 14 commits into
release/0.12.0from
crew/slack/0.12.1-wide-1
Nov 8, 2026
Merged

buluoray merged 14 commits into
release/0.12.0from
crew/slack/0.12.1-wide-1

Conversation

@buluoray

@buluoray buluoray commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Bring fourteen fixes for problems a 0.12.0 user can hit, merged on main after v0.12.0, onto release/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.

PR Reported by What a 0.12.0 user sees today Faulty code on release
#30225 shubhamkurkure On the claude backend, an incognito or temporary chat still reads and writes Claude Code's auto-memory, so a fact from it shows up in later chats. acp/client_claude_session.py:427 (_claude_session_meta never turns auto-memory off)
#30290 RohanK6 (#30289) A non-UTF-8 rotated history segment fails the history read instead of returning the retryable 503. history_projection_reads.py:188
#30585 CrysisDeu (#30420) After the memory index heals itself from corruption, search returns nothing until a rebuild. memory.py:1166
#30639 Pearcekieser (#30638) Opening a cron-driven session freezes the tab, because all its turns render as one. dashboard/chat_handlers.py:942, pages/chat/groupDisplayItems.ts:402
#31114 RohanK6 (#28995) When a compaction's rewrite fails, its archive is kept, so under a lasting disk fault each retry adds another copy of the same rows and the archive browser lists them again and again. history_rewrite.py:423
#30871 RohanK6 (#30869) A stored Infinity or NaN in an artifact's meta.json makes the artifact list and events replies invalid JSON. dashboard/handlers/artifacts_parts/route_plumbing.py:73
#31523 IngridMorstrad (#24979) One contended session-map read at startup makes every later save fail for the whole gateway run, so resumes, overrides and channel links made in that run are lost at the next start. session_map_store.py:144 (_load)
#30576 CrysisDeu (#30413) A steering file named in Chinese is saved as ----.md, and a second Chinese name overwrites it. dashboard/handlers/steering.py:642
#32084 CrysisDeu Batched memory writes from the dashboard block the event loop on a config read, and the gateway can be killed by its stall watchdog. dashboard/handlers/_shared_memory_stores.py:176
#31998 bolichen97 A store that cannot be read for a moment is rewritten as empty by the crewmate opt-in card, an app dependency install or uninstall, or a connection mint. apps/dependencies.py:208, apps/dependency_ledger.py:197, mate_tool_access.py, connections/mint.py
#32462 CrysisDeu (#29792) A Telegram, Discord, Teams or Webex message queued during a dashboard turn waits for the next message instead of being answered. teams/transport_dispatch.py:1032, webex/transport_dispatch.py:711, discord/transport_dispatch_midturn.py:161
#32308 CrysisDeu (#12808) A gateway restarted from inside a chat or agent session inherits that session's scratch dir as TMPDIR, and uploads fail hours later once it is swept. slack/gateway_runtime/process_entry.py:444
#31940 rnoack1 (#5705) A crons.json record that fails to load is erased by the next cron write. cron_service/store.py:861 (decode_store), cron_service/readers.py:45
#31676 chenmingwei23 (#7566) On Windows, emptying the session trash can remove files outside the trash when its folder was changed underneath the delete. session_storage_parts/pinned_delete.py:427, platform_compat_links.py:519

Not a goal

  • No fix that is not already merged on main; nothing is changed only here.
  • No version bump, no tag, no CHANGELOG.md change.
  • Sign-in and credential tightening fixes; they go in a batch of their own.

What changed (motivation → approach → change)

Each main squash commit was cherry-picked with -x onto release/0.12.0 @ 7ea28ed960, in merge order on main, one commit each.

# PR main commit release commit
1 #30225 turn claude auto-memory off in incognito and temporary chats 664ae5bdae 3e4a9ac9bf
2 #30290 treat a non-UTF-8 rotated segment as unreadable 344a5da4b0 ef77d0efe0
3 #30585 re-index memory sources after the FTS index self-heals ddf065ffb3 6c90b769e7
4 #30639 start a new turn at each cron delivery 42f51701b5 b1f0f327d1
5 #31114 drop a compaction's archive when its rewrite does not land d2131cd757 0b0f1728d5
6 #30871 send a stored Infinity or NaN as null in route replies 0c56b24f37 96220de762
7 #31523 re-read an unread session map so writes resume without a restart 47d2b8c9b9 8a4543ac00
8 #30576 hash a steering name segment written in another script 6d036f8273 9340b844e4
9 #32084 offload declared_store_names to thread in store resolution befba1e0b3 3d973afa2e
10 #31998 keep three stores intact when a rewrite cannot read them 7a4830a060 bd67a54688
11 #32462 answer queued channel messages when a non-channel turn ends 10a2d1735e 71d4542b96
12 #32308 drop an inherited agent scratch temp at gateway start c200d2d20a 3204aab1a0
13 #31940 keep a skipped crons.json record through the next write 9f46c9cdac c9ba35dd25
14 #31676 tighten the windows session-trash removal 614b0ebb12 f4b0e16974

Thirteen picks applied cleanly. #31940 hit two conflicts in cron_service/store.py, both in comments only: the _job_from_record docstring paragraph on AttributeError, and the comment above the per-entry loop in decode_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

  • CI does not run the backend suite on PRs into 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 clean release/0.12.0 @ 7ea28ed960 on the same host: two test_folder_steering_provider_dedup.py cases, two test_acp_launch_goldens.py[copilot] cases and test_cron_run_scratch.py::TestUnderTheRealSandbox::test_script_cron_writes_into_its_temp_dir.
  • Frontend (fix(chat): start a new turn at each cron delivery #30639): tsc -p tsconfig.app.json --noEmit passes; vitest run ChatMessageList.test.tsx groupDisplayItems.test.ts: 87 passed.
  • flake8, isort, black gate, subprocess-encoding gate, mypy src/kiro_crew and gen-ui-index --check pass. check_file_line_cap fails only on dashboard/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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

shubhamkurkure and others added 14 commits November 7, 2026 22:58
#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)
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.
On Windows, emptying the session trash removes only what is in the trash.

Closes #7566

(cherry picked from commit 614b0eb)
@buluoray
buluoray requested review from a team and KiroCrewCaptain as code owners November 7, 2026 23:51
@buluoray
buluoray requested review from tim-finnigan and removed request for a team November 7, 2026 23:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of f4b0e16974a3e09f948e99c14bd5dfc6d91498be — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The transcript layout of cron-driven sessions does change: opensDisplayTurn makes each cron delivery the prompt of its own turn, so the reply now renders below it. Before, it was folded into the previous turn's collapsed step group. No screenshot shows the new layout; attaching a before/after still of a cron-driven session would let this lane confirm it.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f4b0e16974a3e09f948e99c14bd5dfc6d91498be — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: every pick is an already-merged main fix carried onto release/0.12.0 without new surface. The reversed cron-drop pin is backed by issue #5705.

What this change ships

Inventory (10 items) — 10 justified

Intent: give 0.12.0 users fourteen fixes that are already merged on main, without waiting for 0.13. FIX. The change has 14 items; these are the 10 a user is most likely to notice. The other four are #30290, #30871, #30576 and #32084.

  1. Claude-backend incognito and temporary chats no longer read or write auto-memory (fix(acp): turn claude auto-memory off in incognito and temporary chats #30225) — justified
  2. Memory search returns results again after the index heals itself (fix: re-index memory sources after the FTS index self-heals #30585) — justified
  3. A cron-driven session renders one turn per delivery instead of freezing the tab (fix(chat): start a new turn at each cron delivery #30639) — justified
  4. A failed compaction rewrite no longer leaves duplicate archive copies (fix: drop a compaction's archive when its rewrite does not land #31114) — justified
  5. Session-map saves resume after one contended startup read (fix: re-read an unread session map so writes resume without a restart #31523) — justified
  6. Stores that cannot be read for a moment are no longer rewritten as empty: opt-in card, app dependencies, connection mint (fix: keep three stores intact when a rewrite cannot read them #31998) — justified
  7. Queued Teams, Webex and Discord messages are answered when a dashboard turn ends (fix: answer queued channel messages when a non-channel turn ends #32462) — justified
  8. A gateway restarted from inside a session drops the inherited scratch TMPDIR (fix(gateway): drop an inherited agent scratch temp at gateway start #32308) — justified
  9. A crons.json record that fails to load survives the next write; this reverses the "dropped by the next write" pin, per Pick up #4674's deferred crons.json quarantine: a skipped record's only recovery window is a WARNING that the next write closes #5705 (fix(cron): keep a skipped crons.json record through the next write #31940) — justified
  10. Emptying the session trash on Windows stays inside the trash folder (fix: tighten the windows session-trash removal #31676) — justified

[FIRST-PRINCIPLES-REVIEWED] f4b0e16

Description read

[DESCRIPTION-READ] 5ace0cd7ced81ac74f56eb39ad3a5a9b6d897eb398417e6f5c98ec662e95a60a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

Design-level review of f4b0e16974a3e09f948e99c14bd5dfc6d91498be — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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.

Blockers

The turn-grouping change in the chat transcript has no rendered evidence for this revision
Trigger: in groupDisplayItems.ts, transcriptRows.ts and ChatMessageList.tsx, TURN_OPENER_ROLES.has(item.msg.role) becomes opensDisplayTurn(item.msg). That makes every cron delivery or app-message inject start its own TurnBlock, and a synthesis inject now leads its batch (flushTurn(true); turnItems.push(item)). The description says the screenshot is on the main PR ("carries the same rendered change as its main PR, which shows it"). The workflow's evidence list names 0 images and 0 recordings.
Outcome: cron sessions on release/0.12.0 are split into new turn blocks, and synthesis rows move. Release has a different base than main, so you can't tell from main's evidence how turn blocks, collapsed step groups and region and foreign-injection flags look on release. The diff alone can't show whether a cron patrol session renders correctly.
Fix: render a cron-driven session, including a sub-agent fan-out with a synthesis row, against this branch's build and attach it. Also drop the <!-- no-visual-delta --> marker, because the description itself says there is a visual change.
Clears when: the description has a github.com/user-attachments screenshot or recording of a cron-driven session's transcript taken on this branch, showing a new turn at each cron delivery and the synthesis row in place.

Notes

  • fix: tighten the windows session-trash removal #31676 only runs on Windows (pinned_delete.py unlink by handle), and Manual verification says "N/A". CI doesn't run the backend suite on PRs into release/*. Running the Windows trash tests on this branch on a Windows host, or naming a Windows CI run at this SHA, would close that gap.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of f4b0e16974a3e09f948e99c14bd5dfc6d91498be and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f4b0e16

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f4b0e16974a3e09f948e99c14bd5dfc6d91498be false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed f4b0e16974a3e09f948e99c14bd5dfc6d91498be — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] f4b0e16

Verdict parsed from the review's SHA-scoped output markers for commit f4b0e16974a3e09f948e99c14bd5dfc6d91498be.

False positive or not applicable? A repository writer can comment:
/ai-review override fable f4b0e16974a3e09f948e99c14bd5dfc6d91498be false-positive: <reason, 20 to 500 characters>

@buluoray
buluoray merged commit 1e56b25 into release/0.12.0 Nov 8, 2026
20 of 23 checks passed
@buluoray
buluoray deleted the crew/slack/0.12.1-wide-1 branch November 8, 2026 00:06
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 8, 2026
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.

7 participants