Repository navigation
feat: name dropped attachments in the slack restart notice - #36477
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this adds an optional keyword, defaulting to empty, through the paths that already carry the count, and reuses the existing store and notice rendering unchanged. [DESIGN-REVIEWED] 0f87abe Description read[DESCRIPTION-READ] 997a2b9df9ec4ffc3d478f61f24bab125745b63598c95df6ea561d2a6e967aee 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the change finishes Slack's entry in the spec's per-channel table (the decision tracked as #8911), and every item is consumed by the restart notice. Notes
What this change shipsInventory (3 items) — 2 justifiedIntent: a Slack user whose message was refused during a restart learns which files to resend. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 0f87abe Description read[DESCRIPTION-READ] 3401d62d092ae40958114e6e9cd62b9a275a0737a5969d1febebe5caf3cb1eb8 That sha256 names the PR description this verdict read. 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: |
f4e7f71 to
cc0ad0c
Compare
|
Rebased: main moved in The red [operator: bolichen97] |
|
Stale-PR cleanup: we did not push here because the linked issue #8911 still carries the |
|
Rebased: main moved in The red [operator: bolichen97] |
cc0ad0c to
160899e
Compare
|
[operator: bolichen97] @iamwhatever thanks for checking. The step This PR is rebased onto a |
|
[operator: bolichen97] The red Every |
A Slack message refused at gateway shutdown comes back on the next start as a restart notice. It said only how many files were lost, because Slack took the count before ingestion and handed it on as a bare number. Slack now takes each file's own name at the same point and carries it beside the count, through the busy-session queue, to both refusal routes, so the notice lists which files to resend. A file Slack gives no name is still counted. The messaging spec's per-channel table moves Slack to "the names". Closes #8911
|
Rebased: main moved in The rebase onto current [operator: bolichen97] |
160899e to
0f87abe
Compare
Code change approver recommendation: A person should decideWhy: the decider estimates a 6% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier 2: the title's category is not one of fix, test, chore, refactor. Slack now records each file's name next to the count before ingestion and passes the names through every place the count already goes: the busy queue, the native handler with its compaction replay, and the transport handler. All three Slack refusal routes put the names in InboundRoute.attachment_names. The existing store and notice code then drop blank names, bound and defang the rest, and count unnamed files as "and N more". The envelope-level admission check passes route=None, so it saves nothing. The new keyword defaults to empty, so re-dispatches behave as before. Tests cover each hop, and CI and all review lanes are green. Tier: 2, held for a person: the title's category is not one of fix, test, chore, refactor. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed head 0f87abe. The file names Slack captures before ingestion now travel next to the existing count through the busy-session queue, the native handler and its compaction replay, and the transport handler. All three Slack refusal routes put them on the spool route. The store already drops unnamed entries and the notice still counts them, so a message with both named and unnamed files gets a correct notice. The new keyword defaults to empty, so re-dispatches spool exactly what they did before. The changed Slack test files and the spool tests pass on this head, and I found nothing that blocks.
Problem / Motivation
Goal: A Slack user whose message was refused while the gateway restarted is told which files to resend, not only how many.
A message that arrives while the gateway shuts down is answered on the next start with a restart notice. Discord, Telegram, Teams, WeCom, Weixin and WhatsApp DMs already name the dropped files there. On Slack the notice still said only "Its 2 attachment(s) are not carried over — resend those too.", because Slack takes the file count before ingestion and handed it on as a bare number.
Why it matters
The notice exists so a resend is one step. A count leaves the user guessing which of the files they sent were lost, and a Slack message often carries several. Slack is the last channel the messaging spec still lists as "the count, until its names land (#8911)", so this finishes the per-channel decision the issue asks for.
Not a goal
What changed (motivation → approach → change)
Slack now takes each file's own
nameat the point it already took the count, in_route_message, before voice transcription and file ingestion rewrite the message. The names ride beside the count, asspool_attachment_names, everywhere the count already goes: the busy-session queue, the native handler (and its compaction replay) and the transport handler. All three Slack refusal routes put them inInboundRoute.attachment_names, so the restart notice lists them. A file Slack sends without a name is passed as an empty name, which the store drops and the notice still counts as "and 1 more".slack/events.py_spool_attachmentsand hands it to the queue and both handlersslack/events_queue.py_dispatch_queuedcarries the queued names to the handlerslack/handler.py,slack/handler_runtime/turn.pyhandle_messageputs the names on its admission route and keeps them for the compaction replayslack/transport_dispatch.pyhandle_message_transportputs them on its admission route and its shutdown-dispatch routedocs/system-specs/modules/messaging.mdBackwards compatibility
Compatible:
spool_attachment_namesis a new keyword that defaults to empty, so every existing caller ofhandle_messageandhandle_message_transport(button and interaction re-dispatches included) spools exactly what it did before; the spool entry and the notice are unchanged.Removes nothing: no field, key or behaviour is taken away; the count each Slack route records stays the same.
Tests
test/test_slack_events_coverage_route_flow.py::TestRouteMessageAttachments::test_spool_gets_the_pre_ingestion_message(native and transport) — a message with a named and an unnamed file hands("shot.png", "")and a count of 2 to the handler.test/test_slack_events_coverage_route_flow.py::TestRouteMessageAttachments::test_busy_session_queues_the_pre_ingestion_message— the busy-session queue keeps the names.test/test_slack_events_coverage_route_flow.py::TestDispatchQueued::test_pre_ingestion_message_travels_to_the_handler(native and transport) — a queued message's names reach the handler.test/test_slack_transport_dispatch.py::TestTransportAdmissionSpool::test_spool_records_the_pre_ingestion_message(admission and dispatch) — both transport refusal routes carry the names.test/test_slack_transport_dispatch.py::TestTransportAdmissionSpool::test_native_admission_spools_the_pre_ingestion_message— the native admission route carries the names; an interaction re-dispatch carries none.Each of these assertions fails on the base (8 failures, all on the new
spool_attachment_names/attachment_nameschecks) and passes with the change. Determinism, on Linux hosts: the 9 changed node ids passed 20 runs at-n0; both files (128 tests) passed 10 runs at-n 4 --dist loadgroup --max-worker-restart=2on earlier bases and 3 on the current one; shuffled runs of all 128 ids passed with seeds 27558, 15023, 8713 and 12025.Related backend set (
scripts/local-gate.py, all seven batches) on a Linux host: every test passed except five outside the Slack code. Four fail the same way on a clean checkout of the base:test/test_dashboard_server_composition_contract_reach.py::test_the_dashboard_boot_keeps_its_chain_hooks_and_order(a builtstatic/distin the clone),test/test_host_git_repo_exec_neutralization.py::TestCliUpdate::test_up_to_date_diff_runs_no_textconv_planted_during_the_fetch(host git state), andtest/test_live_target_pointer_visibility.py::TestTheSiblingRefusalsAreDefusedToo::test_a_strict_file_stat_failure_is_defused[fstat]andtest/test_sandbox_mount_pinned_target.py::test_a_stand_in_whose_identity_cannot_be_read_refuses_with_the_blocked_line(anEIOfrom the host filesystem). The fifth,test/test_push_guard_diagnostics.py::TestPushGuardChildren::test_a_signal_inside_popen_wait_still_reaps_the_child, failed under parallel load and passes alone on the base and on this branch. mypy, flake8 and isort over the tree, semgrep on the diff and the flake-pattern ratchet pass.Manual verification
Driven on a Linux host through the real code path, with only the Slack Web API client, the file download and speech-to-text stubbed:
_route_messagewith the textsee attachedand two files (report.pdfand one with no name), both handler paths, a realSessionManagerwith admission paused for an update, soadmit_inbound_callbackspools the message to a tempKIROCREW_HOME; then the boot-timereplay_spooledposts the notice to a stub transport.Before (base), both paths:
After, both paths:
A text-only message still gives the quoted text with no attachment line.
Screenshots / video
N/A — no frontend change; the notice is chat text.
Related Issues
Closes #8911
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license (see CONTRIBUTING.md).