feat: add tiered durable state and memory bounds

This commit is contained in:
CoolBoy
2026-08-22 14:15:25 +08:00
parent 6eb7ded984
commit 5b1ec4d3eb
11 changed files with 722 additions and 40 deletions

View File

@@ -375,11 +375,32 @@ probe and `/ready` reports worker availability. Poll and cleanup summaries are
bounded in memory, and the last 200 worker crash records are synchronized with
the durable state branch for post-restart diagnosis.
Version `2026.08.22.1` adds tiered durable outcome storage and hard runtime memory
bounds. The live `agent-state` branch contains only pending outcomes, an
aggregate checkpoint, and the most recent terminal window; completed raw
outcomes are sanitized, gzip-compressed, and uploaded to monthly
`agent-archive-YYYY-MM` branches. A restart restores only the live branch, so it
retains lifetime success statistics and architecture evidence without cloning or
parsing the full history. The first upgrade automatically compacts a legacy
outcome file after 2,000 records; later compactions are incremental.
Candidate preparation now retains at most 100 distinct models (up to three
routes per model) per cycle by default. ModelScope repository-tree, config,
model-card, modification-time, and page caches use bounded LRU eviction, which
prevents memory use from growing with every poll cycle. These limits can be
tuned with `--candidate-pool-limit`, `MODELHUB_AGENT_OUTCOME_COMPACT_THRESHOLD`,
`MODELHUB_AGENT_RECENT_OUTCOME_LIMIT`,
`MODELSCOPE_DETAIL_CACHE_MAX_MODELS`, and `MODELSCOPE_PAGE_CACHE_MAX_PAGES`.
Cold archive upload is best-effort and retried on later state synchronizations;
the aggregate checkpoint remains the authoritative recovery input even while an
archive shard is awaiting upload. ModelHub Git traffic is excluded from proxy
routing in the container to avoid deployment-specific Git failures.
## Deploy
Create a tag and submit the repository URL plus tag in "我的适配智能体".
```bash
git tag -a agent-v28 -m "ModelHub agent 2026.08.21.1"
git push origin main agent-v28
git tag -a agent-v29 -m "ModelHub agent 2026.08.22.1"
git push origin main agent-v29
```