astrbot_plugin_private_comp.../docs
YokiiroBW 88f753ae8c fix: stop leaking downloaded vision temp files on every non-group path
Vision downloads http(s) image sources into private_inbound_images/<namespace>/
and _cleanup_prepared_image_sources is the only thing that deletes them. All
six cleanup calls on the private path sat inside `if group_mode:`, so only
group image recognition ever cleaned up. The forward-message path reused the
prepare helper without copying the cleanup calls at all, leaking on all four
returns. Files cap at 12 MB each and grow without bound.

The deeper problem is that cleanup was attached to individual return
statements rather than to the lifetime of the file, so even the group path
missed the exception and cancellation routes -- the vision coroutine is
wrapped in asyncio.wait_for, and a timeout raises CancelledError, which
`except Exception` does not catch.

Three defences, one per gap: the group_mode condition is gone (releasing a
temporary file is not a feature toggle); the forward path splits out an inner
function so a try/finally covers both normal and error returns; and preparing
new images first sweeps anything in that namespace older than 30 minutes,
which needs no return statement to be reached and so covers cancellation.

Chose the sweep over wrapping the 260-line function in try/finally: that would
have meant reindenting the whole body for less coverage than the sweep gives.

Companion suite 243 passed, joint E2E 146/146.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:36:12 +08:00
..
M6日程拆分与陪伴插件调整评估.md feat: link bot personal memory bridge 2026-07-26 03:14:03 +08:00
OPS陪伴插件全功能盘点与删减评估.md feat: remove ops entertainment integrations 2026-07-26 01:32:07 +08:00
Q7后端接口收口与VM验收记录.md docs: record q7 vm acceptance 2026-07-26 00:14:02 +08:00
Q8前端改造与验收记录.md docs: record q8 vm deployment acceptance 2026-07-26 03:00:48 +08:00
VM部署验收-娱乐功能清理-f4d160c.md docs: clarify vm clock in acceptance record 2026-07-26 01:56:48 +08:00
前端改造要求-Q6-Bot自有存储与用户记忆边界.md docs: add frontend migration contract 2026-07-26 00:14:38 +08:00
对话日程可行性评估.md feat: add temporal companion calendar 2026-07-25 01:35:56 +08:00
运维陪伴错题本.md fix: stop leaking downloaded vision temp files on every non-group path 2026-07-27 05:36:12 +08:00
错题本.md feat: complete M6.1.3-R2 through M6.1.7 bot personal archive contract 2026-07-27 01:37:40 +08:00