提交图

24 提交

作者 SHA1 备注 提交日期
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
d4e0125600 fix: let emotion decay run during continuous conversation
updated_ts carried two meanings. In _decay_* it is the settlement anchor --
"these values are settled up to this moment" -- and a previous round taught it
to hold still when less than one step of time has passed, so short gaps could
accumulate. In _update_* it was treated as "last written at" and set
unconditionally, outside every event branch. The main chat path calls
_update_* on every private message, so the anchor was reset faster than one
step could ever elapse and the decay branch never ran. Measured over an hour
of 30-second messages, all four Izard dimensions and the Plutchik values had
not moved a single step.

The two dimension sets also share one anchor, so nudging joy or trust froze
anger, sadness and fear along with them -- an hour of affectionate conversation
still ended with anger pinned at its peak.

Removed both unconditional writes and gave the anchor back to _decay_*.
Conditioning them on "did an event fire" would be wrong too: the apology and
comfort branches lower emotion, which is even less reason to restart the decay
clock. Nothing else reads the field -- only the two decay functions do, the
panel summary and frontend ignore it, and the hurt-aftermath gates use three
separate timestamps.

Companion suite 235 passed; the four new tests fail on the pre-fix code.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:27:40 +08:00
589a4ce39a fix: settle windows from a durable cursor, align idempotency keys and clocks
_agenda_closed_windows scanned a fixed -3..+1 day range. Past three days of
downtime the missed windows were never settled and left no trace -- "zero
snapshots" and "not due yet" look identical from the data, which is why this
sat in the backlog for four rounds. It now scans forward from a persisted
agenda_last_settled cursor, falling back to the old three days when the cursor
is absent. Catch-up is capped at 30 days and says so in the log rather than
truncating silently. The cursor advances only after both the snapshot and the
reconciliation are written, and never moves backwards.

Two long-deferred contract deviations went with it. reconciliation_id already
carries its own "reconciliation:" prefix and got another one on top; window
snapshots used the internal snapshot id as a business key. Both now go through
_bot_personal_window_key and match the formats the frozen contract recommends.
Records already stored keep their old keys -- settlements and snapshots are
terminal per-window writes, so there is nothing left to update.

The outbox called datetime.now() directly while window attribution used the
plugin's _environment_now. The now parameter had been there all along and no
caller passed it, which is more hidden than not having it at all. All eight
call sites now pass the plugin clock; the test asserts a 2031 timestamp so a
system-clock regression cannot pass.

Companion suite 231 passed, joint E2E 135/135. VM restarted clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:09:11 +08:00
cdc402888b fix: clear the three P0 defects that were bleeding in production
All three shared a shape: the symptom was invisible from the data, so every
acceptance run stayed green while the VM was failing.

daily_state still called _ensure_daily_news_reading, removed when the news
feature was retired. The VM threw AttributeError 14 times in three hours and
marked the "today's schedule" maintenance step failed, but the crash sits
after the plan is saved -- so the stored plan always looked correct. Removed
the call and added a repo-wide scan rather than a single-point assertion,
since this kind of residue is by definition somewhere you did not look.

enable_memory_companion_bridge, the master switch for the whole archive
chain, was never added to _conf_schema.json. _cfg_bool falls back to True, so
the feature worked and only its operability was missing -- nothing could have
failed. It now sits in the visible external_memory_config group, with an
assertion that _flat_get still resolves it by flat key.

A fallback plan carried today's date, and all three reuse branches key on the
date alone, so one startup timing hiccup froze a template plan into the day
and archived it as real. source="fallback" was produced and never consumed;
now a fallback can be upgraded once the provider is back, capped at three
attempts and bucketed per day.

Also fixed two test files whose classes sat after the __main__ guard (silently
dropped when run directly) and the retired-config prefix list, which only
listed the uppercase WEB_EXPLORATION_ form and missed the lowercase schema keys.

VM after restart: 0 AttributeError, 0 ERRO/Traceback, plan intact at v2/llm,
switch materialised as True. Companion suite 218 passed, joint E2E 135/135.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:01:56 +08:00
2518f7b6bf fix: make the daily plan chain survive startup timing and same-day rewrites
Two defects that only showed up on the real machine, both of which left the
schedule frozen on a fallback plan with nothing in the logs to say so.

The plugin asked for a chat provider 0.8s before AstrBot finished loading
them, wrote a template fallback, and stamped it with today's date -- so the
next 24 hours never retried. Resolution now falls back through get_config()
(4.26.6's Context exposes nothing else) and validates the configured id with
get_provider_by_id, because a configured default is not a loaded instance.
When nothing is ready yet the round is skipped instead of downgraded, up to
DAILY_PLAN_PROVIDER_MAX_WAITS rounds.

Once the model recovered, the real plan still could not reach the archive:
the idempotency key is always daily_plan:<date> but the plan dict never
carried a version, so every rewrite re-sent v1 and the memory side rejected
it as version_conflict. The companion swallowed that -- outbox state is only
touched when enqueue accepts, and a same key/version enqueue does not. Plans
now carry a version watermark drawn from both daily_plan and its history, and
any ok=False archive response logs a warning regardless of outbox state.

Verified on the VM: provider wait counted once and no fallback written, plan
generated at v2 with 10 segments from the model, and the stored record
upserted from the 8-segment fallback to the same v2 content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 04:16:06 +08:00
agent-bot
56444d59dd docs: record M6.1.8 rollback-copy-in-scan-dir pitfall
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 01:48:26 +08:00
agent-bot
85d5069bbd feat: complete M6.1.3-R2 through M6.1.7 bot personal archive contract
M6.1.3-R2 非五类兼容(阻断修复):DTO date 缺失时从 occurred_at 派生,
刻意不做时区换算以与 _infer_window 同一时钟;calendar_event 取 start_at、
creative_progress 取 project.updated_at;未知 kind 不再默认 bot_observed_activity;
capture_hard_fact L4→L3;TYPE_CONTRACTS 覆盖全部 12 类,修复非五类 source_kind
兜底成 observed 污染本地记录;proactive_message 的 image_path 改为 has_image+
image_name(原样透传会被自身隐私校验整条静默丢弃);snapshot/daily_plan 透传 version。

M6.1.4 创作/媒体/主观分域:creative_progress 补 chunk 形参(生产调用点一直 TypeError
导致创作推进整步被阻断)并只留里程碑摘要;photo_generation 改为媒体索引
(原 payload 带 prompt 键与绝对路径,100% 静默丢弃);幂等键纳入隐私校验;
禁用键清单收窄,放行媒体标识键;两条 Bridge 路径统一送 body payload。

M6.1.5 Bot 专用检索 Profiles:按 Profile 分槽注入,固定槽位与条数、跨槽去重、
声明当前以本地运行态为准;旧版记忆插件回退通用检索。

M6.1.6 分层只读 API:新增 build_agenda_runtime_view 与 GET /agenda/runtime,
记忆插件停用时仍完整返回并标降级。

M6.1.7 隐私与残余收口:DTO 新增 contexts 禁用键;已删除娱乐功能(qzone/news/
web_exploration)的残余配置入口从展示面隐藏,旧值保留不删。

测试:174 项通过(pytest 与 unittest 双口径)。联合 E2E 135 项全部通过。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 01:37:40 +08:00
0e0db82519 feat: link bot personal memory bridge 2026-07-26 03:14:03 +08:00
fc1f69898a docs: record q8 vm deployment acceptance 2026-07-26 03:00:48 +08:00
a4af89562f feat: add ops companion frontend center 2026-07-26 02:55:59 +08:00
aa220a8f69 docs: clarify vm clock in acceptance record 2026-07-26 01:56:48 +08:00
868225270d docs: record ops companion deployment acceptance 2026-07-26 01:56:15 +08:00
f4d160ce86 feat: remove ops entertainment integrations 2026-07-26 01:32:07 +08:00
6afa64bb51 docs: add frontend migration contract 2026-07-26 00:14:38 +08:00
0113666e5c docs: record q7 vm acceptance 2026-07-26 00:14:02 +08:00
cd9d554e0a feat: freeze ops backend page contracts 2026-07-26 00:05:56 +08:00
7b68b0625c feat: isolate bot self storage from user memory 2026-07-25 23:22:41 +08:00
12a2fd0ade docs: record ops companion VM deployment 2026-07-25 01:46:37 +08:00
0e2848db14 feat: add temporal companion calendar 2026-07-25 01:35:56 +08:00
8722ce746d docs: record ops deployment validation pitfalls 2026-07-24 22:17:41 +08:00
234030be2e chore: disable livingmemory in ops vm 2026-07-24 21:42:53 +08:00
f7c29f0e54 feat: add safe companion data migration 2026-07-24 21:10:46 +08:00
f496570b30 feat: initialize operations companion branch 2026-07-24 00:41:00 +08:00
6eaf1b7634 chore: import companion baseline 2026-07-24 00:25:43 +08:00