Skip to content

fix(slack): voice reply, restart close and rss recycle fixes - #33670

Merged
bolichen97 merged 1 commit into
mainfrom
fix/sweep-g2-slack-and-sessions
Nov 9, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/sweep-g2-slack-and-sessions

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Slack voice replies are spoken on a default install, every restart reaches its exec even when closing sessions never finishes, and the RSS watchdog stops recycling a chat after every turn and tells the user which setting to raise.

This PR fixes three separate defects, reported together in #33481:

  1. Slack voice replies never play on a default install. With voice replies on (globally, with the owner's !voice on in a thread, or for a voice memo under voice_reply.auto_reply_to_voice), the answer arrives as text only. messaging.use_transport is on by default, and only the native path speaks a reply. On the transport path the owner's !voice on gets a reply that answers stay text, and a voice memo that waits in the busy-session queue loses its voice flag.
  2. A restart can hang forever while closing sessions. Restart to Update, the dashboard restart and the Slack /kirocrew restart all await SessionManager.close_all() before the exec or exit. A background task that keeps running after it is cancelled holds that await with no end: turn admission is already shut, and the old version keeps serving.
  3. The RSS watchdog recycles a chat after every turn and never says why. When a fresh process for a session is over session.watchdog_rss_max_mb on its own (a long history restored into it), every recycle is followed by another crossing. The user pays a cold start every turn, and the chat only says it was recycled.

Why it matters

  • Voice replies are a documented Slack feature, and a default Slack install has no way to get them. The owner is told they are unavailable.
  • A stuck restart leaves the gateway refusing every new turn while it keeps running the old version. Restart to Update shows nothing, and only killing the process ends it.
  • A chat whose footprint is over the ceiling loses its warm session after every reply, for as long as it is used. Nothing points the user at the setting that causes it.

Not a goal

What changed (motivation → approach → change)

Three fixes, one per defect: a Slack answer on a default install is spoken when voice replies are on, a restart goes on to its exec when closing sessions never finishes, and a chat whose fresh process is over the RSS ceiling stops being recycled after every turn and is told which setting to raise.

Defect Root cause Change
No Slack voice reply on the transport path Only the native handle_message called _reply_by_voice handle_message_transport speaks a finished answer through the same _reply_by_voice, in the new slack/transport_voice.py
Restart held by a close that never ends close_all() awaits its cancelled tasks with no deadline, and asyncio.wait_for waits for a cancelled close to unwind close_sessions_for_restart, in the new restart_session_close.py, waits on the close as its own task: 20 s, or 5 s for Slack, then on to the exec or exit
RSS recycle after every turn Each recycle restores the same history, which is over the ceiling again The new session_rss_rebound.py holds a session at its third rebound in a row, logs it once and tells the chat which setting to raise

Voice. The transport path speaks SlackRenderer.delivered_text, the answer as Slack showed it, into the conversation it was posted to. It skips an unfinished or cancelled turn and never lets a speech failure mark the turn failed. had_voice_input reaches the transport path from the immediate call, both busy-session queues and _dispatch_queued, so a queued voice memo is still answered in kind. On main, the transport path answers the owner's !voice on with a note that replies stay text (voice_replies=False in slack/handler_runtime/commands.py), a stopgap for the missing voice reply. This PR removes that stopgap, so !voice on opts a thread in on both paths. Reviewers should look at this integration with main.

Restart. The dashboard restart (dashboard/handlers/updates_apply.py), the gateway's update restart (slack/gateway_runtime/update_schedule.py) and the Slack restart (slack/events_slash.py) all close sessions through the new helper. A close cut at its deadline is cancelled and left behind. A warning names the step, and the next start's orphan sweep reaps what it left. The dashboard restart logs each step as it starts, so a slow restart shows where it is. RESTART_SESSION_CLOSE_SECS lives in gateway_shutdown_budget.py.

RSS. session_cleanup.py keeps one RssRecycle record per key and asks session_rss_rebound to judge each crossing. The hold ends a day after the last recycle. A held session whose footprint doubles is recycled anyway. SessionManager.on_rss_hold (session.py) is the seam the dashboard (dashboard/state_parts/session_events.py) uses to post a warning notice into the tab. The notice names session.watchdog_rss_max_mb and its value, and says to raise Watchdog RSS Limit in Settings. The recycle notice of a rebound names the setting too.

The owning specs and user docs describe the new behaviour (config.md, learn-cron-dashboard.md, session.md, slack-gateway.md, voice-streaming.md, src/kiro_crew/docs/configuration.md, slack-integration.md). A comment in session_lifecycle_parts/fleet.py and the notice list in website/src/pages/chat/CompactionCard.tsx name the new pieces.

Backwards compatibility

Compatible: no config key, API, record format or command is renamed or removed. The restart bound and the RSS hold only add an end to waits and loops that had none.

Reader: src/kiro_crew/slack/transport_dispatch.py:handle_message_transport -- chat -- it was the only caller passing voice_replies=False to _route_bang_command, removed with the parameter; !voice on opts the thread in, pinned by test_slack_transport_bang_commands.py::test_voice_on_opts_the_thread_in_as_on_the_native_path
Reader: src/kiro_crew/slack/handler_runtime/dispatch.py:_route_bang_command -- chat -- the native path never passed voice_replies, so its !voice keeps the default it always had; covered by the same bang-command tests
Reader: src/kiro_crew/session_cleanup.py:CleanupState.rss_recycled -- chat -- its values change from a (time, rss) tuple to RssRecycle; every other reader (test_session_harness_background_work.py, test_session_idle_exempt_keys.py, test_session_terminated_reap.py) reads only its keys or emptiness, and test_session_rss.py reads .rss

RSS_REBOUND_WINDOW_SECS moves from session_cleanup.py to session_rss_rebound.py with the same value; its only reader was test_session_rss.py, which moves with it.

Tests

The full backend and frontend suites run in CI. On a Linux DevSpace, at head 1a0e70fcfc on main 94dfacdb2d, the changed test files (test_slack_events_coverage_route_flow.py, test_slack_transport_dispatch_turn_outcomes.py, test_slack_transport_bang_commands.py, test_slack_post_message_call_sites.py, test_restart_close_all_deadline.py (new), test_restart_command.py, test_dashboard_chat_compaction.py, test_session_rss.py and test_state_parts_session_events.py), together with test_file_line_cap.py, test_slack_gateway.py (main changed it under this PR's Slack gateway files) and the ten other test files that reference update_schedule.py, gave 866 passed, 0 failed. The black, isort, flake8, mypy (--platform linux), subprocess encoding, comment history, brand name, file line cap, harness parity and flake-pattern ratchet gates all exit 0.

Rebased onto main after review; patch unchanged: head cfb0c00510 on main 39aecc7296. git range-diff against 5ddcf2ebc5 differs only in one hunk's context lines: main added a code_channel_slash import to the type-checking import block of slack/events.py, and this PR's close_sessions_for_restart import now follows it. On the DevSpace at this head, the changed test files with main's test_slack_gateway_composition_contract.py, test_slack_code_channel_agent_surface.py and its failures sibling gave 778 passed, 0 failed. test_review_repair_routing_skill.py gives 20 passed; with the earlier head's 16004-byte kirocrew-worktree-dev/SKILL.md it fails its 16000-byte ceiling (exit 1), which is the Backend Tests red on 5ddcf2ebc5 that main's shorter copy clears. The black, isort, flake8, mypy, subprocess encoding, comment history, brand name, file line cap, harness parity and flake-pattern ratchet gates all exit 0.

Rebased onto main after review; patch unchanged: head 0d274605be on main 5ed49b39f7. git range-diff against cfb0c00510 changes only context lines, in the five files main's #33935 also changed at the RSS recycle site (session_cleanup.py, session.py, session_events.py, config.md, configuration.md). Both sides stay: main's leftover-process pass runs before this PR's RssRecycle record, both session event handlers are wired, and main's watchdog_end_leftovers_mid_turn row follows this PR's watchdog_rss_max_mb row. On the DevSpace at this head, the changed test files with main's test_session_leftovers.py, test_platform_compat_refactor_facade.py and 13 session, RSS and config neighbours gave 1323 passed, 0 failed, and test_the_scan_is_linear_not_quadratic (the Backend Tests red on cfb0c00510) passes. The black, isort, flake8, mypy (--platform linux), subprocess encoding, comment history, brand name, file line cap, harness parity and flake-pattern ratchet gates all exit 0.

Two test files resolve the new modules inside the test that uses them instead of at module top, so a missing module fails one test rather than the whole file's collection.

test_slack_post_message_call_sites.py holds slack/handler_runtime/commands.py at 78 direct post_message calls, one fewer than main, because this PR deletes the transport path's fixed !voice text-only reply. It passes at the head (12 passed) and fails with commands.py as on main: 79 direct call(s), baseline says 78 -- a new direct send path.

What each test pins:

  • Voice: a finished transport turn speaks its displayed answer (global voice, a thread's !voice on, a voice memo); an unfinished or cancelled turn speaks nothing; a speech failure does not mark the turn failed; a queued voice memo keeps its voice flag; !voice on opts the thread in on the transport path.
  • Restart: each of the three restarts reaches its exec or exit when a background task outlives every cancel, and names the cut step in a warning; the dashboard restart logs each step.
  • RSS: the third rebound in a row is held, logged once and posted once into a tab with a conversation; the hold ends after a day; a held session that doubles its footprint is recycled.

Proof: PROVEN test/test_restart_close_all_deadline.py::test_a_restart_whose_session_close_never_finishes_still_ends[update], test/test_restart_close_all_deadline.py::test_a_restart_whose_session_close_never_finishes_still_ends[dashboard], test/test_restart_close_all_deadline.py::test_a_restart_whose_session_close_never_finishes_still_ends[slack], test/test_restart_close_all_deadline.py::test_the_dashboard_restart_logs_each_step_as_it_starts, test/test_session_rss.py::TestRssThresholdCheck::test_a_session_that_keeps_rebounding_is_held_and_the_chat_told_once[under-twice] (head 1a0e70fcfc63)

Manual verification

Each defect's user scenario was run end to end on a DevSpace. Each fix side exited 0 on the same patch at 2ad20f6dca on main 7b2eeb9f4b; the four main commits under 1a0e70fcfc since then change memory indexing, button focus in the UI and a Slack gateway shutdown test, none of this PR's files. Each base side exited 1 on main: voice and restart on 63d560bd68, RSS (a 6 minute run) on e623a4d11b. At cfb0c00510 on main 39aecc7296 each fix side exited 0 again: the restart reached the exec in 26.4 s (6.2 s without the stuck task) and left no process behind. At 0d274605be on main 5ed49b39f7, the RSS fix side exited 0 again (3 recycles and 2 rebounds, then held, with the chat naming session.watchdog_rss_max_mb=120), and its base side on that main exited 1 (5 of 5 turns recycled, no notice naming the setting).

  • Voice: with default settings (messaging.use_transport on), the transport path posted the answer and uploaded voice-reply.wav, as the native path does. On main the answer posts with no clip (synth_calls=0).
  • Restart: with a background task that keeps running after its cancel, POST /api/restart reached the exec in 26.5 s (6.1 s without the stuck task), and the new process came up ready. On main, 60.5 s after the call there is no exec and the old process still serves.
  • RSS: with session.watchdog_rss_max_mb=120, recycling stopped after 3 recycles and 2 rebounds, and the chat named session.watchdog_rss_max_mb=120. On main, 5 of 5 turns each ended in another recycle and no chat notice named the setting.

Screenshots / video

Why no screenshot: the only frontend change is a comment line in CompactionCard.tsx; the RSS hold notice is backend text drawn by the existing notice card.

Related Issues

Fixes #33481

Sibling sweep

Swept: git grep -n "_reply_by_voice|synthesize_and_deliver" -- src/kiro_crew/
Sibling: src/kiro_crew/telegram/transport_dispatch.py -- not affected -- its transport path already speaks through synthesize_and_deliver
Sibling: src/kiro_crew/whatsapp/transport_dispatch.py -- not affected -- its transport path already speaks through synthesize_and_deliver
Swept: git grep -nE "(sessions|session_mgr).close_all(" -- src/kiro_crew/
Sibling: src/kiro_crew/slack/gateway_runtime/exit_path.py:344 -- not affected -- a shutdown is ended by the supervisor's SIGTERM-to-SIGKILL deadline, which no in-process restart has
Sibling: src/kiro_crew/cli_server.py:543 -- not affected -- the end of a foreground CLI run with no exec after it; the user can interrupt it
Sibling: src/kiro_crew/eval/runner.py:397 -- not affected -- an eval run's teardown, with no exec after it
Swept: git grep -n "rss_max_mb" -- src/kiro_crew/
Sibling: src/kiro_crew/session_background.py -- tracked in #31900
Sibling: src/kiro_crew/session_cleanup_spare.py -- not affected -- a warm-pool spare holds no conversation, so discarding one costs no chat a cold start

Pattern harvest

Rule candidate: semgrep
Pattern: asyncio.wait_for used as the hard cap before an exec or exit; a cancelled callee that keeps running holds it past the timeout.

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 03:58
@bolichen97
bolichen97 requested a review from Zedmor November 9, 2026 03:58
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 9, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 9, 2026 04:14
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97
bolichen97 force-pushed the fix/sweep-g2-slack-and-sessions branch from 6b5fcb5 to 5ddcf2e Compare November 9, 2026 09:20
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0d27460

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

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: each of the three defects is fixed at its root cause with a narrow helper, and the take-away readers (voice_replies, rss_recycled, RSS_REBOUND_WINDOW_SECS) all still work in this tree.

Notes

  • Three unrelated fixes (Slack voice, the restart close bound, the RSS hold) share one PR, which allows at most two commits. Splitting them would let any one be reverted on its own; the RSS hold changes how the memory ceiling behaves, so it is the one most likely to need a revert.
  • The RSS hold leaves a chat running for up to a day while it is over the operator's session.watchdog_rss_max_mb ceiling. The only other bound is "recycle if memory doubles", and no setting turns the hold off. An operator who set the ceiling to stop exactly this footprint has no way to keep the old recycle-every-turn behaviour.

[DESIGN-REVIEWED] 0d27460

Description read

[DESCRIPTION-READ] ba5148a012609999464ce42865468afa2ab59d838b602b81f59ade570e6a822e

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 9, 2026 •

Copy link
Copy Markdown
Contributor

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

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

UX-Verdict: PASS

cannot evaluate: missing a screenshot of the new "⚠️ The watchdog stopped recycling this session…" chat notice. The PR attaches no image, so the blind read was not performed.

Evidence gaps

  • RSS hold notice in a dashboard chat tab (_RSS_HOLD_NOTICE, meta={"kind": "compaction", "notice": "rss_hold"}, warn tone through NoticeCard). This is new chat content, and the blind-read report says "BLIND READ NOT PERFORMED". To close the gap, attach a screenshot of a chat tab showing the rendered notice card with its warn icon.
  • Reworded recycle notice on a rebound (rss_recycle_reason → "memory limit (…MB), over session.watchdog_rss_max_mb of …MB again since its last recycle"). To close the gap, attach a screenshot of the recycle notice on a rebound.

Notes

  • _RSS_HOLD_NOTICE runs three sentences in one paragraph and leads with mechanism words ("watchdog", "fresh process", raw session.watchdog_rss_max_mb). Put the action first, using the Settings label only. Suggested: "⚠️ This chat's memory is above the Watchdog RSS Limit ({ceiling} MB), so it is no longer restarted after each reply. Raise the limit above {limit} MB in Settings, or start a new chat."
  • In rss_recycle_reason, use the visible label "Watchdog RSS Limit" in place of the config key session.watchdog_rss_max_mb. The key means nothing to a dashboard user, and the label is what the hold notice already tells them to look for in Settings.

[UX-REVIEWED] 0d27460

Description read

[DESCRIPTION-READ] 9c956deb51549c7049d3285ec297a7dee128134b02a5865e496d44feb293840a

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 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0d274605bed2926b1eb7121fc056460e714e44d5 — 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. Each defect traces to #33481. The restart bound is applied at the callers, which follows the caller-owns-the-cap design that fleet.py already documents.

Notes

  • Item 4 — symptom-level: the wait with no end is close_all's asyncio.gather(owner._cleanup_task, return_exceptions=True) in session_lifecycle_parts/fleet.py. Grepping \.close_all\( finds 6 SessionManager callers. This PR wraps 3 of them; cli_server.py:543 and eval/runner.py:397 stay unbounded, and exit_path.py:344 is excluded under Not a goal. Subtraction: bound the gather once inside close_all and delete restart_session_close.py, RESTART_SESSION_CLOSE_SECS and _RESTART_SESSION_CLOSE_SECS. That is a smaller form that covers every caller.

What this change ships

Inventory (9 items) — 8 justified

Intent: Slack voice replies play on a default install, a restart cannot hang on closing sessions, and a chat over the RSS ceiling stops being recycled after every turn. FIX.

  1. Slack answers on the transport path are spoken when voice replies are on — justified
  2. A queued voice memo is still answered by voice — justified
  3. On the transport path, !voice on turns voice on instead of saying "not available" — justified
  4. Dashboard and update restarts go on to the exec after 20 s — symptom-level; bounded at callers, not in close_all
  5. The 5 s cap on Slack /kirocrew restart now holds against a cancel that is swallowed — justified
  6. The dashboard restart logs each step with its elapsed time — rides along
  7. The watchdog stops recycling a session after the third rebound in a row, for up to a day unless its memory doubles — justified
  8. The chat gets a warning that names session.watchdog_rss_max_mb when the hold starts — justified
  9. The recycle notice for a rebound names the setting — justified

[FIRST-PRINCIPLES-REVIEWED] 0d27460

Description read

[DESCRIPTION-READ] 3655a4781512428bdc23187f7bed5e4ca10adf1312f9ba4898c2ef51dfabb877

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 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 0d27460

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

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

buluoray
buluoray previously approved these changes Nov 9, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the re-review. The one blocking finding is fixed: the commands.py post_message ratchet baseline drops from 79 to 78, and its description no longer names the removed !voice text-only reply (test/test_slack_post_message_call_sites.py:106). The ratchet test passes, and it turns red again when the row is set back to 79. range-diff shows no other code change apart from a reworded comment in update_schedule.py.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 3) is red on 5ddcf2ebc5 with test/test_review_repair_routing_skill.py::test_slim_skills_do_not_regrow_duplicate_guidance_or_wire_model_ids[kirocrew-worktree-dev-16000]: kirocrew-worktree-dev/SKILL.md is 16004 bytes against its 16000 cap. This PR does not touch that file; main has carried 16004 bytes since b94f8cb (#33084), so the same test fails on main. #33795 brings the file back under the cap. This PR waits for it and rebases once it merges (a job rerun reuses the old merge commit and cannot pick it up).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97
bolichen97 force-pushed the fix/sweep-g2-slack-and-sessions branch from 5ddcf2e to cfb0c00 Compare November 9, 2026 19:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 9, 2026
- Slack voice replies are spoken on the default transport path. With
  messaging.use_transport on (the default), handle_message_transport
  now speaks a finished answer through _reply_by_voice, the voice-memo
  signal survives the busy-session queue, and the owner's !voice on
  opts a thread in instead of answering that replies stay text.
- Every in-process restart (Restart to Update, the dashboard restart
  and the Slack /kirocrew restart) closes sessions through
  close_sessions_for_restart, which leaves a close still running after
  20 s (5 s for Slack) and goes on to the exec. A background task that
  outlived its cancel used to hold the restart forever on the old
  version; _restart_gateway also logs each step it starts.
- The RSS watchdog holds a session after its third rebound in a row
  instead of recycling it after every turn, logs it once and tells the
  chat which setting (session.watchdog_rss_max_mb) is below the
  session's footprint. The hold lifts a day after the last recycle,
  and a held tree that doubles its footprint is still recycled.
@bolichen97
bolichen97 force-pushed the fix/sweep-g2-slack-and-sessions branch from cfb0c00 to 0d27460 Compare November 9, 2026 22:24
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 9, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approved at 0d27460 after the approval at cfb0c00. The new head is a rebase onto a main that added the leftover-memory watchdog inside the same RSS recycle loop. The PR's judge_rss_crossing hold now sits inside main's busy/leftover loop (src/kiro_crew/session_cleanup.py:808-823), the RssRecycle record follows main's _leftovers.end_after_recycle call (:917), and on_leftover_memory and on_rss_hold are both declared and wired (src/kiro_crew/session.py:937-942, src/kiro_crew/dashboard/state_parts/session_events.py:823, :856). The PR's own hunks are unchanged. 603 tests pass and the hold-guard mutation turns 5 tests red. GPT, Opus and Security Scope pass; backend and E2E lanes were still running when posted.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97
bolichen97 merged commit 72f6877 into main Nov 9, 2026
101 of 109 checks passed
@bolichen97
bolichen97 deleted the fix/sweep-g2-slack-and-sessions branch November 9, 2026 23:20
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 9, 2026
bolichen97 added a commit that referenced this pull request Nov 10, 2026
- Slack voice replies are spoken on the default transport path. With
  messaging.use_transport on (the default), handle_message_transport
  now speaks a finished answer through _reply_by_voice, the voice-memo
  signal survives the busy-session queue, and the owner's !voice on
  opts a thread in instead of answering that replies stay text.
- Every in-process restart (Restart to Update, the dashboard restart
  and the Slack /kirocrew restart) closes sessions through
  close_sessions_for_restart, which leaves a close still running after
  20 s (5 s for Slack) and goes on to the exec. A background task that
  outlived its cancel used to hold the restart forever on the old
  version; _restart_gateway also logs each step it starts.
- The RSS watchdog holds a session after its third rebound in a row
  instead of recycling it after every turn, logs it once and tells the
  chat which setting (session.watchdog_rss_max_mb) is below the
  session's footprint. The hold lifts a day after the last recycle,
  and a held tree that doubles its footprint is still recycled.

Backport note: slack/events.py takes the close_sessions_for_restart
TYPE_CHECKING import without the code_channels slash import next to it
on main (#21429, unreleased). The commands.py row of
test_slack_post_message_call_sites.py goes from 78 to 77, since release
already counted one call fewer than main. The session.md and
voice-streaming.md conflicts are context only: the close_all row and the
Slack reply row take the change from main, while the newer
drain_active_turns wording and the WhatsApp reply row beside them on
main stay out. Everything else applies as on main.

(cherry picked from commit 72f6877)
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.

Slack voice replies missing on the default transport path, restart can hang closing sessions, RSS watchdog recycles a chat every turn

2 participants