Skip to content

fix(media): report read failures and preserve explicit IM resends - #2683

Open
henryZhouLikeStudy wants to merge 9 commits into
TencentCloud:developfrom
henryZhouLikeStudy:fix/2351-generated-media-develop
Open

henryZhouLikeStudy wants to merge 9 commits into
TencentCloud:developfrom
henryZhouLikeStudy:fix/2351-generated-media-develop

Conversation

@henryZhouLikeStudy

@henryZhouLikeStudy henryZhouLikeStudy commented Oct 31, 2026 •

Copy link
Copy Markdown

When generated media is sent through IM, workspace paths must resolve to readable media bytes and explicit resends must remain possible after an upload failure.

This PR preserves the workspace guards and current-turn tool-call filtering, rejects unsupported URL schemes, and emits localized, path-free errors when media cannot be read. It removes cross-call content deduplication: the projection receives no channel delivery receipt, so emitting an event cannot prove that equal bytes were delivered. A new send_file_to_user call therefore remains deliverable; replayed results of the same tool-call ID are still suppressed.

Regression coverage interleaves media projection with real Weixin byte loading and media-send control flow. Upload/API calls and auxiliary status/fallback output are mocked. It covers failed and successful first uploads, identical and changed media bytes, ordinary and HITL-resumed streams, repeated turns, and replayed tool results. The identical-content resend cases fail before the fix and pass afterward.

Validation

Current head aacdadd0479c00c6550228a5f116f1817b4effc6 includes develop at cffc4ceaa537507448682a15bd373cccd6eea001. The media delivery fixes are listed under Unreleased in CHANGELOG.md.

  • The Linux pre-commit hook and Dashboard production build passed. The focused Linux media and i18n run passed all 166 cases on the same source tree.
  • Linux x86_64 (Python 3.12.16, Node.js 22.23.5) ran make all PYTEST_JOBS=0. Formatting, Ruff, and mypy passed. Pytest reported 6,182 passes, 39 skips, 36 deselections, and one failure in test_probe_tencent_mirror_unreachable. The same failure reproduced on unmodified develop, where the validation host already had a listener on loopback port 443.

Earlier Windows validation

  • The resend regression matrix passed 8 tests.
  • Gateway and i18n passed 679 tests with 2 skips.
  • Ruff lint and formatting checks passed. mypy passed for 653 source files.
  • The full pre-commit pytest --testmon run with four workers had 5,242 passes and 271 skips.
  • The pre-commit hook passed, including frontend TypeScript checking and the production build.

Channel upload/fallback reporting is tracked separately in TencentCloud/octop-gateway#55. Delivery of unreviewed generated drafts is tracked in #2859.

No production credentials, server addresses, account/session identifiers, chat text, user images, screenshots, or private filesystem paths are included.

Closes #2351.

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md
@henryZhouLikeStudy
henryZhouLikeStudy force-pushed the fix/2351-generated-media-develop branch from 96723cc to 790f468 Compare November 3, 2026 08:42
@henryZhouLikeStudy

Copy link
Copy Markdown
Author

Rebased onto current develop and resolved the changelog conflict while preserving both branches' entries. New head: 790f468. Focused Gateway media, stream projection, and i18n tests: 155 passed; Ruff and diff checks pass; CodeCC check passes.

@henryZhouLikeStudy henryZhouLikeStudy changed the title fix(media): report delivery failures and dedupe IM attachments fix(media): report read failures and preserve explicit IM resends Nov 6, 2026

This branch has not been deployed

No deployments
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.

1 participant