W21: anthropic Stream+Tools + --prompt batch + sanitizer fix + plugin unit tests (W21.1-W21.6)
Some checks failed
CI / Determine matrix (push) Has been cancelled
CI / ${{ matrix.os }} / ${{ matrix.build_type }} (push) Has been cancelled
CI / Sanitizer (ASan+UBSan) / ubuntu-24.04 (push) Has been cancelled

- W21.1: ci-sanitize preset 独立 Linux-clang + ci-threadsan (TSan)
- W21.2: anthropic tool_use content_block 解析 + configure 缓存 tools_json
- W21.3: --prompt 非交互批处理模式
- W21.4: session auto-save 失败告警 + 当前目录 fallback
- W21.5: smoke 补 tool_calls 边界用例 4 块 12 断言
- W21.6: anthropic 11 块 78 CHECK + deepseek 12 块 78 CHECK

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 20:40:58 +08:00
parent 20ead86e88
commit b2b381b9b3
14 changed files with 1671 additions and 34 deletions

View File

@@ -344,7 +344,16 @@ static int on_init(const dstalk_host_api_t* host) {
static void on_shutdown() {
try {
// W20.6: 清空前自动保存到默认路径
session_save(get_default_session_path().c_str());
// W21.4: 失败告警 + 当前目录 fallback
int ret = session_save(get_default_session_path().c_str());
if (ret != 0) {
const dstalk_host_api_t* h = g_host.load(std::memory_order_acquire);
if (h) h->log(DSTALK_LOG_WARN, "on_shutdown[session]: auto-save failed (ret=%d), trying fallback", ret);
int fret = session_save("./dstalk_session_backup.json");
if (fret != 0) {
if (h) h->log(DSTALK_LOG_ERROR, "on_shutdown[session]: fallback also failed (ret=%d), data may be lost", fret);
}
}
std::lock_guard<std::mutex> lock(g_session_mutex);
rebuild_cached_history_locked();