Repository navigation
feat: name dropped attachments on wecom, weixin and whatsapp dms - #31729
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item reuses the existing What this change shipsInventory (6 items) — 6 justifiedIntent: when a message is refused during a restart, a WeCom, Weixin or WhatsApp DM user is told which attachments to resend, not only how many. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 26562e6 Description read[DESCRIPTION-READ] 939e0a65986fbc417fc0321d9bb76d9e5729e696591a05b9dc8bcee878337d07 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: each channel takes the names where it already took the count, and reuses the existing notice seam unchanged. Notes
[DESIGN-REVIEWED] 26562e6 Description read[DESCRIPTION-READ] 029e33955c7f6e20bb475b8058c3bd622fcbb4be1b4ee8d19bdc0a4e85000c6c 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: |
|
[operator: bolichen97] The four red Backend Tests shards on this head are main's, not this change's:
This PR waits for #31803, then rebases onto main and re-runs. |
28933fd to
21654c4
Compare
|
Rebased: main moved in docs/system-specs/modules/messaging.md, src/kiro_crew/wecom/transport_dispatch.py, test/test_wecom_dispatch.py since this head went green (8dbdf04 -> 678769e); CI re-running. The rebase was clean and the patch is unchanged. The new base also carries the fixes for the two main reds this head hit: #31803 (pull_request_target allowlist) and #31625 (security package line budget). [operator: bolichen97] |
21654c4 to
2128339
Compare
2128339 to
2a0827a
Compare
|
Rebased: main moved in docs/system-specs/modules/messaging.md, src/kiro_crew/whatsapp/transport.py, src/kiro_crew/whatsapp/transport_dispatch.py since this head went green (e4611c5 -> b4089f7); CI re-running. The rebase had one conflict, in the comment above [operator: bolichen97] |
|
[operator: bolichen97] The red Backend Tests shard 2 (Linux and Windows), and the Coverage Gate that follows it, are main's, not this change's: The other reds on this head (the AI review lanes, Sensitive Change Review, Dependency License Gate, Publish readiness signal) are the shared installation token hitting GitHub's rate limit at 08:08Z, not findings. They re-run with the next head. |
A message refused at gateway shutdown comes back on the next start as a restart notice. On WeCom, Weixin and WhatsApp DMs that notice said only how many attachments were lost, because these channels take the count before ingestion and handed it on as a bare number. They now take each attachment's name at the same point, the name the file is ingested under (the sender's own name, else its kind), so the notice lists which files to resend. The messaging spec's per-channel table moves the three channels to "the names"; Slack keeps the count until its own capture carries names. Part of #8911
2a0827a to
26562e6
Compare
|
Rebased: main moved in docs/system-specs/modules/messaging.md and src/kiro_crew/whatsapp/transport.py since this head went green (b4089f7 -> d27a5fd); CI re-running. The new base carries #32252 and #32209, which fix the two main reds (the security line-budget test on Backend Tests shard 2, Windows shard 2 and Coverage Gate, and the Windows ignore-list test on shard 7). The previous head's GPT lane posted no verdict (the run reached none and its comment lookup failed), so it was not a finding. This head also fixes one defect a local review found in this PR's own code: Locally on 26562e6: the changed and related tests (356 passed), isort, flake8, mypy, the semgrep diff scan and the flake-pattern ratchet all exit 0; local GPT and Opus reviews returned PASS. [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved: PR Readiness passed on 26562e6, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.
Problem / Motivation
Goal: A WeCom, Weixin or WhatsApp DM user whose message was refused while the gateway restarted is told which attachments 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 and Teams already name the dropped files there. On WeCom, Weixin and WhatsApp DMs the notice still said only "Its 2 attachment(s) are not carried over — resend those too.", because these three channels count the files before ingestion and handed that count 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 on WeCom and Weixin a single message can carry several. The messaging spec already lists these channels as "the count, until their names land", so this closes that gap for three of the four channels it names.
Not a goal
spool_attachments; carrying names there is a separate change under Inbound shutdown spool carries text only — attachments are not replayed #8911.What changed (motivation → approach → change)
Each of the three channels now takes one name per attachment at the same point it took the count, before ingestion clears the attachments. The name is the one the file is ingested under: the sender's own file name where the platform gives one, otherwise the kind of media. That way an unnamed photo still tells the user what to resend, which a bare "and 1 more" would not.
wecom/transport_dispatch.py)name: a file'sfilename, elsewecom-image/wecom-videoweixin/transport_dispatch.py,weixin/attachments.py)attachment_names, the iLink naming ingestion already uses: a file'sfile_name, elseimage.jpg,voice.<ext>,video.mp4._drivetakes them asoriginal_attachmentsand counts themwhatsapp/transport.py,whatsapp/transport_dispatch.py)pending_originalside table keeps the media's name instead of a count (a document's file name, else e.g.image.jpg); the route counts the namesdocs/system-specs/modules/messaging.mdBackwards compatibility
Compatible: the spool entry and the notice are unchanged; only what these three channels put in
InboundRoute.attachment_nameschanges, and the count each route records stays the same.Removes nothing: no field, key or behaviour is taken away. WhatsApp's in-memory
pending_originaltable holds names in place of a count, and its only reader, the dispatcher's_inbound_route, counts them.Tests
test/test_wecom_dispatch.py::TestTurn::test_a_shutdown_refusal_spools_the_attachment_names— a refused WeCom callback with a named file and an image spools("a.pdf", "wecom-image")and a count of 2.test/test_weixin_dispatch.py::test_a_refused_callback_spools_the_attachment_names— the same for a refused Weixin callback:("a.pdf", "image.jpg").test/test_weixin_dispatch.py::test_the_turn_route_names_the_attachments_ingestion_consumed— the turn's route still names both files after ingestion has clearedinbound.attachments.test/test_whatsapp_transport.py::TestPreIngestionOriginalIsCapturedForTheSpool::test_a_document_records_the_name_its_sender_gave_it— a document'sfileNameis what the side table keeps.test/test_whatsapp_transport.py::TestPreIngestionOriginalIsCapturedForTheSpool::test_the_original_caption_survives_ingestionandtest/test_whatsapp_dispatch.py::test_dm_route_spools_the_pre_ingestion_original_not_the_prompt— an image is kept asimage.jpgand reaches the route as one named attachment.Proof: PROVEN test/test_wecom_dispatch.py::TestTurn::test_a_shutdown_refusal_spools_the_attachment_names, test/test_weixin_dispatch.py::test_a_refused_callback_spools_the_attachment_names, test/test_weixin_dispatch.py::test_the_turn_route_names_the_attachments_ingestion_consumed, test/test_whatsapp_dispatch.py::test_dm_route_spools_the_pre_ingestion_original_not_the_prompt, test/test_whatsapp_transport.py::TestPreIngestionOriginalIsCapturedForTheSpool::test_the_original_caption_survives_ingestion (head 28933fd)
Related backend set run locally with 4 workers (the touched channels' test files,
test_inbound_spool.py,test_messaging_dispatch.pyand the files importing the changed modules): 1962 passed, 1 skipped. Determinism: the six node ids above passed 20 runs at-n0, one run in reversed order, and one run at-n 4 --dist loadgroup --max-worker-restart=2beside the whole oftest/test_weixin_dispatch.pyandtest/test_wecom_dispatch.py.Manual verification
N/A — unit coverage drives each dispatcher's real refusal path and WhatsApp's real
receive; no external service is involved.Screenshots / video
N/A — no frontend change; the notice is chat text.
Related Issues
Part of #8911
Sibling sweep
Siblings: none -- this is a feature, not a defect fix
Pattern harvest
Not generalizable: this is a feature, not a defect fix
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).